For this non-invariant example:
int Func1(); double Func2(); void MyFunc( int, double ); int main() { MyFunc( Func1(), Func2() );
it is not indicated whether Func1() or Func2() calculated first, only that both must be executed before calling MyFunc() .
How does this sequencing work with variable argument expansion?
template < typename Func, typename ...Args > void MyFunc2( Func &&f, Args&& ...a ) { int b[] = { f( std::forward<Args>(a) )... };
Let's say that f is an object of a function that changes its state after the first call. Call f for each segment a ? In other words, whether f will be called in the first element in list a , then the second element, third, etc. Instead of accidentally skipping through an extended list? Is there something we used to call the points of the sequence between each element?
c ++ sequence-points c ++ 11 variadic-functions variadic-templates
CTMacUser May 26 '12 at 8:46 a.m. 2012-05-26 08:46
source share