Boost logo

Boost :

From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2007-11-09 03:38:36


On Nov 9, 2007 2:06 AM, Sergey Shandar <sergey_at_[hidden]> wrote:
> [...]
> 3. I found this one today:
>
> template<class T>
> operator T &() const
> throw(typename ::boost::disable_if< ::boost::is_same<T, MyClass
> const> >::type *)
>

Wow! Does this really work? You can really apply SFINAE to conversion
opreators by
(ab)using the exception specification? Is this only a gcc thing or is
it "by the standard"?

If the latter, boost::enable_if documents might need to be updated :)

--
gpd

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