|
Boost Users : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-06-13 11:21:44
Howard Hinnant <hinnant_at_[hidden]> writes:
> 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_<condition1, condition2>,
^^^^^^^^^^
T
>::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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net