Boost logo

Boost :

Subject: Re: [boost] [interest] underlying type library
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2011-08-23 05:27:53


On 23/08/11 09:05, Julian Gonggrijp wrote:
> Eric Niebler wrote:

>> Thought: the obvious default implementation should be to simply call
>> move, but this gets complicated because move operations can throw. Then
>> during unwinding you'll try to destruct an object that isn't in a
>> destructible state. You would need to find a way to address the
>> exception-safety issues. Perhaps the new noexcept keyword could help here.
>
> Coincidentally I've been thinking along similar lines. Normal copy
> assignment might be a very interesting fallback option for move_raw as
> well. I'll use this in my upcoming proposal.

I think this is the sort of thing that move_if_noexcept was designed
for. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2983.html

On the other hand, the authors there declare that move_if_noexcept
should never be used in new code, which should rather offer a
conditional strong guarantee, so maybe that's what you should do here.

John Bytheway


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