> -----Original Message----- > From: Eric Lemings > Sent: Monday, July 14, 2008 2:27 PM > To: '[email protected]' > Subject: Forward iteration in variadic templates > > > Consider the following function: > > template <class... Types> > void print (const Types&... values); > > How would you define print() to iterate forward from 0..N, > where N is sizeof... (Types), printing each argument X
...and its corresponding index... > in the > argument list (e.g. std::cout << X)? > > Thanks, > Brad. >
