Section: 18.104.22.168 [string.capacity] Status: CD1 Submitter: Chris Newton Opened: 2000-08-27 Last modified: 2016-02-10
Priority: Not Prioritized
View other active issues in [string.capacity].
View all other issues in [string.capacity].
View all issues with CD1 status.
Paraphrased from a message that Chris Newton posted to comp.std.c++:
The standard's description of basic_string<>::operator seems to violate const correctness.
The standard (21.3.4/1) says that "If pos < size(), returns data()[pos]." The types don't work. The return value of data() is const charT*, but operator has a non-const version whose return type is reference.
In section 21.3.4, paragraph 1, change "data()[pos]" to "*(begin() + pos)".