Boost logo

Boost :

Subject: Re: [boost] [move] New version with move-aware containers library
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-04-15 21:45:28


AMDG

David Abrahams wrote:
> Here's one thing I don't love:
>
> Derived(BOOST_RV_REF(Derived) x) // Move ctor
> : Base(boost::move(static_cast<Base&>(x))),
> mem_(boost::move(x.mem_)) { }
>
> is there a way to get rid of the static_cast and make
>
> Derived(BOOST_RV_REF(Derived) x) // Move ctor
> : Base(boost::move(x)),
> mem_(boost::move(x.mem_)) { }
>
> work?
>

FWIW, I always write copy constructors using the cast, after having
been bitten by templated base class constructors a few times.

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