Created on 2016-11-09.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4606.
Change [any.cons] p2:
any(const any& other);Effects:
Constructs an object of type any with an equivalent state as other.If other.has_value() is false, constructs an object that has no value. Otherwise, equivalent to any(in_place<T>, any_cast<const T&>(other)) where T is the type of the contained object.
Change [any.cons] p4:
any(any&& other);Effects:
Constructs an object of type any with a state equivalent to the original state of other.If other.has_value() is false, constructs an object that has no value. Otherwise, constructs an object of type any that contains either the contained object of other, or contains an object of the same type constructed from the contained object of other considering that contained object as an rvalue.
[ Issues Telecon 16-Dec-2016 ]
Move to Tentatively Ready
[ 2016-11-08, Jonathan comments and suggests wording ]
We can rephrase the copy constructor in terms of equivalence to construction from the contained object. We need to use in-place construction to avoid recursion in the case where the contained object is itself an any.
For the move constructor we don't simply want to construct from the contrained object, because when the contained object is stored in dynamic memory we don't actually construct anything, we just transfer ownership of a pointer.Addresses US 29
What does it mean for (the contained) objects to be "equivalent"? Suggested resolution: Add definition (note that using operator==() involves complicated questions of overload resolution).History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2017-03-05 23:41:16 | admin | set | status: ready -> wp |
2016-12-16 20:56:38 | admin | set | messages: + msg8721 |
2016-12-16 20:56:38 | admin | set | status: new -> ready |
2016-11-09 18:55:50 | admin | set | messages: + msg8584 |
2016-11-09 18:55:50 | admin | set | messages: + msg8583 |
2016-11-09 00:00:00 | admin | create |