Are variadic-functions kind of deprecated since C++11 has variadic template functions ? More specifically, do variadic-function have any advantage in a particular situation ? I know variadic-macros can have their uses. What about variadic functions ?
Variadic templates are variadic at compile time; variadic functions are variadic at run time. In other words, a variadic template function is compiled to accept however many parameters are passed to it, while a regular variadic function is compiled to accept any number of parameters.
You can put a variadic function like printf into a library and ship it to somebody to use without source code. You cannot do that with a template function because its source code needs to be available to the caller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With