c++ - Language feature to apply function to each element of a parameter pack -


does know, if there exists standards proposal c++ language feature allow me replace (thanks yakk):

template<class... args> void bar(const args& ... args) {             auto t = { (foo(args),0)... };     (void) t; //<- prevent warning unused variable } 

with more natural this:

template<class... args> void bar(const args& ... args) {             foo(args)...; } 

foo being e.g. function, function template and/or overloaded set of those, return type might void (or in general don't care about).

btw, if knows more concise way write in c++14, feel free share, think, handled in this question

use fold expression comma operator:

( void(foo(args)) , ...); 

i didn't see proposal change further in recent mailings.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

c# - Can I intercept a SOAP response in .NET before a content type binding mismatch ProtocolException? -

css - Can I use the :after pseudo-element on an input field? -