Boost logo

Boost :

Subject: Re: [boost] [utility/value_init] boost::value_initialized<T> direct-initialized?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-04-02 11:24:05


AMDG

Niels Dekker - address until 2010-10-10 wrote:
> Jeffrey Lee Hellrung, Jr. wrote:
>> What do you think about using the templated constructor *and* SFINAE out
>> via enable_if the binding of U to initialized<T> (or, maybe, to any
>> class derived from initialized<T>)?
>
> SFINAE/enable_if might be interesting indeed, but I'm not sure if it's
> really necessary. And I don't think it will help to work around the
> specific MSVC bug
> <http://connect.microsoft.com/VisualStudio/feedback/details/423737>.
>
> Here is an example that fails to compile on MSVC because of the
> compiler bug. Please let me know if you can fix it by SFINAE. (But I'm
> afraid it won't work.)

I'm not sure if I missed something, but this seems to work

      template<class U>
      explicit initialized(const U& arg,
          typename
boost::disable_if<boost::is_base_and_derived<initialized, U> >::type* = 0)

In Christ,
Steven Watanabe


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