Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-12 17:34:51


"Paul Mensonides" <pmenso57_at_[hidden]> writes:

> ----- Original Message -----
> From: "David Abrahams" <dave_at_[hidden]>
>
>> I'd prefer it if matching void in a parameter list *were* different
>> from generating one. The above prevents the use of SFINAE to generate
>> restricted templated conversion operators.
>
> Dave, what exactly are you trying to restrict? The implicit conversion from
> "some type" to the type you are defining or conversion of the type you are
> defining to only a selected few types?

The latter. It was just an experiment. Fortunately, nothing I'm
doing depends very much on it. It was prompted by the fact that
Borland 5.51 can handle enable_if, but not in a templated constructor:

template <class T>
struct X
{
    template <class U>
    X(X<U> const&, typename enable_if<some_property_of<U>::value, int*>::type = 0);
}

The parser chokes on the first '<' inside the parens.

I was going to try attacking it from the other direction, by defining
a conversion operator.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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