Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-07-09 15:33:02


Jaakko Jarvi <jajarvi_at_[hidden]> writes:

> Where we've used enable_if, it has been very common that the condition
> is not just a single traits lookup, but rather a logical expression,
> e.g.:
>
> template <class T, class U>
> typename enable_if<is_matrix<T>::value && is_vector<U>::value,...>::type
> operator*(const T& t, const U& u);
>
> So definitely, this version of enable_if is needed.

really?

    template <class T, class U>
    typename enable_if<mpl::and<is_matrix<T>, is_vector<U> >,...>::type
    operator*(const T& t, const U& u);

looks better to me.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk