Boost logo

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>,
  foo(T t);

or, if you insist, the usually-less-efficient

  template <class T>
  typename enable_if_c
       condition1::value && condition2::value,
  foo(T t);

Dave Abrahams
Boost Consulting

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at