"infinite" amount of params like printf... how to?

How do I make a function with an unspecified amount of parameters... like printf does()?

Cheers
In C++11 you can use variadic templates. The advantages with this approach is that it is more type safe and it's possible to verify that the number of arguments is correct.

http://en.wikipedia.org/wiki/Variadic_template
Look at the printf example.
Last edited on
Topic archived. No new replies allowed.