Created on 2008-06-24.00:00:00 last changed 162 months ago
Proposed resolution:
Option (C):
In [container.requirements.general] change Table 90 -- Container requirements as indicated:
Change the text in the Assertion/note column in the row for "X u;" as follows:
post: u.
size() == 0empty() == trueChange the text in the Assertion/note column in the row for "X();" as follows:
X().
size() == 0empty() == trueChange the text in the Operational Semantics column in the row for "a == b" as follows:
== is an equivalence relation.
a.size()distance(a.begin(), a.end()) ==b.size()distance(b.begin(), b.end()) && equal(a.begin(), a.end(), b.begin())Add text in the Ass./Note/pre-/post-condition column in the row for "a == b" as follows:
Requires: T is EqualityComparable
Change the text in the Operational Semantics column in the row for "a.size()" as follows:
a.end() - a.begin()distance(a.begin(), a.end())Change the text in the Operational Semantics column in the row for "a.max_size()" as follows:
size()distance(begin(), end()) of the largest possible containerChange the text in the Operational Semantics column in the row for "a.empty()" as follows:
a.size() == 0a.begin() == a.end()In [container.requirements.general] change Table 93 — Allocator-aware container requirements as indicated:
Change the text in the Assertion/note column in the row for "X() / X u;" as follows:
Requires: A is DefaultConstructible post:
u.size() == 0u.empty() == true, get_allocator() == A()Change the text in the Assertion/note column in the row for "X(m) / X u(m);" as follows:
post:
u.size() == 0u.empty() == true, get_allocator() == mIn [sequence.reqmts] change Table 94 — Sequence container requirements as indicated:
Change the text in the Assertion/note column in the row for "X(n, t) / X a(n, t)" as follows:
post:
size()distance(begin(), end()) == n [..]Change the text in the Assertion/note column in the row for "X(i, j) / X a(i, j)" as follows:
[..] post:
size() == distance between i and jdistance(begin(), end()) == distance(i, j) [..]Change the text in the Assertion/note column in the row for "a.clear()" as follows:
a.erase(a.begin(), a.end()) post:
size() == 0a.empty() == trueIn [associative.reqmts] change Table 96 — Associative container requirements as indicated:
Not every occurrence of size() was replaced, because all current associative containers have a size. The following changes ensure consistency regarding the semantics of "erase" for all tables and adds some missing objects
Change the text in the Complexity column in the row for X(i,j,c)/Xa(i,j,c); as follows:
N log N in general (N == distance(i, j)
is the distance from i to j); ...Change the text in the Complexity column in the row for "a.insert(i, j)" as follows:
N log(a.size() + N)
(N is the distance from i to j)where N == distance(i, j)Change the text in the Complexity column in the row for "a.erase(k)" as follows:
log(a.size()) + a.count(k)
Change the text in the Complexity column in the row for "a.erase(q1, q2)" as follows:
log(a.size()) + N where N
is the distance from q1 to q2== distance(q1, q2).Change the text in the Assertion/note column in the row for "a.clear()" as follows:
a.erase(a.begin(),a.end()) post:
size() == 0a.empty() == trueChange the text in the Complexity column in the row for "a.clear()" as follows:
linear in a.size()
Change the text in the Complexity column in the row for "a.count(k)" as follows:
log(a.size()) + a.count(k)
In [unord.req] change Table 98 — Unordered associative container requirements as indicated:
The same rational as for Table 96 applies here
Change the text in the Assertion/note column in the row for "a.clear()" as follows:
[..] Post: a.
size() == 0empty() == true
[ 2010 Pittsburgh: ]
Moved to Ready for Pittsburgh.
[ 2010-01-30 Howard updated Table numbers. ]
[ 2009-10 Santa Cruz: ]
Reopened. N2986 was rejected in full committee on procedural grounds.
[ 2009-10 Santa Cruz: ]
Mark NAD Editorial. Addressed by N2986.
[ 2009-07-26 Daniel updated proposed resolution C. ]
[ 2009-07 Frankfurt ]
Other operational semantics (see, for example, Tables 82 and 83) are written in terms of a container's size() member. Daniel to update proposed resolution C.
Howard: Commented out options A and B.
[ post San Francisco: ]
Martin provided wording for Option C.
[ San Francisco: ]
There's an Option C: change the requirements table to use distance().
LWG found Option C acceptable.
Martin will draft the wording for Option C.
Table 89, Container requirements, defines operator== in terms of the container member function size() and the algorithm std::equal:
== is an equivalence relation. a.size() == b.size() && equal(a.begin(), a.end(), b.begin()
The new container forward_list does not provide a size member function by design but does provide operator== and operator!= without specifying it's semantic.
Other parts of the (sequence) container requirements do also depend on size(), e.g. empty() or clear(), but this issue explicitly attempts to solve the missing EqualityComparable specification, because of the special design choices of forward_list.
I propose to apply one of the following resolutions, which are described as:
Both proposal choices are discussed, the preferred choice of the author is to apply (A).
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg4101 |
2010-10-21 18:28:33 | admin | set | messages: + msg4100 |
2010-10-21 18:28:33 | admin | set | messages: + msg4099 |
2010-10-21 18:28:33 | admin | set | messages: + msg4098 |
2010-10-21 18:28:33 | admin | set | messages: + msg4097 |
2010-10-21 18:28:33 | admin | set | messages: + msg4096 |
2010-10-21 18:28:33 | admin | set | messages: + msg4095 |
2010-10-21 18:28:33 | admin | set | messages: + msg4094 |
2010-10-21 18:28:33 | admin | set | messages: + msg4093 |
2008-06-24 00:00:00 | admin | create |