Date: Thu, 24 Apr 2025 13:55:39 +0300
On Thu, 24 Apr 2025 at 13:48, Andrey Semashev via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> > No, a moved-from std::list also needs to support all operations that
> > have no preconditions, such as size() and empty() and begin() and end().
>
> Well, likewise, citation needed. As far as I know, the standard doesn't
> formally define requirements on the moved-from objects.
Yes, it does. Your citation is [defns.valid]:
〈library〉 value of an object that is not specified except that the
object’s invariants are met and operations on
the object behave as specified for its type
[Example 1 : If an object x of type std::vector<int> is in a valid but
unspecified state, x.empty() can be called
unconditionally, and x.front() can be called only if x.empty() returns
false. — end example]
<std-proposals_at_[hidden]> wrote:
> > No, a moved-from std::list also needs to support all operations that
> > have no preconditions, such as size() and empty() and begin() and end().
>
> Well, likewise, citation needed. As far as I know, the standard doesn't
> formally define requirements on the moved-from objects.
Yes, it does. Your citation is [defns.valid]:
〈library〉 value of an object that is not specified except that the
object’s invariants are met and operations on
the object behave as specified for its type
[Example 1 : If an object x of type std::vector<int> is in a valid but
unspecified state, x.empty() can be called
unconditionally, and x.front() can be called only if x.empty() returns
false. — end example]
Received on 2025-04-24 10:55:54