From bb8a23ac3387977602c2632ad6f2b383a4c8f0c4 Mon Sep 17 00:00:00 2001
From: Paolo Carlini Reference ISO/IEC IS 14882:1998(E) Also see:
-
Doc. no.
-N1908=05-0168
+N1926=05-0186
Date:
-2005-10-23
+2005-12-16
Project:
@@ -20,7 +23,7 @@
Howard Hinnant <howard.hinnant@gmail.com>
C++ Standard Library Active Issues List (Revision R39)
+C++ Standard Library Active Issues List (Revision R40)
@@ -88,6 +91,10 @@
directory as the issues list files.
Section: 20.1.5 [lib.allocator.requirements] Status: Open Submitter: Matt Austern Date: 22 Aug 2000
->From lib-7752: +From lib-7752:
@@ -2408,7 +2415,7 @@ object throws. might reasonably swallow the exception, or call abort, or do something even more drastic.]
Section: 27.6.1.1.2 [lib.istream::sentry] Status: Open Submitter: Martin Sebor Date: 18 Sep 2003
+Section: 27.6.1.1.2 [lib.istream::sentry] Status: Open Submitter: Martin Sebor Date: 18 Sep 2003
27.6.1.1.2, p2 says that istream::sentry ctor prepares for input if is.good() @@ -2726,7 +2733,7 @@ ostream::write(). negative. Martin will do that review.]
Section: 17.3.1.1 [lib.structure.summary] Status: Open Submitter: Martin Sebor Date: 18 Sep 2003
+Section: 17.3.1.1 [lib.structure.summary] Status: Open Submitter: Martin Sebor Date: 18 Sep 2003
The text in 17.3.1.1, p1 says: @@ -2838,7 +2845,7 @@ object (e.g., slice (2, 1, 1) for a valarray of size 1). performance, so we don't want to require specific checking. We need wording to express this decision.]
Section: 20.1.5 [lib.allocator.requirements], 25 [lib.algorithms] Status: Open Submitter: Matt Austern Date: 20 Sep 2003
+Section: 20.1.5 [lib.allocator.requirements], 25 [lib.algorithms] Status: Open Submitter: Matt Austern Date: 20 Sep 2003
Clause 20.1.5 [lib.allocator.requirements] paragraph 4 says that implementations are permitted to supply containers that are unable to cope with allocator instances and that container implementations may assume @@ -3101,7 +3108,7 @@ operational semantics for this column to:
Section: 22.2.2.1.2 [lib.facet.num.get.virtuals] Status: Open Submitter: Martin Sebor Date: 16 Mar 2004
+Section: 22.2.2.1.2 [lib.facet.num.get.virtuals] Status: Open Submitter: Martin Sebor Date: 16 Mar 2004
When parsing strings of wide-character digits, the standard requires the library to widen narrow-character "atoms" and compare the widened atoms against the characters that are being parsed. @@ -3812,7 +3819,7 @@ list<double> > should not take O(1).
provide wording.]Section: 24.1.1 [lib.input.iterators] Status: Open Submitter: Chris Date: 16 Sep 2004
+Section: 24.1.1 [lib.input.iterators] Status: Open Submitter: Chris Jefferson Date: 16 Sep 2004
From comp.std.c++:
@@ -3856,7 +3863,7 @@ class I expect?
overloads. It's a minor problem but a real one. So leave open for now, hope we solve it as part of iterator redesign.]Section: 24.1.2 [lib.output.iterators] Status: Open Submitter: Chris Date: 13 Oct 2004
+Section: 24.1.2 [lib.output.iterators] Status: Open Submitter: Chris Jefferson Date: 13 Oct 2004
The note on 24.1.2 Output iterators insufficently limits what can be performed on output iterators. While it requires that each iterator is @@ -4826,7 +4833,7 @@ in each case as having some real type.
typedef RealType input_type;
Section: TR1 5.1.4.4 [tr.rand.eng.sub1] Status: New Submitter: Walter Brown Date: 3 Jul 2005
+Section: TR1 5.1.4.4 [tr.rand.eng.sub1] Status: New Submitter: Walter Brown Date: 3 Jul 2005
Paragraph 8 specifies the algorithm by which a subtract_with_carry_01 engine is to be seeded given a single unsigned long. This algorithm is seriously @@ -5117,7 +5124,7 @@ function's cv-qualifiers); the type T1 is cv T0*
Proposed resolution:
Section: TR1 6.1 [tr.tuple] Status: New Submitter: Andy Koenig Date: 3 Jul 2005
+Section: TR1 6.1 [tr.tuple] Status: New Submitter: Andy Koenig Date: 3 Jul 2005
Tuple doesn't define swap(). It should.
@@ -5301,7 +5308,7 @@ seem to be lacking a definition.Proposed resolution:
Section: 23.1.1 [lib.sequence.reqmts] Status: New Submitter: Chris Jefferson Date: 14 Sep 2005
+Section: 23.1.1 [lib.sequence.reqmts] Status: New Submitter: Chris Jefferson Date: 14 Sep 2005
Problem: There are a number of places in the C++ standard library where it is possible to write what appear to be sensible ways of calling @@ -5463,5 +5470,300 @@ same type, those signatures that become otherwise indistinguishable collapse into a single signature.
+Section: 17.4.3.8 [lib.res.on.required] Status: New Submitter: David Abrahams Date: 25 Oct 2005
++17.4.3.8/1 says: +
+ ++Violation of the preconditions specified in a function's +Required behavior: paragraph results in undefined behavior unless the +function's Throws: paragraph specifies throwing an exception when the +precondition is violated. ++ +
+This implies that a precondition violation can lead to defined +behavior. That conflicts with the only reasonable definition of +precondition: that a violation leads to undefined behavior. Any other +definition muddies the waters when it comes to analyzing program +correctness, because precondition violations may be routinely done in +correct code (e.g. you can use std::vector::at with the full +expectation that you'll get an exception when your index is out of +range, catch the exception, and continue). Not only is it a bad +example to set, but it encourages needless complication and redundancy +in the standard. For example: +
+ ++ +21 Strings library + 21.3.3 basic_string capacity + + void resize(size_type n, charT c); + + 5 Requires: n <= max_size() + 6 Throws: length_error if n > max_size(). + 7 Effects: Alters the length of the string designated by *this as follows: +
+The Requires clause is entirely redundant and can be dropped. We +could make that simplifying change (and many others like it) even +without changing 17.4.3.8/1; the wording there just seems to encourage +the redundant and error-prone Requires: clause. +
+ +Proposed resolution:
++1. Change 17.4.3.8/1 to read: +
+ ++Violation of the preconditions specified in a function's +Required behavior: paragraph results in undefined behavior ++ +unless the function's Throws: paragraph specifies throwing +an exception when the precondition is violated. +
+2. Go through and remove redundant Requires: clauses. Specifics to be + provided by Dave A. +
+Section: 21.3 [lib.basic.string] Status: New Submitter: Matt Austern Date: 15 Nov 2005
+Issue 69, which was incorporated into C++03, mandated + that the elements of a vector must be stored in contiguous memory. + Should the same also apply to basic_string?
+ +We almost require contiguity already. Clause 23.3.4 [lib.multiset] + defines operator[] as data()[pos]. What's missing + is a similar guarantee if we access the string's elements via the + iterator interface.
+ +Given the existence of data(), and the definition of + operator[] and at in terms of data, + I don't believe it's possible to write a useful and standard- + conforming basic_string that isn't contiguous. I'm not + aware of any non-contiguous implementation. We should just require + it. +
+Proposed resolution:
+Add the following text to the end of 23.3 [lib.associative], +paragraph 2.
+ +++The characters in a string are stored contiguously, meaning that if + s is a basic_string<charT, Allocator>, then + it obeys the identity + &*(s.begin() + n) == &*s.begin() + n + for all 0 <= n < s.size(). +
+
Section: 27.6.1.3 [lib.istream.unformatted] Status: New Submitter: Martin Sebor Date: 23 Nov 2005
++The array forms of unformatted input functions don't seem to have well-defined +semantics for zero-element arrays in a couple of cases. The affected ones +(istream::get() and istream::getline()) are supposed to +terminate when (n - 1) characters are stored, which obviously can +never be true when (n == 0) holds to start with. See +c++std-lib-16071. +
+Proposed resolution:
++I suggest changing 27.6.1.3, p7 (istream::get()), bullet 1 to read: +
++
+ +and similarly p17 (istream::getline()), bullet 3 to: + +
++
+ +In addition, to clarify that istream::getline() must not store the +terminating NUL character unless the the array has non-zero size, Robert +Klarer suggests in c++std-lib-16082 to change 27.6.1.3, p20 to read: + +
++
+ +In any case, provided (n > 0) is true, it then stores a null character +(using charT()) into the next successive location of the array. + ++ +
Section: TR1 6.1.3.5 [tr.tuple.rel] Status: New Submitter: David Abrahams Date: 29 Nov 2005
++Where possible, tuple comparison operators <,<=,=>, and > ought to be +defined in terms of std::less rather than operator<, in order to +support comparison of tuples of pointers. +
+Proposed resolution:
++change 6.1.3.5/5 from: +
+ ++ Returns: The result of a lexicographical comparison between t and + u. The result is defined as: (bool)(get<0>(t) < get<0>(u)) || + (!(bool)(get<0>(u) < get<0>(t)) && ttail < utail), where rtail for + some tuple r is a tuple containing all but the first element of + r. For any two zero-length tuples e and f, e < f returns false. ++ +
+to: +
+ ++++ Returns: The result of a lexicographical comparison between t and + u. For any two zero-length tuples e and f, e < f returns false. + Otherwise, the result is defined as: cmp( get<0>(t), get<0>(u)) || + (!cmp(get<0>(u), get<0>(t)) && ttail < utail), where rtail for some + tuple r is a tuple containing all but the first element of r, and + cmp(x,y) is an unspecified function template defined as follows. +
++ Where T is the type of x and U is the type of y: +
+ ++ if T and U are pointer types and T is convertible to U, returns + less<U>()(x,y) +
+ ++ otherwise, if T and U are pointer types, returns less<T>()(x,y) +
+ ++ otherwise, returns (bool)(x < y) +
+
Section: TR1 2.2.3.10 [tr.util.smartptr.getdeleter] Status: New Submitter: Paolo Carlini Date: 9 Nov 2005
++I'm seeing something that looks like a typo. The Return of get_deleter +says: +
++If *this owns a deleter d... ++
+but get_deleter is a free function! +
+Proposed resolution:
++Therefore, I think should be: +
++If+*thisp owns a deleter d... +
Section: 21.3 [lib.basic.string] Status: New Submitter: Alisdair Meredith Date: 16 Nov 2005
++OK, we all know std::basic_string is bloated and already has way too +many members. However, I propose it is missing 3 useful members that +are often expected by users believing it is a close approximation of the +container concept. All 3 are listed in table 71 as 'optional' +
+ ++i/ pop_back. +
+ ++This is the one I feel most strongly about, as I only just discovered it +was missing as we are switching to a more conforming standard library +<g> +
+ ++I find it particularly inconsistent to support push_back, but not +pop_back. +
+ ++ii/ back. +
+ ++There are certainly cases where I want to examine the last character of +a string before deciding to append, or to trim trailing path separators +from directory names etc. *rbegin() somehow feels inelegant. +
+ ++iii/ front +
+ ++This one I don't feel strongly about, but if I can get the first two, +this one feels that it should be added as a 'me too' for consistency. +
+ ++I believe this would be similarly useful to the data() member recently +added to vector, or at() member added to the maps. +
+Proposed resolution:
++
+Section: 21.3.5.8 [lib.string::swap] Status: New Submitter: Beman Dawes Date: 14 Dec 2005
++std::string::swap currently says for effects and postcondition: +
+ +++ ++Effects: Swaps the contents of the two strings. +
+ ++Postcondition: *this contains the characters that were in s, +s contains the characters that were in *this. +
+
+Specifying both Effects and Postcondition seems redundant, and the postcondition +needs to be made stronger. Users would be unhappy if the characters were not in +the same order after the swap. +
+Proposed resolution:
+++
+ +Effects: Swaps the contents of the two strings.++Postcondition: *this contains the same sequence of +characters that
+werewas in s, +s contains the same sequence of characters that +werewas in *this. +
----- End of document -----
\ No newline at end of file diff --git a/libstdc++-v3/docs/html/ext/lwg-defects.html b/libstdc++-v3/docs/html/ext/lwg-defects.html index 380c85e70e6..01c251dc462 100644 --- a/libstdc++-v3/docs/html/ext/lwg-defects.html +++ b/libstdc++-v3/docs/html/ext/lwg-defects.html @@ -1,15 +1,18 @@ -Doc. no. | -N1909=05-0169 | +N1927=05-0187 |
Date: | -2005-10-23 | +2005-12-16 |
Project: | @@ -20,7 +23,7 @@Howard Hinnant <howard.hinnant@gmail.com> |
Reference ISO/IEC IS 14882:1998(E)
Also see:
See 99-0040/N1216, October 22, 1999, by Stephen D. Clamage for the analysis supporting to the proposed resolution.
Section: 23.3.5 [lib.template.bitset] Status: TC Submitter: Matt Austern Date: 22 Jan 1998
+Section: 23.3.5 [lib.template.bitset] Status: TC Submitter: Matt Austern Date: 22 Jan 1998
(1) bitset<>::operator[] is mentioned in the class synopsis (23.3.5), but it is not documented in 23.3.5.2.
@@ -731,7 +738,7 @@ lists. do_narrow and do_widen should be copied from 22.2.1.3 [lib.facet.ctype.special].Section: 22.2.2.1.2 [lib.facet.num.get.virtuals] Status: TC Submitter: Nathan Myers Date: 6 Aug 1998
+Section: 22.2.2.1.2 [lib.facet.num.get.virtuals] Status: TC Submitter: Nathan Myers Date: 6 Aug 1998
This section describes the process of parsing a text boolean value from the input stream. It does not say it recognizes either of the sequences "true" or "false" and returns the corresponding bool value; instead, it says it recognizes @@ -810,7 +817,7 @@ change "&&" to "&".
err==str.failbit. --end example]Section: 22.2.2.1.1 [lib.facet.num.get.members] Status: TC Submitter: Nathan Myers Date: 6 Aug 1998
+Section: 22.2.2.1.1 [lib.facet.num.get.members] Status: TC Submitter: Nathan Myers Date: 6 Aug 1998
In the list of num_get<> non-virtual members on page 22-23, the member that parses bool values was omitted from the list of definitions of non-virtual members, though it is listed in the class definition and the corresponding @@ -894,7 +901,7 @@ one case. The resolution of this issue clarifies what the LWG believes to have been the original intent.
Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals] Status: TC Submitter: Nathan Myers Date: 6 Aug 1998
+Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals] Status: TC Submitter: Nathan Myers Date: 6 Aug 1998
The description of codecvt<>::do_out and do_in mentions a symbol "do_convert" which is not defined in the standard. This is a leftover from an edit, and should be "do_in @@ -2068,7 +2075,7 @@ character"
-In 27.6.1.3, [lib.istream.unformatted], paragraph 5. Change the +In 27.6.1.3, [lib.istream.unformatted], paragraph 7. Change the beginning of the first sentence of the effects clause from "Extracts characters" to "Behaves as an unformatted input function (as described in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts @@ -2246,7 +2253,7 @@ unformatted output function (as described in 27.6.2.6, paragraph 1)." by Judy Ward and Matt Austern. This proposed resolution is section VI of that paper.
Section: 27.6.1.3 [lib.istream.unformatted] Status: TC Submitter: Matt Austern Date: 6 Aug 1998
+Section: 27.6.1.3 [lib.istream.unformatted] Status: TC Submitter: Matt Austern Date: 6 Aug 1998
The introduction to the section on unformatted input (27.6.1.3) says that every unformatted input function catches all exceptions that were thrown during input, sets badbit, and then conditionally rethrows @@ -2340,7 +2347,7 @@ elaboration of the first.
(27.4.4.3), then the caught exception is rethrown.Section: D.7.1.3 [depr.strstreambuf.virtuals] Status: TC Submitter: Matt Austern Date: 18 Aug 1998
+Section: D.7.1.3 [depr.strstreambuf.virtuals] Status: TC Submitter: Matt Austern Date: 18 Aug 1998
D.7.1.3, paragraph 19, says that strstreambuf::setbuf "Performs an operation that is defined separately for each class derived from strstreambuf". This is obviously an incorrect @@ -2752,7 +2759,7 @@ returning eof or by throwing an exception; there are no other possibilities. The proposed resolution makes it clear that these two functions do get characters from a streambuf.
Section: 25 [lib.algorithms] Status: WP Submitter: Nico Josuttis Date: 29 Sep 1998
+Section: 25 [lib.algorithms] Status: WP Submitter: Nico Josuttis Date: 29 Sep 1998
The standard does not state, how often a function object is copied, called, or the order of calls inside an algorithm. This may lead to surprising/buggy behavior. Consider the following example:
@@ -3662,7 +3669,7 @@ to return a const char* not a const charT*. do_scan_not() to return a const charT*.Section: 26.3.2 [lib.template.valarray] Status: TC Submitter: Judy Ward Date: 15 Dec 1998
+Section: 26.3.2 [lib.template.valarray] Status: TC Submitter: Judy Ward Date: 15 Dec 1998
In Section 26.3.2 [lib.template.valarray] valarray<T>::operator!() is declared to return a valarray<T>, but in Section 26.3.2.5 [lib.valarray.unary] it is declared to return a valarray<bool>. The latter appears to be correct.
@@ -6450,7 +6457,7 @@ resolution is the one proposed by Howard.] to swap. Also, in 26.3.3.3 [lib.valarray.transcend] paragraph 1, state that the valarray transcendentals use unqualified lookup.Section: 25.2.2 [lib.alg.swap] Status: TC Submitter: Dave Abrahams Date: 09 Apr 2000
+Section: 25.2.2 [lib.alg.swap] Status: TC Submitter: Dave Abrahams Date: 09 Apr 2000
25.2.2 reads:
template<class T> void swap(T& a, T& b);
@@ -7029,7 +7036,7 @@ minor as not to require re-review. ]
-242. Side effects of function objects
Section: 25.2.3 [lib.alg.transform], 26.4 [lib.numeric.ops] Status: WP Submitter: Angelika Langer Date: May 15 2000
+242. Side effects of function objects
Section: 25.2.3 [lib.alg.transform], 26.4 [lib.numeric.ops] Status: WP Submitter: Angelika Langer Date: May 15 2000
The algorithms transform(), accumulate(), inner_product(), partial_sum(), and adjacent_difference() require that the function object supplied to them shall not have any side effects.
@@ -7330,7 +7337,7 @@ iterators into *this, not into x.The original proposed resolution said that iterators and references would remain "valid". The new proposed resolution clarifies what that means. Note that this only applies to the case of equal allocators. ->From 20.1.5 [lib.allocator.requirements] paragraph 4, the behavior of list when +From 20.1.5 [lib.allocator.requirements] paragraph 4, the behavior of list when allocators compare nonequal is outside the scope of the standard.
251. basic_stringbuf missing allocator_type
Section: 27.7.1 [lib.stringbuf] Status: WP Submitter: Martin Sebor Date: 28 Jul 2000
@@ -10598,7 +10605,7 @@ parameter name conveys real normative meaning.
338. is whitespace allowed between `-' and a digit?
Section: 22.2 [lib.locale.categories] Status: WP Submitter: Martin Sebor Date: 17 Sep 2001
->From Stage 2 processing in 22.2.2.1.2 [lib.facet.num.get.virtuals], p8 and 9 (the +From Stage 2 processing in 22.2.2.1.2 [lib.facet.num.get.virtuals], p8 and 9 (the original text or the text corrected by the proposed resolution of issue 221) it seems clear that no whitespace is allowed within a number, but 22.2.3.1 [lib.locale.numpunct], p2, which gives the @@ -11080,7 +11087,7 @@ key greater than k, or a.end() if such an element is not found.
[Curaçao: LWG reviewed PR.]
-355. Operational semantics for a.back()
Section: 23.1.1 [lib.sequence.reqmts] Status: WP Submitter: Yaroslav Mironov Date: 23 Jan 2002
+355. Operational semantics for a.back()
Section: 23.1.1 [lib.sequence.reqmts] Status: WP Submitter: Yaroslav Mironov Date: 23 Jan 2002
Table 68 "Optional Sequence Operations" in 23.1.1/12 specifies operational semantics for "a.back()" as @@ -11149,8 +11156,8 @@ LWG would like a new issue opened.]
"*tmp" to "return *tmp;"]
-358. interpreting thousands_sep after a decimal_point -
Section: 22.2.2.1.2 [lib.facet.num.get.virtuals] Status: WP Submitter: Martin Sebor Date: 12 Mar 2002
+358. interpreting thousands_sep after a decimal_point +
Section: 22.2.2.1.2 [lib.facet.num.get.virtuals] Status: WP Submitter: Martin Sebor Date: 12 Mar 2002
I don't think thousands_sep is being treated correctly after decimal_point has been seen. Since grouping applies only to the @@ -11432,7 +11439,7 @@ with the following signature:
Rationale:
Fixes an obvious typo.
-373. Are basic_istream and basic_ostream to use (exceptions()&badbit) != 0 ?
Section: 27.6.1.2.1 [lib.istream.formatted.reqmts], 27.6.2.5.1 [lib.ostream.formatted.reqmts] Status: WP Submitter: Keith Baker Date: 23 Jul 2002
+373. Are basic_istream and basic_ostream to use (exceptions()&badbit) != 0 ?
Section: 27.6.1.2.1 [lib.istream.formatted.reqmts], 27.6.2.5.1 [lib.ostream.formatted.reqmts] Status: WP Submitter: Keith Baker Date: 23 Jul 2002
In 27.6.1.2.1 [lib.istream.formatted.reqmts] and 27.6.2.5.1 [lib.ostream.formatted.reqmts] @@ -11449,7 +11456,7 @@ In 27.6.1.2.1
375. basic_ios should be ios_base in 27.7.1.3
Section: 27.7.1.3 [lib.stringbuf.virtuals] Status: WP Submitter: Ray Lischner Date: 14 Aug 2002
+375. basic_ios should be ios_base in 27.7.1.3
Section: 27.7.1.3 [lib.stringbuf.virtuals] Status: WP Submitter: Ray Lischner Date: 14 Aug 2002
In Section 27.7.1.3 [lib.stringbuf.virtuals]: Table 90, Table 91, and paragraph 14 all contain references to "basic_ios::" which should be @@ -11531,7 +11538,7 @@ heading Meaning, to "space for more than (to_limit - to) destination elements was needed to terminate a sequence given the value of state."
-381. detection of invalid mbstate_t in codecvt
Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals] Status: WP Submitter: Martin Sebor Date: 6 Sep 2002
+381. detection of invalid mbstate_t in codecvt
Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals] Status: WP Submitter: Martin Sebor Date: 6 Sep 2002
All but one codecvt member functions that take a state_type argument list as one of their preconditions that the state_type argument have @@ -12743,7 +12750,7 @@ longer allowable since [pbase(), epptr()) may now contain uninitialized characters. Positioning is only allowable over the initialized range.
-434. bitset::to_string() hard to use
Section: 23.3.5.2 [lib.bitset.members] Status: DR Submitter: Martin Sebor Date: 15 Oct 2003
+434. bitset::to_string() hard to use
Section: 23.3.5.2 [lib.bitset.members] Status: DR Submitter: Martin Sebor Date: 15 Oct 2003
It has been pointed out a number of times that the bitset to_string() member function template is tedious to use since callers must explicitly specify the @@ -13788,7 +13795,7 @@ imposed by Table 37 on compare() when char is signed. Post-Redmond: Martin provided wording.]
-468. unexpected consequences of ios_base::operator void*()
Section: 27.4.4.3 [lib.iostate.flags] Status: WP Submitter: Martin Sebor Date: 28 Jun 2004
+468. unexpected consequences of ios_base::operator void*()
Section: 27.4.4.3 [lib.iostate.flags] Status: WP Submitter: Martin Sebor Date: 28 Jun 2004
The program below is required to compile but when run it typically produces unexpected results due to the user-defined conversion from