vendredi 23 janvier 2015

Demystifying Sean Parent's for_each_argument [duplicate]


This question already has an answer here:




I saw Sean Parent's recent tweet showing the following function:



template <class F, class... Args>
void for_each_argument(F f, Args&&... args) {
[](...){}((f(std::forward<Args>(args)), 0)...);
}


I can run it and it behaves as I would expect, but I can't understand how it works. Is that an empty lambda?


Aucun commentaire:

Enregistrer un commentaire