Boost logo

Boost :

From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2003-07-09 15:40:17


In our last exciting episode Thomas Witt wrote:
> User-Agent: KMail/1.5

> On Wednesday 09 July 2003 21:09, Jaakko Jarvi wrote:
> > 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);

> Ok I can see the problem, but what about

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

Would work. Requires some knowledge of mpl and a tiny file to be
included, though. Our view is still that at least the enable_if<bool, T> version
is needed. The mpl-aware enable_if would be good to have too.

  Jaakko & Jeremiah


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