Created on 2013-01-09.00:00:00 last changed 130 months ago
Proposed resolution:
This wording is relative to N3485.
Change Table 100 as indicated:
Table 100 — Sequence container requirements (in addition to container) (continued) Expression Return type Assertion/note pre-/post-condition … a.clear() void Destroys all elements in a. Invalidates all
references, pointers, and iterators referring to
the elements of a and may invalidate the
past-the-end iterator.
post: a.empty() returns true
complexity: linear…
[ 2013-04-20 Bristol ]
[ 2013-03-15 Issues Teleconference ]
Moved to Tentatively Ready.
From the question at stackoverflow.
Were we aware that the resolution to LWG 704 means there is no complexity guarantee for clear() on most sequence containers? Previously it was implied by defining it in terms of erase(begin(), end()) but we no longer do that.
There are explicit complexity requirements for std::list::clear(), but not the other sequence containers.
Daniel:
The idea was that the notion of "destroys all elements in a" would imply a linear complexity, but the wording needs to be clearer, because this doesn't say that this step is the actual complexity bound.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-20 13:20:35 | admin | set | status: wp -> c++14 |
2013-04-25 19:07:07 | admin | set | status: voting -> wp |
2013-04-19 22:36:19 | admin | set | messages: + msg6491 |
2013-04-19 22:36:19 | admin | set | status: ready -> voting |
2013-03-18 14:33:00 | admin | set | messages: + msg6439 |
2013-03-18 13:02:36 | admin | set | status: new -> ready |
2013-01-11 22:53:36 | admin | set | messages: + msg6314 |
2013-01-09 00:00:00 | admin | create |