
9 Feb
2011
9 Feb
'11
1:50 a.m.
AMDG On 2/8/2011 5:38 PM, Lorenzo Caminiti wrote:
Is there a way to determine at compile-time the number of parameters with default values from a function type?
For example, can I program the following `count_defaults` metafunction?
count_defaults< bool(*)(int x, int y)>::value // == 0 count_defaults< bool(*)(int x, int y = 1>::value // == 1 count_defaults< bool(*)(int x = 2, int y =1)>::value // == 2
(If this is possible, it could be added to Boost.FunctionTypes.)
No. The default parameters are not part of the type. In Christ, Steven Watanabe