Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default arguments and variadic functions

Is there any way to specify a default parameter in a variadic function?(Applies to templates also)

like image 476
nakiya Avatar asked Nov 09 '10 04:11

nakiya


1 Answers

In C++ you can replace the variadic function with one based on the Named Parameter Idiom.

See the C++ FAQ item 10.20 What is the "Named Parameter Idiom"?.

That gives you default functionality & convenient notation.

Cheers & hth.,

like image 89
Cheers and hth. - Alf Avatar answered Sep 28 '22 06:09

Cheers and hth. - Alf