4 ms·
C++17 fold expressions will make this kind of thing a bit more convenient and allow you to do some other neat things with a lot less boilerplate. http://en.cpp
by mattnewport 11y ago
C++17 fold expressions will make this kind of thing a bit more convenient and allow you to do some other neat things with a lot less boilerplate.
http://en.cppreference.com/w/cpp/language/fold http://en.cppreference.com/w/cpp/language/fold
- Camillo 11y agoWhat if you want to use a function instead of an operator?
- mattnewport 11y agoThen you just fold the comma operator.
- Camillo 11y agoI don't see how that would help. Maybe we're thinking of different things.
- mattnewport 11y agoYes, sorry, I misunderstood you. You can't use a fold expression to fold a binary function over a parameter pack as far as I know. You can fold application of a unary function using a fold over the comma operator though.