
11 Apr
2011
11 Apr
'11
9:16 p.m.
Matt Calabrese wrote:
Gevorg Voskanyan wrote:
Is there a particular reason you did it like: typename boost::enable_if< boost::is_arithmetic< T > >::type*& = boost::enabler instead of: typename Enable = typename boost::enable_if< boost::is_arithmetic< T >
::type ? The latter seems clearer to me and removes the need to introduce a boost::enabler identifier.
It's necessary because otherwise with two overloads you'd end up with two declarations that differ only in default arguments, which would be a compile error.
Yes, of course that's very true, I wonder how could I miss that! This could be included in the rationale section of the doc to prevent other users from being tempted to "simplify" it as I was. :) [snip] Thanks, Gevorg