
19 Aug
2013
19 Aug
'13
2:42 p.m.
On 19/08/13 01:54, Matt Calabrese wrote:
On Sun, Aug 18, 2013 at 4:16 PM, paul Fultz
wrote:
So functions can be defined like this:
template
ZEN_FUNCTION_REQUIRES(is_arithmetic<T>, is_arithmetic<U>) (T) max(T x, U y) { return x > y : x ? y; } How is this different from:
template< class T, class U , BOOST_ENABLE_IF( and_< is_arithmetic< T >, is_arithmetic< U > > ) > T max( T x, U y ) { /**/ }
(T) here is passed to a macro name returned by ZEN_FUNCTION_REQUIRES. This allows to generate normal enable_if code.