Boost logo

Boost :

Subject: [boost] G++ hack/challenge?
From: David Abrahams (dave_at_[hidden])
Date: 2009-04-30 11:50:18


Hi all,

In preparation for BoostCon, I'm looking for a workaround for the
problems described in
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2855.html. In
particular I need a way to detect whether a type "has a move
constructor" (without causing a compiler error, of course) in GCC 4.4.
Ideally, "has a move constructor" would mean

  - when constructed from an rvalue of the same type, a copy constructor
    with signature T(T const&) is not used.

though I would settle for

  - has a constructor with the signature T(T&&)

I'm willing to use G++-specific hackery if necessary.

I strongly suspect it's impossible, but if you can think of any way to
do it, I'd really appreciate knowing about it. You'll be my hero
forever ;-)

TIA,

-- 
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