|
Boost : |
Subject: Re: [boost] [move] New version with move-aware containers library
From: David Abrahams (dave_at_[hidden])
Date: 2009-04-17 14:07:14
on Wed Apr 15 2009, Steven Watanabe <watanabesj-AT-gmail.com> wrote:
> 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.
Hmm, good point.
-- 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