Boost logo

Boost Users :

Subject: Re: [Boost-users] enable_if on operator type()
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-11-23 17:11:01


On Sun, Nov 23, 2008 at 16:30, Joel Falcou <joel.falcou_at_[hidden]> wrote:
> How can I set up SFINAE using enable_if on method like
>
> struct foo
> {
> template<class T> operator T() { return T(1); }
> };
>
> I want the operator T() to be there only if T is arithemtic for example.
>

"There does not seem to be a way to specify an enabler for a
conversion operator. Converting constructors, however, can have
enablers as extra default arguments. " ~
http://www.boost.org/doc/libs/1_37_0/libs/utility/enable_if.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net