
On 8 January 2013 12:09, Peter Dimov <lists@pdimov.com> 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@eviloverlord.com> (847) 691-1404