Boost logo

Boost :

From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2003-07-03 09:43:03


In our last exciting episode Markus Werle wrote:

> With enable_if this can be reduced to say it once and for all times:
> Users just have to specialize a traits class

> template <class T> struct DaixtroseTraits
> {
> enum { use_default_ops = false };
> };

> and I change my operators to

> template <class T1, class T2
> enable_if
> <
> (
> (DaixtroseTraits<T1>::use_default_ops == true)
> &&
> (DaixtroseTraits<T2>::use_default_ops == true)
> ),
> SomeComplicatedType
> >::type
> operator+(T1 const &, T2 const &);

> and move them from namespace Daixtrose::Defaultops to namespace Daixtrose.
> What do You think? Did I miss any side effects?

I don't think you missed anything. That's the way it works, and it is
what we've been using in an ET-capable library for a while.

  Cheers, Jaakko


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