Created on 2008-08-22.00:00:00 last changed 162 months ago
Proposed resolution:
In [string.capacity], just after p. 1 add a new paragraph:
Throws: Nothing.
In [string.access] replace p. 1 by the following 4 paragraghs:
Requires: pos ≤ size().
Returns: If pos < size(), returns *(begin() + pos). Otherwise, returns a reference to a charT() that shall not be modified.
Throws: Nothing.
Complexity: Constant time.
In [string.accessors] replace the now common returns clause of c_str() and data() by the following three paragraphs:
Returns: A pointer p such that p+i == &operator[](i) for each i in [0, size()].
Throws: Nothing.
Complexity: Constant time.
[ 2009-07 Frankfurt ]
Move proposed resolution A to Ready.
Howard: Commented out part B.
[ San Francisco: ]
We oppose part 1 of the issue but hope to address size() in issue 877.
We do not support part B. 4 of the issue because of the breaking API change.
We support part A. 2 of the issue.
On support part A. 3 of the issue:
Pete's broader comment: now that we know that basic_string will be a block of contiguous memory, we should just rewrite its specification with that in mind. The expression of the specification will be simpler and probably more correct as a result.
During the Sophia Antipolis meeting it was decided to split-off some parts of the n2647 ("Concurrency modifications for basic_string") proposal into a separate issue, because these weren't actually concurrency-related. The here proposed changes refer to the recent update document n2668 and attempt to take advantage of the stricter structural requirements.
Indeed there exists some leeway for more guarantees that would be very useful for programmers, especially if interaction with transactionary or exception-unaware C API code is important. This would also allow compilers to take advantage of more performance optimizations, because more functions can have throw() specifications. This proposal uses the form of "Throws: Nothing" clauses to reach the same effect, because there already exists a different issue in progress to clean-up the current existing "schizophrenia" of the standard in this regard.
Due to earlier support for copy-on-write, we find the following unnecessary limitations for C++0x:
The proposed resolution is split into a main part (A) and a secondary part (B) (earlier called "Adjunct Adjunct Proposal"). (B) extends (A) by also making access to index position size() of the at() overloads a no-throw operation. This was separated, because this part is theoretically observable in specifically designed test programs.
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: + msg4153 |
2010-10-21 18:28:33 | admin | set | messages: + msg4152 |
2010-10-21 18:28:33 | admin | set | messages: + msg4151 |
2008-08-22 00:00:00 | admin | create |