
9 Feb
2011
9 Feb
'11
1:38 a.m.
Hello all, 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.) Thank you. -- Lorenzo