|
Boost : |
Subject: Re: [boost] [variant] Basic rvalue and C++11 features support
From: Nevin Liber (nevin_at_[hidden])
Date: 2013-01-08 13:46:46
On 8 January 2013 12:09, Peter Dimov <lists_at_[hidden]> wrote:
> Paul Smith wrote:
>
>> Sure. My point was that "destructible and assignable" are not always
>> enough as far as the library goes.
>>
>
> Yes, I agree. To expand on that, the requirements defined by the standard
> library such as CopyConstructible, LessThanComparable, and so on, do not
> have preconditions. So if a movable type claims to conform to these
> requirements, it can't impose a precondition that the operations only work
> on values that haven't been moved from.
I believe it can. Take n3485 25.4p3 (Sorted and related operations): "For
algorithms other than those described in 25.4.3 to work
correctly, comp has to induce a strict weak ordering on the values."
This, for instance, allows sorting of doubles as long as none of them are
NaN.
-- Nevin ":-)" Liber <mailto:nevin_at_[hidden]> (847) 691-1404
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk