13 Jun
2004
13 Jun
'04
4:21 p.m.
Howard Hinnant
And you might prefer to place the condition on the return type for readability purposes:
template <class T> typename enable_if < condition1 && condition2, T
::type foo(T t);
Ahem. That would be:
template <class T>
typename enable_if
<
mpl::and_
::type foo(T t);
or, if you insist, the usually-less-efficient template <class T> typename enable_if_c ^^ < condition1::value && condition2::value, T
::type foo(T t);
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com