Boost logo

Boost :

Subject: Re: [boost] G++ hack/challenge?
From: David Abrahams (dave_at_[hidden])
Date: 2009-04-30 20:44:34


on Thu Apr 30 2009, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:

> David Abrahams wrote:
>> I need a way to detect whether a type "has a move
>> constructor" (without causing a compiler error, of course) in GCC 4.4.
>
> What about creating a type U that inherits from T, does using T::T, and deletes
> U(const U&).
> Now you just have to check whether U(make<U>()) is a valid expression
> using SFINAE for expressions.

Looks promising, but http://gcc.gnu.org/gcc-4.4/cxx0x_status.html
indicates there's no constructor inheritance yet, which I believe is
required for that using declaration. That's confirmed by my test with
g++-4.4 as available from macports. Trying again with macports/gcc-4.5
prerelease, just for fun.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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