From e24b3cc0aa9b5e8d9c37e21ca974fe89a7a04021 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 15 Nov 2004 09:05:27 +0000 Subject: [PATCH] lwg-active.html, [...]: Import Revision 33. 2004-11-15 Paolo Carlini * docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 33. From-SVN: r90655 --- libstdc++-v3/ChangeLog | 4 + libstdc++-v3/docs/html/ext/lwg-active.html | 2529 ++++++++--------- libstdc++-v3/docs/html/ext/lwg-defects.html | 2827 +++++++++++-------- 3 files changed, 2835 insertions(+), 2525 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fd553a136d0..557d26043a1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2004-11-15 Paolo Carlini + + * docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 33. + 2004-11-14 Paolo Carlini * include/bits/streambuf_iterator.h (istreambuf_iterator::_M_get): diff --git a/libstdc++-v3/docs/html/ext/lwg-active.html b/libstdc++-v3/docs/html/ext/lwg-active.html index 148e32f9baf..4bc5b896563 100644 --- a/libstdc++-v3/docs/html/ext/lwg-active.html +++ b/libstdc++-v3/docs/html/ext/lwg-active.html @@ -1,15 +1,15 @@ - -C++ Standard Library Active Issues List +C++ Standard Library Active Issues List + - + - + - + @@ -19,32 +19,32 @@ -
Doc. no.N1657=04-0097N1708=04-0148
Date:16 Jul 20045 Nov 2004
Project:Reply to: Matt Austern <austern@apple.com>
-

C++ Standard Library Active Issues List (Revision 31)

+ +

C++ Standard Library Active Issues List (Revision 33)

Reference ISO/IEC IS 14882:1998(E)

Also see:

The purpose of this document is to record the status of issues which have come before the Library Working Group (LWG) of the ANSI (J16) and ISO (WG21) C++ Standards Committee. Issues represent potential defects in the ISO/IEC IS 14882:1998(E) document. Issues - are not to be used to request new features or other extensions.

+ are not to be used to request new features.

This document contains only library issues which are actively being considered by the Library Working Group. That is, issues which have a - status of New, Open, - Ready, and Review. See - Library Defect Reports List for issues considered defects and - Library Closed Issues List for issues considered closed.

+ status of New, Open, + Ready, and Review. See + Library Defect Reports List for issues considered defects and + Library Closed Issues List for issues considered closed.

The issues in these lists are not necessarily formal ISO Defect Reports (DR's). While some issues will eventually be elevated to @@ -69,7 +69,7 @@ presented in subsequent discussions.

For the most current official version of this document see - http://www.dkuug.dk/jtc1/sc22/wg21. + http://www.open-std.org/jtc1/sc22/wg21/. Requests for further information about this document should include the document number above, reference ISO/IEC 14882:1998(E), and be submitted to Information Technology Industry Council (ITI), 1250 Eye @@ -78,7 +78,7 @@

Public information as to how to obtain a copy of the C++ Standard, join the standards committee, submit an issue, or comment on an issue can be found in the comp.std.c++ FAQ. - Public discussion of C++ Standard related issues occurs on news:comp.std.c++. + Public discussion of C++ Standard related issues occurs on news:comp.std.c++.

For committee members, files available on the committee's private @@ -88,25 +88,33 @@ directory as the issues list files.

Revision History

    +
  • R33: +2004-11 post-Redmond mailing. Reflections actions taken in Redmond. +
  • +
  • R32: +2004-09 pre-Redmond mailing: reflects new proposed resolutions and +new issues received after the 2004-07 mailing. Added +new issues 479-481. +
  • R31: 2004-07 mid-term mailing: reflects new proposed resolutions and new issues received after the post-Sydney mailing. Added -new issues 463-478. +new issues 463-478.
  • R30: Post-Sydney mailing: reflects decisions made at the Sydney meeting. Voted all "Ready" issues from R29 into the working paper. -Added new issues 460-462. +Added new issues 460-462.
  • R29: -Pre-Sydney mailing. Added new issues 441-457. +Pre-Sydney mailing. Added new issues 441-457.
  • R28: Post-Kona mailing: reflects decisions made at the Kona meeting. -Added new issues 432-440. +Added new issues 432-440.
  • R27: -Pre-Kona mailing. Added new issues 404-431. +Pre-Kona mailing. Added new issues 404-431.
  • R26: Post-Oxford mailing: reflects decisions made at the Oxford meeting. @@ -114,139 +122,139 @@ All issues in Ready status were voted into DR status. All issues in DR status were voted into WP status.
  • R25: -Pre-Oxford mailing. Added new issues 390-402. +Pre-Oxford mailing. Added new issues 390-402.
  • R24: Post-Santa Cruz mailing: reflects decisions made at the Santa Cruz -meeting. All Ready issues from R23 with the exception of 253, which has been given a new proposed resolution, were -moved to DR status. Added new issues 383-389. (Issues 387-389 were discussed -at the meeting.) Made progress on issues 225, 226, 229: 225 and 229 have been moved to Ready status, and the only remaining -concerns with 226 involve wording. +meeting. All Ready issues from R23 with the exception of 253, which has been given a new proposed resolution, were +moved to DR status. Added new issues 383-389. (Issues 387-389 were discussed +at the meeting.) Made progress on issues 225, 226, 229: 225 and 229 have been moved to Ready status, and the only remaining +concerns with 226 involve wording.
  • R23: -Pre-Santa Cruz mailing. Added new issues 367-382. +Pre-Santa Cruz mailing. Added new issues 367-382. Moved issues in the TC to TC status.
  • R22: -Post-Curaçao mailing. Added new issues 362-366. +Post-Curaçao mailing. Added new issues 362-366.
  • R21: -Pre-Curaçao mailing. Added new issues 351-361. +Pre-Curaçao mailing. Added new issues 351-361.
  • R20: Post-Redmond mailing; reflects actions taken in Redmond. Added -new issues 336-350, of which issues -347-350 were added since Redmond, hence +new issues 336-350, of which issues +347-350 were added since Redmond, hence not discussed at the meeting. All Ready issues were moved to DR status, with the exception of issues -284, 241, and 267. +284, 241, and 267. Noteworthy issues discussed at Redmond include -120 202, 226, 233, -270, 253, 254, 323. +120 202, 226, 233, +270, 253, 254, 323.
  • R19: Pre-Redmond mailing. Added new issues -323-335. +323-335.
  • R18: Post-Copenhagen mailing; reflects actions taken in Copenhagen. -Added new issues 312-317, and discussed -new issues 271-314. +Added new issues 312-317, and discussed +new issues 271-314. Changed status of issues -103 118 136 153 -165 171 183 184 -185 186 214 221 -234 237 243 248 -251 252 256 260 -261 262 263 265 -268 +103 118 136 153 +165 171 183 184 +185 186 214 221 +234 237 243 248 +251 252 256 260 +261 262 263 265 +268 to DR. Changed status of issues -49 109 117 182 -228 230 232 235 -238 241 242 250 -259 264 266 267 -271 272 273 275 -281 284 285 286 -288 292 295 297 -298 301 303 306 -307 308 312 +49 109 117 182 +228 230 232 235 +238 241 242 250 +259 264 266 267 +271 272 273 275 +281 284 285 286 +288 292 295 297 +298 301 303 306 +307 308 312 to Ready. Closed issues -111 277 279 287 -289 293 302 313 -314 +111 277 279 287 +289 293 302 313 +314 as NAD.
  • R17: Pre-Copenhagen mailing. Converted issues list to XML. Added proposed -resolutions for issues 49, 76, 91, 235, 250, 267. -Added new issues 278-311. +resolutions for issues 49, 76, 91, 235, 250, 267. +Added new issues 278-311.
  • R16: post-Toronto mailing; reflects actions taken in Toronto. Added new -issues 265-277. Changed status of issues -3, 8, 9, 19, -26, 31, 61, -63, 86, 108, -112, 114, 115, -122, 127, 129, -134, 137, 142, -144, 146, 147, -159, 164, 170, -181, 199, 208, -209, 210, 211, -212, 217, 220, -222, 223, 224, -227 to "DR". Reopened issue 23. Reopened -issue 187. Changed issues 2 and -4 to NAD. Fixed a typo in issue 17. Fixed -issue 70: signature should be changed both places it -appears. Fixed issue 160: previous version didn't fix +issues 265-277. Changed status of issues +3, 8, 9, 19, +26, 31, 61, +63, 86, 108, +112, 114, 115, +122, 127, 129, +134, 137, 142, +144, 146, 147, +159, 164, 170, +181, 199, 208, +209, 210, 211, +212, 217, 220, +222, 223, 224, +227 to "DR". Reopened issue 23. Reopened +issue 187. Changed issues 2 and +4 to NAD. Fixed a typo in issue 17. Fixed +issue 70: signature should be changed both places it +appears. Fixed issue 160: previous version didn't fix the bug in enough places.
  • R15: pre-Toronto mailing. Added issues -233-264. Some small HTML formatting +233-264. Some small HTML formatting changes so that we pass Weblint tests.
  • R14: post-Tokyo II mailing; reflects committee actions taken in -Tokyo. Added issues 228 to 232. (00-0019R1/N1242) +Tokyo. Added issues 228 to 232. (00-0019R1/N1242)
  • R13: -pre-Tokyo II updated: Added issues 212 to 227. +pre-Tokyo II updated: Added issues 212 to 227.
  • R12: -pre-Tokyo II mailing: Added issues 199 to -211. Added "and paragraph 5" to the proposed resolution -of issue 29. Add further rationale to issue -178. +pre-Tokyo II mailing: Added issues 199 to +211. Added "and paragraph 5" to the proposed resolution +of issue 29. Add further rationale to issue +178.
  • R11: post-Kona mailing: Updated to reflect LWG and full committee actions in Kona (99-0048/N1224). Note changed resolution of issues -4 and 38. Added issues 196 -to 198. Closed issues list split into "defects" and +4 and 38. Added issues 196 +to 198. Closed issues list split into "defects" and "closed" documents. Changed the proposed resolution of issue -4 to NAD, and changed the wording of proposed resolution -of issue 38. +4 to NAD, and changed the wording of proposed resolution +of issue 38.
  • R10: -pre-Kona updated. Added proposed resolutions 83, -86, 91, 92, -109. Added issues 190 to -195. (99-0033/D1209, 14 Oct 99) +pre-Kona updated. Added proposed resolutions 83, +86, 91, 92, +109. Added issues 190 to +195. (99-0033/D1209, 14 Oct 99)
  • R9: -pre-Kona mailing. Added issues 140 to -189. Issues list split into separate "active" and +pre-Kona mailing. Added issues 140 to +189. Issues list split into separate "active" and "closed" documents. (99-0030/N1206, 25 Aug 99)
  • R8: @@ -254,36 +262,36 @@ post-Dublin mailing. Updated to reflect LWG and full committee actions in Dublin. (99-0016/N1193, 21 Apr 99)
  • R7: -pre-Dublin updated: Added issues 130, 131, -132, 133, 134, -135, 136, 137, -138, 139 (31 Mar 99) +pre-Dublin updated: Added issues 130, 131, +132, 133, 134, +135, 136, 137, +138, 139 (31 Mar 99)
  • R6: -pre-Dublin mailing. Added issues 127, 128, -and 129. (99-0007/N1194, 22 Feb 99) +pre-Dublin mailing. Added issues 127, 128, +and 129. (99-0007/N1194, 22 Feb 99)
  • R5: -update issues 103, 112; added issues -114 to 126. Format revisions to prepare +update issues 103, 112; added issues +114 to 126. Format revisions to prepare for making list public. (30 Dec 98)
  • R4: -post-Santa Cruz II updated: Issues 110, -111, 112, 113 added, several +post-Santa Cruz II updated: Issues 110, +111, 112, 113 added, several issues corrected. (22 Oct 98)
  • R3: -post-Santa Cruz II: Issues 94 to 109 +post-Santa Cruz II: Issues 94 to 109 added, many issues updated to reflect LWG consensus (12 Oct 98)
  • R2: -pre-Santa Cruz II: Issues 73 to 93 added, -issue 17 updated. (29 Sep 98) +pre-Santa Cruz II: Issues 73 to 93 added, +issue 17 updated. (29 Sep 98)
  • R1: -Correction to issue 55 resolution, 60 code -format, 64 title. (17 Sep 98) +Correction to issue 55 resolution, 60 code +format, 64 title. (17 Sep 98)

@@ -358,24 +366,24 @@ format, 64 title. (17 Sep 98) status, the LWG believes that this issue should be revisited at the next revision of the standard. It is usually paired with NAD.

-

Issues are always given the status of New when +

Issues are always given the status of New when they first appear on the issues list. They may progress to - Open or Review while the LWG + Open or Review while the LWG is actively working on them. When the LWG has reached consensus on the disposition of an issue, the status will then change to - Dup, NAD, or Ready as appropriate. Once the full J16 committee votes to + Dup, NAD, or Ready as appropriate. Once the full J16 committee votes to forward Ready issues to the Project Editor, they are given the - status of Defect Report ( DR). These in turn may - become the basis for Technical Corrigenda (TC), + status of Defect Report ( DR). These in turn may + become the basis for Technical Corrigenda (TC), or are closed without action other than a Record of Response - (RR ). The intent of this LWG process is that + (RR ). The intent of this LWG process is that only issues which are truly defects in the Standard move to the formal ISO DR status.

Active Issues


-

23. Num_get overflow result

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: Open  Submitter: Nathan Myers  Date: 6 Aug 1998

+

23. Num_get overflow result

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: Open  Submitter: Nathan Myers  Date: 6 Aug 1998

The current description of numeric input does not account for the possibility of overflow. This is an implicit result of changing the description to rely on the definition of scanf() (which fails to @@ -400,7 +408,7 @@ and hard to trace, so I will describe it briefly:

  • - According to 22.2.2.1.2 [lib.facet.num.get.virtuals] + According to 22.2.2.1.2 [lib.facet.num.get.virtuals] paragraph 11 failbit is set if scanf() would return an input error; otherwise a value is converted to the rules of scanf. @@ -494,10 +502,10 @@ upon overflow. We considered three options based on this:

    it.

    Proposed resolution:

    -

    typo: 22.2.2.2.2 [lib.facet.num.put.virtuals], para 2, bullet 3. Strike "in." from +

    typo: 22.2.2.2.2 [lib.facet.num.put.virtuals], para 2, bullet 3. Strike "in." from the end.

    -

    Change 22.2.2.2 [lib.locale.nm.put], para 11, bullet 2 from:

    +

    Change 22.2.2.2 [lib.locale.nm.put], para 11, bullet 2 from:

    The sequence of chars accumulated in stage 2 would have caused scanf to report an input failure. ios_base::failbit is @@ -527,7 +535,7 @@ what kind of error happened. Martin will provide wording, Howard may help.]


    -

    96. Vector<bool> is not a container

    Section: 23.2.5 [lib.vector.bool]  Status: Open  Submitter: AFNOR  Date: 7 Oct 1998

    +

    96. Vector<bool> is not a container

    Section: 23.2.5 [lib.vector.bool]  Status: Open  Submitter: AFNOR  Date: 7 Oct 1998

    vector<bool> is not a container as its reference and pointer types are not references and pointers.

    @@ -585,8 +593,16 @@ problem, and 2) providing compiler vendors, authors, teachers, and of course users with specific suggestions as to how to apply the eventual solution.]

    +

    [Redmond: briefly discussed, since there are options for C++0x + that weren't reasonable for TC1. Two options were discussed. (1) + deprecate std::vector<bool> and introduce std::bit_vector. Then + gradually, over a period of years, we could reintroduce + std::vector<bool> but this time as an ordinary vector. (2) Change + iterarator and container requirements so that vector<bool> will + be a fully conforming container. These options are not mutually + exclusive.]


    -

    130. Return type of container::erase(iterator) differs for associative containers

    Section: 23.1.2 [lib.associative.reqmts], 23.1.1 [lib.sequence.reqmts]  Status: Review  Submitter: Andrew Koenig  Date: 2 Mar 1999

    +

    130. Return type of container::erase(iterator) differs for associative containers

    Section: 23.1.2 [lib.associative.reqmts], 23.1.1 [lib.sequence.reqmts]  Status: Ready  Submitter: Andrew Koenig  Date: 2 Mar 1999

    Table 67 (23.1.1) says that container::erase(iterator) returns an iterator. Table 69 (23.1.2) says that in addition to this requirement, associative containers also say that container::erase(iterator) @@ -596,7 +612,7 @@ fail to meet the requirements for containers.

    Proposed resolution:

    -In 23.1.2 [lib.associative.reqmts], in Table 69 Associative container +In 23.1.2 [lib.associative.reqmts], in Table 69 Associative container requirements, change the return type of a.erase(q) from void to iterator. Change the assertion/not/pre/post-condition from "erases the element pointed to @@ -607,27 +623,28 @@ is returned."

    -In 23.1.2 [lib.associative.reqmts], in Table 69 Associative container +In 23.1.2 [lib.associative.reqmts], in Table 69 Associative container requirements, change the return type of a.erase(q1, q2) from void to iterator. Change the assertion/not/pre/post-condition from "erases the elements in the range [q1, q2)" to "erases the elements in the range [q1, -q2). Returns an iterator pointing to the element immediately -following q2 prior to any elements being erased. If no such element -exists, a.end() is returned." +q2). Returns q2."

    -In 23.3.1 [lib.map], in the map class synopsis; and -in 23.3.2 [lib.multimap], in the multimap class synopsis; and -in 23.3.3 [lib.set], in the set class synopsis; and -in 23.3.4 [lib.multiset], in the multiset class synopsis: +In 23.3.1 [lib.map], in the map class synopsis; and +in 23.3.2 [lib.multimap], in the multimap class synopsis; and +in 23.3.3 [lib.set], in the set class synopsis; and +in 23.3.4 [lib.multiset], in the multiset class synopsis: change the signature of the first erase overload to

    -
    -   iterator erase(iterator position);
    +
       iterator erase(iterator position);
    +
    +

    and change the signature of the third erase overload to

    +
      iterator erase(iterator first, iterator last); 
     
    +

    [Pre-Kona: reopened at the request of Howard Hinnant]

    [Post-Kona: the LWG agrees the return type should be @@ -644,7 +661,7 @@ Matt provided wording.]

    ]


    -

    197. max_size() underspecified

    Section: 20.1.5 [lib.allocator.requirements], 23.1 [lib.container.requirements]  Status: Open  Submitter: Andy Sawyer  Date: 21 Oct 1999

    +

    197. max_size() underspecified

    Section: 20.1.5 [lib.allocator.requirements], 23.1 [lib.container.requirements]  Status: Open  Submitter: Andy Sawyer  Date: 21 Oct 1999

    Must the value returned by max_size() be unchanged from call to call?

    Must the value returned from max_size() be meaningful?

    @@ -676,21 +693,21 @@ into account the actual currently available resources). This, obviously, has to be determined dynamically each time max_size() is called.

    Proposed resolution:

    -

    Change 20.1.5 [lib.allocator.requirements] table 32 max_size() wording from:
    +

    Change 20.1.5 [lib.allocator.requirements] table 32 max_size() wording from:

          the largest value that can meaningfully be passed to X::allocate
    to:
          the value of the largest constant expression -(5.19 [expr.const]) that could ever meaningfully be passed to X::allocate

    +(5.19 [expr.const]) that could ever meaningfully be passed to X::allocate

    -Change 23.1 [lib.container.requirements] table 65 max_size() wording from:
    +Change 23.1 [lib.container.requirements] table 65 max_size() wording from:

          size() of the largest possible container.
    to:
          the value of the largest constant expression -(5.19 [expr.const]) that could ever meaningfully be returned by X::size(). +(5.19 [expr.const]) that could ever meaningfully be returned by X::size().

    [Kona: The LWG informally discussed this and asked Andy Sawyer to submit @@ -699,7 +716,7 @@ an issue.]

    [Tokyo: The LWG believes (1) above is the intended meaning.]

    [Post-Tokyo: Beman Dawes supplied the above resolution at the -request of the LWG. 21.3.3 [lib.string.capacity] was not changed because it +request of the LWG. 21.3.3 [lib.string.capacity] was not changed because it references max_size() in 23.1. The term "compile-time" was avoided because it is not defined anywhere in the standard (even though it is used several places in the library clauses).]

    @@ -710,7 +727,7 @@ function than as an allocator member function. For the latter, it is probably best thought of as an architectural limit. Nathan will provide new wording.]


    -

    201. Numeric limits terminology wrong

    Section: 18.2.1 [lib.limits]  Status: Open  Submitter: Stephen Cleary  Date: 21 Dec 1999

    +

    201. Numeric limits terminology wrong

    Section: 18.2.1 [lib.limits]  Status: Open  Submitter: Stephen Cleary  Date: 21 Dec 1999

    In some places in this section, the terms "fundamental types" and "scalar types" are used when the term "arithmetic types" is intended. @@ -722,26 +739,34 @@ specializations of numeric_limits.

    Change 18.2 [lib.support.limits] para 1 from:

    -

    The headers <limits>, <climits>, and <cfloat> supply characteristics of implementation-dependent fundamental types (3.9.1).

    +

    The headers <limits>, <climits>, and <cfloat> +supply characteristics of implementation-dependent fundamental types +(3.9.1).

    to:

    -

    The headers <limits>, <climits>, and <cfloat> supply characteristics of implementation-dependent arithmetic types (3.9.1).

    +

    The headers <limits>, <climits>, and <cfloat> +supply characteristics of implementation-dependent arithmetic types +(3.9.1).

    Change 18.2.1 [lib.limits] para 1 from:

    -

    The numeric_limits component provides a C++ program with information about various properties of the implementation's representation of the fundamental +

    The numeric_limits component provides a C++ program with +information about various properties of the implementation's +representation of the fundamental types.

    to:

    -

    The numeric_limits component provides a C++ program with information about various properties of the implementation's representation of the arithmetic +

    The numeric_limits component provides a C++ program with +information about various properties of the implementation's +representation of the arithmetic types.

    @@ -772,14 +797,17 @@ types.

    Change 18.2.1.1 [lib.numeric.limits] para 1 from:

    -

    The member is_specialized makes it possible to distinguish between fundamental types, which have specializations, and non-scalar types, which +

    The member is_specialized makes it possible to distinguish between +fundamental types, which have specializations, and non-scalar types, +which do not.

    to:

    -

    The member is_specialized makes it possible to distinguish between arithmetic types, which have specializations, and non-arithmetic types, +

    The member is_specialized makes it possible to distinguish between +arithmetic types, which have specializations, and non-arithmetic types, which do not.

    @@ -794,7 +822,7 @@ types and for user-defined types, and the standard doesn't make it clear how numeric_limits applies to each of those cases. A wholesale review of numeric_limits is needed. A paper would be welcome.]


    -

    233. Insertion hints in associative containers

    Section: 23.1.2 [lib.associative.reqmts]  Status: Open  Submitter: Andrew Koenig  Date: 30 Apr 2000

    +

    233. Insertion hints in associative containers

    Section: 23.1.2 [lib.associative.reqmts]  Status: Open  Submitter: Andrew Koenig  Date: 30 Apr 2000

    If mm is a multimap and p is an iterator into the multimap, then mm.insert(p, x) inserts @@ -829,7 +857,7 @@ proposed "before or after, if possible, otherwise [...]".

    Proposed resolution:

    -

    In table 69 "Associative Container Requirements" in 23.1.2 [lib.associative.reqmts], in the row for a.insert(p, t), +

    In table 69 "Associative Container Requirements" in 23.1.2 [lib.associative.reqmts], in the row for a.insert(p, t), change

    @@ -886,11 +914,11 @@ you can do it efficiently enough with a red-black tree, but there are other (perhaps better) balanced tree techniques that might differ enough to make the detailed semantics hard to satisfy."]

    -

    [Curaçao: Nathan should give us the alternative wording he +

    [Curaçao: Nathan should give us the alternative wording he suggests so the LWG can decide between the two options.]


    -

    247. vector, deque::insert complexity

    Section: 23.2.4.3 [lib.vector.modifiers]  Status: Open  Submitter: Lisa Lippincott  Date: 06 June 2000

    +

    247. vector, deque::insert complexity

    Section: 23.2.4.3 [lib.vector.modifiers]  Status: Open  Submitter: Lisa Lippincott  Date: 06 June 2000

    Paragraph 2 of 23.2.4.3 [lib.vector.modifiers] describes the complexity of vector::insert:

    @@ -923,7 +951,7 @@ inserting at the end of the vector, and then using

    I looked to see if deque had a similar problem, and was surprised to find that deque places no requirement on the -complexity of inserting multiple elements (23.2.1.3 [lib.deque.modifiers], +complexity of inserting multiple elements (23.2.1.3 [lib.deque.modifiers], paragraph 3):

    @@ -960,15 +988,14 @@ complicated than a while loop whose body is a single-element insert.]


    254. Exception types in clause 19 are constructed from std::string -

    Section: 19.1 [lib.std.exceptions]  Status: Open  Submitter: Dave Abrahams  Date: 01 Aug 2000

    +

    Section: 19.1 [lib.std.exceptions]  Status: Open  Submitter: Dave Abrahams  Date: 01 Aug 2000

    Many of the standard exception types which implementations are required to throw are constructed with a const std::string& parameter. For example:

    -
    -     19.1.5  Class out_of_range                          [lib.out.of.range]
    +
         19.1.5  Class out_of_range                          [lib.out.of.range]
          namespace std {
            class out_of_range : public logic_error {
            public:
    @@ -1050,7 +1077,7 @@ copy constructor is potentially invoked during stack unwinding.

    The copy constructor is a more serious problem, becuase failure during stack unwinding invokes terminate. The copy -constructor must be nothrow. Curaçao: Howard thinks this +constructor must be nothrow. Curaçao: Howard thinks this requirement is already present.

    The fundamental problem is that it's difficult to get the nothrow @@ -1061,8 +1088,8 @@ include:

    • Limit the size of a string that exception objects are required to -throw: change the postconditions of 19.1.2 [lib.domain.error] paragraph 3 -and 19.1.6 [lib.runtime.error] paragraph 3 to something like this: +throw: change the postconditions of 19.1.2 [lib.domain.error] paragraph 3 +and 19.1.6 [lib.runtime.error] paragraph 3 to something like this: "strncmp(what(), what_arg._str(), N) == 0, where N is an implementation defined constant no smaller than 256".
    • Allow the const string& constructor to throw, but not the @@ -1102,9 +1129,9 @@ intended here is that the copy constructors can't fail.

      [Pre-Sydney: reopened at the request of Howard Hinnant.]


      -

      258. Missing allocator requirement

      Section: 20.1.5 [lib.allocator.requirements]  Status: Open  Submitter: Matt Austern  Date: 22 Aug 2000

      +

      258. Missing allocator requirement

      Section: 20.1.5 [lib.allocator.requirements]  Status: Open  Submitter: Matt Austern  Date: 22 Aug 2000

      -From lib-7752: +>From lib-7752:

      @@ -1171,10 +1198,10 @@ the second line from the bottom in table 32 already implies the desired property. This issue should be considered in light of other issues related to allocator instances.]


      -

      280. Comparison of reverse_iterator to const reverse_iterator

      Section: 24.4.1 [lib.reverse.iterators]  Status: Open  Submitter: Steve Cleary  Date: 27 Nov 2000

      +

      280. Comparison of reverse_iterator to const reverse_iterator

      Section: 24.4.1 [lib.reverse.iterators]  Status: Open  Submitter: Steve Cleary  Date: 27 Nov 2000

      This came from an email from Steve Cleary to Fergus in reference to -issue 179. The library working group briefly discussed +issue 179. The library working group briefly discussed this in Toronto and believed it should be a separate issue. There was also some reservations about whether this was a worthwhile problem to fix. @@ -1195,10 +1222,9 @@ that, I don't see how any user code could break."

      Proposed resolution:

      -Section: 24.4.1.1 [lib.reverse.iterator] +Section: 24.4.1.1 [lib.reverse.iterator] add/change the following declarations:

      -
      -  A) Add a templated assignment operator, after the same manner
      +
        A) Add a templated assignment operator, after the same manner
               as the templated copy constructor, i.e.:
       
         template < class U >
      @@ -1222,7 +1248,7 @@ add/change the following declarations:

      Also make the addition/changes for these signatures in -24.4.1.3 [lib.reverse.iter.ops]. +24.4.1.3 [lib.reverse.iter.ops].

      [ @@ -1234,7 +1260,7 @@ desirable to provide this feature in a different way. ]


      -

      290. Requirements to for_each and its function object

      Section: 25.1.1 [lib.alg.foreach]  Status: Open  Submitter: Angelika Langer  Date: 03 Jan 2001

      +

      290. Requirements to for_each and its function object

      Section: 25.1.1 [lib.alg.foreach]  Status: Open  Submitter: Angelika Langer  Date: 03 Jan 2001

      The specification of the for_each algorithm does not have a "Requires" section, which means that there are no restrictions imposed on the function object whatsoever. In essence it @@ -1262,7 +1288,7 @@ algorithm does not say so.

      Proposed resolution:

      Add a "Requires" section to section 25.1.1 similar to those proposed for transform and the numeric algorithms (see issue -242): +242):

      @@ -1278,14 +1304,13 @@ blanket statement in Clause 25, not just a special requirement for ]


      -

      294. User defined macros and standard headers

      Section: 17.4.3.1.1 [lib.macro.names]  Status: Open  Submitter: James Kanze  Date: 11 Jan 2001

      -

      Paragraph 2 of 17.4.3.1.1 [lib.macro.names] reads: "A +

      294. User defined macros and standard headers

      Section: 17.4.3.1.1 [lib.macro.names]  Status: Open  Submitter: James Kanze  Date: 11 Jan 2001

      +

      Paragraph 2 of 17.4.3.1.1 [lib.macro.names] reads: "A translation unit that includes a header shall not contain any macros that define names declared in that header." As I read this, it would mean that the following program is legal:

      -
      -  #define npos 3.14
      +
        #define npos 3.14
         #include <sstream>
       
      @@ -1296,30 +1321,30 @@ which <sstream> didn't include <string>.

      I think that this phrase was probably formulated before it was decided that a standard header may freely include other standard headers. The phrase would be perfectly appropriate for C, for -example. In light of 17.4.4.1 [lib.res.on.headers] paragraph 1, however, +example. In light of 17.4.4.1 [lib.res.on.headers] paragraph 1, however, it isn't stringent enough.

      Proposed resolution:

      -

      In paragraph 2 of 17.4.3.1.1 [lib.macro.names], change "A +

      In paragraph 2 of 17.4.3.1.1 [lib.macro.names], change "A translation unit that includes a header shall not contain any macros that define names declared in that header." to "A translation unit that includes a header shall not contain any macros that define names declared in any standard header."

      [Copenhagen: the general idea is clearly correct, but there is -concern about making sure that the two paragraphs in 17.4.3.1.1 [lib.macro.names] remain consistent. Nathan will provide new +concern about making sure that the two paragraphs in 17.4.3.1.1 [lib.macro.names] remain consistent. Nathan will provide new wording.]


      -

      299. Incorrect return types for iterator dereference

      Section: 24.1.4 [lib.bidirectional.iterators], 24.1.5 [lib.random.access.iterators]  Status: Open  Submitter: John Potter  Date: 22 Jan 2001

      +

      299. Incorrect return types for iterator dereference

      Section: 24.1.4 [lib.bidirectional.iterators], 24.1.5 [lib.random.access.iterators]  Status: Open  Submitter: John Potter  Date: 22 Jan 2001

      -In section 24.1.4 [lib.bidirectional.iterators], +In section 24.1.4 [lib.bidirectional.iterators], Table 75 gives the return type of *r-- as convertible to T. This is not consistent with Table 74 which gives the return type of *r++ as T&. *r++ = t is valid while *r-- = t is invalid.

      -In section 24.1.5 [lib.random.access.iterators], +In section 24.1.5 [lib.random.access.iterators], Table 76 gives the return type of a[n] as convertible to T. This is not consistent with the semantics of *(a + n) which returns T& by Table 74. *(a + n) = t is valid while a[n] = t is invalid. @@ -1410,11 +1435,11 @@ with a return type of convertible to T and operational semantics of


      -

      309. Does sentry catch exceptions?

      Section: 27.6 [lib.iostream.format]  Status: Open  Submitter: Martin Sebor  Date: 19 Mar 2001

      +

      309. Does sentry catch exceptions?

      Section: 27.6 [lib.iostream.format]  Status: Open  Submitter: Martin Sebor  Date: 19 Mar 2001

      The descriptions of the constructors of basic_istream<>::sentry -(27.6.1.1.2 [lib.istream::sentry]) and basic_ostream<>::sentry -(27.6.2.3 [lib.ostream::sentry]) do not explain what the functions do in +(27.6.1.1.2 [lib.istream::sentry]) and basic_ostream<>::sentry +(27.6.2.3 [lib.ostream::sentry]) do not explain what the functions do in case an exception is thrown while they execute. Some current implementations allow all exceptions to propagate, others catch them and set ios_base::badbit instead, still others catch some but let @@ -1425,16 +1450,16 @@ others propagate. The text also mentions that the functions may call setstate(failbit) (without actually saying on what object, but presumably the stream argument is meant). That may have been fine for -basic_istream<>::sentry prior to issue 195, since +basic_istream<>::sentry prior to issue 195, since the function performs an input operation which may fail. However, -issue 195 amends 27.6.1.1.2 [lib.istream::sentry], p2 to +issue 195 amends 27.6.1.1.2 [lib.istream::sentry], p2 to clarify that the function should actually call setstate(failbit | eofbit), so the sentence in p3 is redundant or even somewhat contradictory.

      -The same sentence that appears in 27.6.2.3 [lib.ostream::sentry], p3 +The same sentence that appears in 27.6.2.3 [lib.ostream::sentry], p3 doesn't seem to be very meaningful for basic_istream<>::sentry which performs no input. It is actually rather misleading since it would appear to guide library implementers to calling @@ -1526,8 +1551,7 @@ badbit is also set in exceptions().

      [1] Extractor that catches exceptions thrown from sentry:

      -
      -struct S { long i; };
      +
      struct S { long i; };
       
       istream& operator>> (istream &strm, S &s)
       {
      @@ -1563,8 +1587,7 @@ istream& operator>> (istream &strm, S &s)
       

      [2] Extractor that propagates exceptions thrown from sentry:

      -
      -istream& operator>> (istream &strm, S &s)
      +
      istream& operator>> (istream &strm, S &s)
       {
           istream::sentry guard (strm, false);
           if (guard) {
      @@ -1602,8 +1625,7 @@ result of a call to strm.clear().
       

      -
      -istream& operator>> (istream &strm, S &s)
      +
      istream& operator>> (istream &strm, S &s)
       {
           const ios::iostate state = strm.rdstate ();
           const ios::iostate except = strm.exceptions ();
      @@ -1642,9 +1664,9 @@ istream& operator>> (istream &strm, S &s)
       
       
       

      Proposed resolution:

      -

      Remove the last sentence of 27.6.1.1.2 [lib.istream::sentry] p5 (but not +

      Remove the last sentence of 27.6.1.1.2 [lib.istream::sentry] p5 (but not the footnote, which should be moved to the preceding sentence).

      -

      Remove the last sentence of 27.6.2.3 [lib.ostream::sentry] p3 (but not +

      Remove the last sentence of 27.6.2.3 [lib.ostream::sentry] p3 (but not the footnote, which should be moved to the preceding sentence).

      Rationale:

      The LWG feels that no clarification of EH policy is necessary: the @@ -1652,11 +1674,11 @@ istream& operator>> (istream &strm, S &s) performs, and about which of those operations can throw. However, the sentence at the end should be removed because it's redundant.


      -

      342. seek and eofbit

      Section: 27.6.1.3 [lib.istream.unformatted]  Status: Open  Submitter: Howard Hinnant  Date: 09 Oct 201

      +

      342. seek and eofbit

      Section: 27.6.1.3 [lib.istream.unformatted]  Status: Open  Submitter: Howard Hinnant  Date: 09 Oct 201

      I think we have a defect.

      -

      According to lwg issue 60 which is now a dr, the -description of seekg in 27.6.1.3 [lib.istream.unformatted] paragraph 38 now looks +

      According to lwg issue 60 which is now a dr, the +description of seekg in 27.6.1.3 [lib.istream.unformatted] paragraph 38 now looks like:

      @@ -1664,10 +1686,10 @@ Behaves as an unformatted input function (as described in 27.6.1.3, paragraph 1), except that it does not count the number of characters extracted and does not affect the value returned by subsequent calls to gcount(). After constructing a sentry object, if fail() != true, -executes rdbuf()­>pubseekpos( pos). +executes rdbuf()­>pubseekpos( pos).
      -

      And according to lwg issue 243 which is also now a dr, +

      And according to lwg issue 243 which is also now a dr, 27.6.1.3, paragraph 1 looks like:

      @@ -1732,12 +1754,11 @@ examined by the user to determine why something failed.

      and propose a resolution.]


      -

      356. Meaning of ctype_base::mask enumerators

      Section: 22.2.1 [lib.category.ctype]  Status: Open  Submitter: Matt Austern  Date: 23 Jan 2002

      +

      356. Meaning of ctype_base::mask enumerators

      Section: 22.2.1 [lib.category.ctype]  Status: Open  Submitter: Matt Austern  Date: 23 Jan 2002

      What should the following program print?

      -
      -  #include <locale>
      +
        #include <locale>
         #include <iostream>
       
         class my_ctype : public std::ctype<char>
      @@ -1777,7 +1798,7 @@ The above program assumes that ctype_base::mask enumerators like
       space and print are disjoint, and that the way to
       say that a character is both a space and a printing character is to or
       those two enumerators together.  This is suggested by the "exposition
      -only" values in 22.2.1  [lib.category.ctype], but it is nowhere specified in
      +only" values in 22.2.1  [lib.category.ctype], but it is nowhere specified in
       normative text.  An alternative interpretation is that the more
       specific categories subsume the less specific.  The above program
       gives the results it does on the Microsoft compiler because, on that
      @@ -1802,8 +1823,8 @@ lib-9224, lib-9226, lib-9229, lib-9270, lib-9272, lib-9273, lib-9274,
       lib-9277, lib-9279.
       

      -

      Issue 339 is related, but not identical. The -proposed resolution if issue 339 says that +

      Issue 339 is related, but not identical. The +proposed resolution if issue 339 says that ctype_base::mask must be a bitmask type. It does not say that the ctype_base::mask elements are bitmask elements, so it doesn't directly affect this issue.

      @@ -1813,8 +1834,7 @@ that C99 compatibility essentially requires what we're calling option 1 below.

      -
      -I think the C99 standard is clear, that isspace -> !isalpha.
      +
      I think the C99 standard is clear, that isspace -> !isalpha.
       --------
       
       #include <locale>
      @@ -1876,16 +1896,15 @@ option 1 is required for C99 compatibility.
       ]


      -

      362. bind1st/bind2nd type safety

      Section: 20.3.6.2 [lib.bind.1st]  Status: Open  Submitter: Andrew Demkin  Date: 26 Apr 2002

      +

      362. bind1st/bind2nd type safety

      Section: 20.3.6.2 [lib.bind.1st]  Status: Open  Submitter: Andrew Demkin  Date: 26 Apr 2002

      -The definition of bind1st() (20.3.6.2 [lib.bind.1st]) can result in +The definition of bind1st() (20.3.6.2 [lib.bind.1st]) can result in the construction of an unsafe binding between incompatible pointer types. For example, given a function whose first parameter type is 'pointer to T', it's possible without error to bind an argument of type 'pointer to U' when U does not derive from T:

      -
      -   foo(T*, int);
      +
         foo(T*, int);
       
          struct T {};
          struct U {};
      @@ -1903,25 +1922,23 @@ The definition of bind1st() includes a functional-style conversion to
       map its argument to the expected argument type of the bound function
       (see below):
       

      -
      -  typename Operation::first_argument_type(x)
      +
        typename Operation::first_argument_type(x)
       

      -A functional-style conversion (5.2.3 [expr.type.conv]) is defined to be -semantically equivalent to an explicit cast expression (5.4 [expr.cast]), which may (according to 5.4, paragraph 5) be interpreted +A functional-style conversion (5.2.3 [expr.type.conv]) is defined to be +semantically equivalent to an explicit cast expression (5.4 [expr.cast]), which may (according to 5.4, paragraph 5) be interpreted as a reinterpret_cast, thus masking the error.

      -

      The problem and proposed change also apply to 20.3.6.4 [lib.bind.2nd].

      +

      The problem and proposed change also apply to 20.3.6.4 [lib.bind.2nd].

      Proposed resolution:

      The simplest and most localized change to prevent such errors is to require bind1st() use a static_cast expression rather than the functional-style conversion; that is, have bind1st() return:

      -
      -   binder1st<Operation>( op,
      +
         binder1st<Operation>( op,
            static_cast<typename Operation::first_argument_type>(x)).
       
      @@ -1945,7 +1962,7 @@ programming. all. Jeremy will check with the original author of this part of the Standard and will see what the original intent was.]


      -

      366. Excessive const-qualification

      Section: 27 [lib.input.output]  Status: Open  Submitter: Walter Brown, Marc Paterno  Date: 10 May 2002

      +

      366. Excessive const-qualification

      Section: 27 [lib.input.output]  Status: Open  Submitter: Walter Brown, Marc Paterno  Date: 10 May 2002

      The following member functions are declared const, yet return non-const pointers. We believe they are should be changed, because they allow code @@ -1964,112 +1981,92 @@ those terms, does not appear in the standard.]

      Proposed resolution:

      In 27.4.4 and 27.4.4.2

      Replace

      -
      -  basic_ostream<charT,traits>* tie() const;
      +
        basic_ostream<charT,traits>* tie() const;
       

      with

      -
      -  basic_ostream<charT,traits>* tie();
      +
        basic_ostream<charT,traits>* tie();
         const basic_ostream<charT,traits>* tie() const;
       

      and replace

      -
      -  basic_streambuf<charT,traits>* rdbuf() const;
      +
        basic_streambuf<charT,traits>* rdbuf() const;
       

      with

      -
      -  basic_streambuf<charT,traits>* rdbuf();
      +
        basic_streambuf<charT,traits>* rdbuf();
         const basic_streambuf<charT,traits>* rdbuf() const;
       

      In 27.5.2 and 27.5.2.3.1

      Replace

      -
      -  char_type* eback() const;
      +
        char_type* eback() const;
       

      with

      -
      -  char_type* eback();
      +
        char_type* eback();
         const char_type* eback() const;
       

      Replace

      -
      -  char_type gptr() const;
      +
        char_type gptr() const;
       

      with

      -
      -  char_type* gptr();
      +
        char_type* gptr();
         const char_type* gptr() const;
       

      Replace

      -
      -  char_type* egptr() const;
      +
        char_type* egptr() const;
       

      with

      -
      -  char_type* egptr();
      +
        char_type* egptr();
         const char_type* egptr() const;
       

      In 27.5.2 and 27.5.2.3.2

      Replace

      -
      -  char_type* pbase() const;
      +
        char_type* pbase() const;
       

      with

      -
      -  char_type* pbase();
      +
        char_type* pbase();
         const char_type* pbase() const;
       

      Replace

      -
      -  char_type* pptr() const;
      +
        char_type* pptr() const;
       

      with

      -
      -  char_type* pptr();
      +
        char_type* pptr();
         const char_type* pptr() const;
       

      Replace

      -
      -  char_type* epptr() const;
      +
        char_type* epptr() const;
       

      with

      -
      -  char_type* epptr();
      +
        char_type* epptr();
         const char_type* epptr() const;
       

      In 27.7.2, 27.7.2.2, 27.7.3 27.7.3.2, 27.7.4, and 27.7.6

      Replace

      -
      -  basic_stringbuf<charT,traits,Allocator>* rdbuf() const;
      +
        basic_stringbuf<charT,traits,Allocator>* rdbuf() const;
       

      with

      -
      -  basic_stringbuf<charT,traits,Allocator>* rdbuf();
      +
        basic_stringbuf<charT,traits,Allocator>* rdbuf();
         const basic_stringbuf<charT,traits,Allocator>* rdbuf() const;
       

      In 27.8.1.5, 27.8.1.7, 27.8.1.8, 27.8.1.10, 27.8.1.11, and 27.8.1.13

      Replace

      -
      -  basic_filebuf<charT,traits>* rdbuf() const;
      +
        basic_filebuf<charT,traits>* rdbuf() const;
       

      with

      -
      -  basic_filebuf<charT,traits>* rdbuf();
      +
        basic_filebuf<charT,traits>* rdbuf();
         const basic_filebuf<charT,traits>* rdbuf() const;
       

      -

      368. basic_string::replace has two "Throws" paragraphs

      Section: 21.3.5.6 [lib.string::replace]  Status: Open  Submitter: Beman Dawes  Date: 3 Jun 2002

      +

      368. basic_string::replace has two "Throws" paragraphs

      Section: 21.3.5.6 [lib.string::replace]  Status: Open  Submitter: Beman Dawes  Date: 3 Jun 2002

      -21.3.5.6 [lib.string::replace] basic_string::replace, second +21.3.5.6 [lib.string::replace] basic_string::replace, second signature, given in paragraph 1, has two "Throws" paragraphs (3 and 5).

      @@ -2085,7 +2082,7 @@ part of the "Effects" paragraph. Someone who understands string replace well needs to work on this.]


      -

      369. io stream objects and static ctors

      Section: 27.3 [lib.iostream.objects]  Status: Review  Submitter: Ruslan Abdikeev  Date: 8 Jul 2002

      +

      369. io stream objects and static ctors

      Section: 27.3 [lib.iostream.objects]  Status: Open  Submitter: Ruslan Abdikeev  Date: 8 Jul 2002

      Is it safe to use standard iostream objects from constructors of static objects? Are standard iostream objects constructed and are @@ -2150,6 +2147,15 @@ an appropriate class for doing the trick, I failed to found a mention of an _instance_ of ios_base::Init in Standard.

      Proposed resolution:

      + +

      [Redmond: This still isn't precise enough. We need to give + users some guarantees, i.e. "if you do X, then you are guaranteed + that you will see behavior Y." We should guarantee that stream + objects are constructed before a static constructor if (1) + <iostream> is #included before the relevant static object; or + (2) the user explicitly constructs an ios_base::Init object before + calling that constuctor.]

      +

      Add to [lib.iostream.objects], p2, immediately before the last sentence of the paragraph, the following two sentences:

      @@ -2202,13 +2208,12 @@ and destructors for static objects" used in Footnote 265 since the former includes other functions besides constructors and destructors, including the following example:

      -
      -    int foo () { return (std::cout << "foo()\n").rdstate (); }
      +
          int foo () { return (std::cout << "foo()\n").rdstate (); }
           int i = foo ();
           int main () { return i; }
       

      -

      371. Stability of multiset and multimap member functions

      Section: 23.1 [lib.container.requirements]  Status: Open  Submitter: Frank Compagner  Date: 20 Jul 2002

      +

      371. Stability of multiset and multimap member functions

      Section: 23.1 [lib.container.requirements]  Status: Open  Submitter: Frank Compagner  Date: 20 Jul 2002

      The requirements for multiset and multimap containers (23.1 [lib.containers.requirements], 23.1.2 [lib.associative.reqmnts], @@ -2225,8 +2230,7 @@ following 'idiom' that removes elements based on a certain predicate function.

      -
      -  multimap<int, int> m;
      +
        multimap<int, int> m;
         multimap<int, int>::iterator i = m.begin();
         while (i != m.end()) {
             if (pred(i))
      @@ -2261,7 +2265,7 @@ be hard to track down by users. This would also make the need for an
       erase_if() member function that much greater.
       

      -

      This issue is somewhat related to LWG issue 130.

      +

      This issue is somewhat related to LWG issue 130.

      [Santa Cruz: More people need to look at this. Much user code may assume stability. On the other hand, it seems drastic to add a @@ -2269,9 +2273,9 @@ erase_if() member function that much greater.

      Proposed resolution:


      -

      376. basic_streambuf semantics

      Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: Open  Submitter: Ray Lischner  Date: 14 Aug 2002

      +

      376. basic_streambuf semantics

      Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: Open  Submitter: Ray Lischner  Date: 14 Aug 2002

      -In Section 27.7.1.3 [lib.stringbuf.virtuals], Table 90, the implication is that +In Section 27.7.1.3 [lib.stringbuf.virtuals], Table 90, the implication is that the four conditions should be mutually exclusive, but they are not. The first two cases, as written, are subcases of the third. I think it would be clearer if the conditions were rewritten as follows: @@ -2309,46 +2313,7 @@ implementations before we decide on a solution.]

      Proposed resolution:


      -

      378. locale immutability and locale::operator=()

      Section: 22.1.1 [lib.locale]  Status: Review  Submitter: Martin Sebor  Date: 6 Sep 2002

      -

      -I think there is a problem with 22.1.1, p6 which says that -

      -
      -    -6- An instance of locale is immutable; once a facet reference
      -        is obtained from it, that reference remains usable as long
      -        as the locale value itself exists.
      -
      -

      -and 22.1.1.2, p4: -

      -
      -    const locale& operator=(const locale& other) throw();
      -
      -    -4- Effects: Creates a copy of other, replacing the current value.
      -
      -

      -How can a reference to a facet obtained from a locale object remain -valid after an assignment that clearly must replace all the facets -in the locale object? Imagine a program such as this -

      -
      -    std::locale loc ("de_DE");
      -    const std::ctype<char> &r0 = std::use_facet<std::ctype<char> >(loc);
      -    loc = std::locale ("en_US");
      -    const std::ctype<char> &r1 = std::use_facet<std::ctype<char> >(loc);
      -
      -

      -Is r0 really supposed to be preserved and destroyed only when loc goes -out of scope? -

      -

      Proposed resolution:

      -

      [Summer '04 mid-meeting mailing: Martin and Dietmar believe this - is a duplicate of issue 31 and recommend that it be - closed. -]

      - -
      -

      382. codecvt do_in/out result

      Section: 22.2.1.5 [lib.locale.codecvt]  Status: Open  Submitter: Martin Sebor  Date: 30 Aug 2002

      +

      382. codecvt do_in/out result

      Section: 22.2.1.5 [lib.locale.codecvt]  Status: Open  Submitter: Martin Sebor  Date: 30 Aug 2002

      It seems that the descriptions of codecvt do_in() and do_out() leave sufficient room for interpretation so that two implementations of @@ -2373,7 +2338,7 @@ the following seems less than adequately specified:

      1. - 22.2.1.5.2 [lib.locale.codecvt.virtuals], p2 says this about the effects of the + 22.2.1.5.2 [lib.locale.codecvt.virtuals], p2 says this about the effects of the function: ...Stops if it encounters a character it cannot convert... This assumes that there *is* a character to convert. What happens when there is a sequence that doesn't form a @@ -2406,7 +2371,7 @@ the following seems less than adequately specified:

      -Finally, the conditions described at the end of 22.2.1.5.2 [lib.locale.codecvt.virtuals], p4 don't seem to be possible: +Finally, the conditions described at the end of 22.2.1.5.2 [lib.locale.codecvt.virtuals], p4 don't seem to be possible:

      "A return value of partial, if (from_next == from_end), @@ -2420,7 +2385,7 @@ If the value is partial, it's not clear to me that (from_next ==from_end) could ever hold if there isn't enough room in the destination buffer. In order for (from_next==from_end) to hold, all characters in that range must have been successfully -converted (according to 22.2.1.5.2 [lib.locale.codecvt.virtuals], p2) and since there are no +converted (according to 22.2.1.5.2 [lib.locale.codecvt.virtuals], p2) and since there are no further source characters to convert, no more room in the destination buffer can be needed.

      @@ -2450,11 +2415,10 @@ To address these issues, I propose that paragraphs 2, 3, and 4 be rewritten as follows. The proposal incorporates the accepted resolution of lwg issue 19.

      -
      --2- Effects: Converts characters in the range of source elements
      +
      -2- Effects: Converts characters in the range of source elements
           [from, from_end), placing the results in sequential positions
      -    starting at destination to. Converts no more than (from_end ­ from)
      -    source elements, and stores no more than (to_limit ­ to)
      +    starting at destination to. Converts no more than (from_end ­ from)
      +    source elements, and stores no more than (to_limit ­ to)
           destination elements.
       
           Stops if it encounters a sequence of source elements it cannot
      @@ -2518,9 +2482,9 @@ written with the assumption of 1->N conversion in mind, not M->N.
       Bill, Howard, and Martin will provide new wording.
       ]


      -

      384. equal_range has unimplementable runtime complexity

      Section: 25.3.3.3 [lib.equal.range]  Status: Open  Submitter: Hans Bos  Date: 18 Oct 2002

      +

      384. equal_range has unimplementable runtime complexity

      Section: 25.3.3.3 [lib.equal.range]  Status: Open  Submitter: Hans Bos  Date: 18 Oct 2002

      -Section 25.3.3.3 [lib.equal.range] +Section 25.3.3.3 [lib.equal.range] states that at most 2 * log(last - first) + 1 comparisons are allowed for equal_range.

      @@ -2528,8 +2492,7 @@ comparisons are allowed for equal_range.

      It is not possible to implement equal_range with these constraints.

      In a range of one element as in:

      -
      -    int x = 1;
      +
          int x = 1;
           equal_range(&x, &x + 1, 1)
       
      @@ -2539,8 +2502,7 @@ comparisons are allowed for equal_range.

      I have checked a few libraries and they all use the same (nonconforming) algorithm for equal_range that has a complexity of

      -
      -     2* log(distance(first, last)) + 2.
      +
           2* log(distance(first, last)) + 2.
       

      I guess this is the algorithm that the standard assumes for equal_range.

      @@ -2567,11 +2529,11 @@ other questions matter.)]

      Proposed resolution:


      -

      385. Does call by value imply the CopyConstructible requirement?

      Section: 17 [lib.library]  Status: Open  Submitter: Matt Austern  Date: 23 Oct 2002

      +

      385. Does call by value imply the CopyConstructible requirement?

      Section: 17 [lib.library]  Status: Open  Submitter: Matt Austern  Date: 23 Oct 2002

      Many function templates have parameters that are passed by value; a typical example is find_if's pred parameter in -25.1.2 [lib.alg.find]. Are the corresponding template parameters +25.1.2 [lib.alg.find]. Are the corresponding template parameters (Predicate in this case) implicitly required to be CopyConstructible, or does that need to be spelled out explicitly?

      @@ -2590,8 +2552,8 @@ my_predicate& is not CopyConstructible.

      The scope of this problem, if it is a problem, is unknown. Function -object arguments to generic algorithms in clauses 25 [lib.algorithms] -and 26 [lib.numerics] are obvious examples. A review of the whole +object arguments to generic algorithms in clauses 25 [lib.algorithms] +and 26 [lib.numerics] are obvious examples. A review of the whole library is necessary.

      Proposed resolution:

      @@ -2603,8 +2565,8 @@ into references? References aren't copy constructible, so this should not be allowed. ]


      -

      386. Reverse iterator's operator[] has impossible return type

      Section: 24.4.1.3.11 [lib.reverse.iter.opindex]  Status: Review  Submitter: Matt Austern  Date: 23 Oct 2002

      -

      In 24.4.1.3.11 [lib.reverse.iter.opindex], reverse_iterator<>::operator[] +

      386. Reverse iterator's operator[] has impossible return type

      Section: 24.4.1.3.11 [lib.reverse.iter.opindex]  Status: Ready  Submitter: Matt Austern  Date: 23 Oct 2002

      +

      In 24.4.1.3.11 [lib.reverse.iter.opindex], reverse_iterator<>::operator[] is specified as having a return type of reverse_iterator::reference, which is the same as iterator_traits<Iterator>::reference. (Where Iterator is the underlying iterator type.)

      @@ -2616,7 +2578,7 @@ which is the same as iterator_traits<Iterator>::reference. to Iterator's value type. The return type specified for reverse_iterator's operator[] would thus appear to be impossible.

      -

      With the resolution of issue 299, the type of +

      With the resolution of issue 299, the type of a[n] will continue to be required (for random access iterators) to be convertible to the value type, and also a[n] = t will be a valid expression. Implementations of @@ -2628,19 +2590,17 @@ which is the same as iterator_traits<Iterator>::reference.

      Proposed resolution:

      -

      In 24.4.1.2 [lib.reverse.iter.requirements] change:

      +

      In 24.4.1.2 [lib.reverse.iter.requirements] change:

      -
      -reference operator[](difference_type n) const;
      +
      reference operator[](difference_type n) const;
       

      to:

      -
      -implementation defined operator[](difference_type n) const; // see lib.random.access.iterators
      +
      unspecified operator[](difference_type n) const; // see lib.random.access.iterators
       
      @@ -2656,7 +2616,7 @@ Comments from Dave Abrahams: IMO we should resolve 386 by just saying readable and writable, which is about as good as we can do. ]


      -

      387. std::complex over-encapsulated

      Section: 26.2 [lib.complex.numbers]  Status: Open  Submitter: Gabriel Dos Reis  Date: 8 Nov 2002

      +

      387. std::complex over-encapsulated

      Section: 26.2 [lib.complex.numbers]  Status: Open  Submitter: Gabriel Dos Reis  Date: 8 Nov 2002

      The absence of explicit description of std::complex<T> layout makes it imposible to reuse existing software developed in traditional @@ -2669,8 +2629,7 @@ severe pessimizations. For example, the only way to change, independently, the real and imaginary parts is to write something like

      -
      -complex<T> z;
      +
      complex<T> z;
       // ...
       // set the real part to r
       z = complex<T>(r, z.imag());
      @@ -2689,7 +2648,7 @@ of std::complex<> is not justified.
       

      Proposed resolution:

      -

      Add the following requirements to 26.2 [lib.complex.numbers] as 26.2/4:

      +

      Add the following requirements to 26.2 [lib.complex.numbers] as 26.2/4:

      If z is an lvalue expression of type cv std::complex<T> then

      @@ -2716,40 +2675,34 @@ imaginary part of a[i].
    -

    In the header synopsis in 26.2.1 [lib.complex.synopsis], replace

    -
    -  template<class T> T real(const complex<T>&);
    +

    In the header synopsis in 26.2.1 [lib.complex.synopsis], replace

    +
      template<class T> T real(const complex<T>&);
       template<class T> T imag(const complex<T>&);
     

    with

    -
    -  template<class T> const T& real(const complex<T>&);
    +
      template<class T> const T& real(const complex<T>&);
       template<class T>       T& real(      complex<T>&);
       template<class T> const T& imag(const complex<T>&);
       template<class T>       T& imag(      complex<T>&);
     
    -

    In 26.2.7 [lib.complex.value.ops] paragraph 1, change

    -
    -  template<class T> T real(const complex<T>&);
    +

    In 26.2.7 [lib.complex.value.ops] paragraph 1, change

    +
      template<class T> T real(const complex<T>&);
     

    to

    -
    -  template<class T> const T& real(const complex<T>&);
    +
      template<class T> const T& real(const complex<T>&);
       template<class T>       T& real(      complex<T>&);
     

    and change the Returns clause to "Returns: The real part of x

    . -

    In 26.2.7 [lib.complex.value.ops] paragraph 2, change

    -
    -  template<class T> T imag(const complex<T>&);
    +

    In 26.2.7 [lib.complex.value.ops] paragraph 2, change

    +
      template<class T> T imag(const complex<T>&);
     

    to

    -
    -  template<class T> const T& imag(const complex<T>&);
    +
      template<class T> const T& imag(const complex<T>&);
       template<class T>       T& imag(      complex<T>&);
     

    and change the Returns clause to "Returns: The imaginary @@ -2773,7 +2726,7 @@ part of x

    . justification for this change even without other considerations. All existing implementations already have the layout proposed here.


    -

    394. behavior of formatted output on failure

    Section: 27.6.2.5.1 [lib.ostream.formatted.reqmts]  Status: Open  Submitter: Martin Sebor  Date: 27 Dec 2002

    +

    394. behavior of formatted output on failure

    Section: 27.6.2.5.1 [lib.ostream.formatted.reqmts]  Status: Open  Submitter: Martin Sebor  Date: 27 Dec 2002

    There is a contradiction in Formatted output about what bit is supposed to be set if the formatting fails. On sentence says it's @@ -2782,11 +2735,10 @@ badbit and another that it's failbit.

    27.6.2.5.1, p1 says in the Common Requirements on Formatted output functions: -

    -     ... If the generation fails, then the formatted output function
    +

         ... If the generation fails, then the formatted output function
          does setstate(ios::failbit), which might throw an exception.
     
    -

    +

    27.6.2.5.2, p1 goes on to say this about Arithmetic Inserters:

    @@ -2795,15 +2747,14 @@ functions: following code fragment:

    -

    -     bool failed =
    +

         bool failed =
              use_facet<num_put<charT,ostreambuf_iterator<charT,traits>
              > >
              (getloc()).put(*this, *this, fill(), val). failed();
     
          ... If failed is true then does setstate(badbit) ...
     
    -

    +

    The original intent of the text, according to Jerry Schwarz (see c++std-lib-10500), is captured in the following paragraph: @@ -2870,7 +2821,7 @@ functions should be changed as proposed below.

    Rationale:


    -

    396. what are characters zero and one

    Section: 23.3.5.1 [lib.bitset.cons]  Status: Open  Submitter: Martin Sebor  Date: 5 Jan 2003

    +

    396. what are characters zero and one

    Section: 23.3.5.1 [lib.bitset.cons]  Status: Open  Submitter: Martin Sebor  Date: 5 Jan 2003

    23.3.5.1, p6 [lib.bitset.cons] talks about a generic character having the value of 0 or 1 but there is no definition of what @@ -2883,14 +2834,12 @@ p33, looks like a defect remotely related to DR 303.

    http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#303

    -
    -23.3.5.1:
    +    
    23.3.5.1:
       -6-  An element of the constructed string has value zero if the
            corresponding character in str, beginning at position pos,
            is 0. Otherwise, the element has the value one.
         
    -
    -23.3.5.2:
    +    
    23.3.5.2:
       -33-  Effects: Constructs a string object of the appropriate
             type and initializes it to a string of length N characters.
             Each character is determined by the value of its
    @@ -2906,9 +2855,8 @@ is a bitset, not a string.
         

    Proposed resolution:

    Change the constructor's function declaration immediately before -23.3.5.1 [lib.bitset.cons] p3 to:

    -
    -    template <class charT, class traits, class Allocator>
    +23.3.5.1  [lib.bitset.cons] p3 to:

    +
        template <class charT, class traits, class Allocator>
         explicit
         bitset(const basic_string<charT, traits, Allocator>& str,
                typename basic_string<charT, traits, Allocator>::size_type pos = 0,
    @@ -2916,7 +2864,7 @@ is a bitset, not a string.
                  basic_string<charT, traits, Allocator>::npos,
                charT zero = charT('0'), charT one = charT('1'))
     
    -

    Change the first two sentences of 23.3.5.1 [lib.bitset.cons] p6 to: "An +

    Change the first two sentences of 23.3.5.1 [lib.bitset.cons] p6 to: "An element of the constructed string has value 0 if the corresponding character in str, beginning at position pos, is zero. Otherwise, the element has the value 1.

    @@ -2929,19 +2877,17 @@ is zero. Otherwise, the element has the value 1.

    Change the declaration of the to_string member function - immediately before 23.3.5.2 [lib.bitset.members] p33 to:

    -
    -    template <class charT, class traits, class Allocator>
    +  immediately before 23.3.5.2  [lib.bitset.members] p33 to:

    +
        template <class charT, class traits, class Allocator>
         basic_string<charT, traits, Allocator> 
         to_string(charT zero = charT('0'), charT one = charT('1')) const;
     
    -

    Change the last sentence of 23.3.5.2 [lib.bitset.members] p33 to: "Bit +

    Change the last sentence of 23.3.5.2 [lib.bitset.members] p33 to: "Bit value 0 becomes the character zero, bit value 1 becomes the character one.

    -

    Change 23.3.5.3 [lib.bitset.operators] p8 to:

    +

    Change 23.3.5.3 [lib.bitset.operators] p8 to:

    Returns:

    -
    -  os << x.template to_string<charT,traits,allocator<charT> >(
    +
      os << x.template to_string<charT,traits,allocator<charT> >(
           use_facet<ctype<charT> >(os.getloc()).widen('0'),
           use_facet<ctype<charT> >(os.getloc()).widen('1'));
     
    @@ -2955,25 +2901,23 @@ is zero. Otherwise, the element has the value 1.

    resolution allows those users who care about this issue to get it right.

    We fix the inserter to use the new arguments. Note that we already - fixed the analogous problem with the extractor in issue 303.

    + fixed the analogous problem with the extractor in issue 303.


    -

    397. ostream::sentry dtor throws exceptions

    Section: 27.6.2.3 [lib.ostream::sentry]  Status: Open  Submitter: Martin Sebor  Date: 5 Jan 2003

    +

    397. ostream::sentry dtor throws exceptions

    Section: 27.6.2.3 [lib.ostream::sentry]  Status: Open  Submitter: Martin Sebor  Date: 5 Jan 2003

    17.4.4.8, p3 prohibits library dtors from throwing exceptions.

    27.6.2.3, p4 says this about the ostream::sentry dtor:

    -
    -    -4- If ((os.flags() & ios_base::unitbuf) && !uncaught_exception())
    +    
        -4- If ((os.flags() & ios_base::unitbuf) && !uncaught_exception())
             is true, calls os.flush().
         

    27.6.2.6, p7 that describes ostream::flush() says:

    -
    -    -7- If rdbuf() is not a null pointer, calls rdbuf()->pubsync().
    +    
        -7- If rdbuf() is not a null pointer, calls rdbuf()->pubsync().
             If that function returns ?-1 calls setstate(badbit) (which
             may throw ios_base::failure (27.4.4.3)).
         
    @@ -2992,7 +2936,7 @@ is the only one that can throw. PJP suggests specifying that sentry::~sentry() should internally catch any exceptions it might cause. ]


    -

    398. effects of end-of-file on unformatted input functions

    Section: 27.6.2.3 [lib.ostream::sentry]  Status: Open  Submitter: Martin Sebor  Date: 5 Jan 2003

    +

    398. effects of end-of-file on unformatted input functions

    Section: 27.6.2.3 [lib.ostream::sentry]  Status: Open  Submitter: Martin Sebor  Date: 5 Jan 2003

    While reviewing unformatted input member functions of istream for their behavior when they encounter end-of-file during input @@ -3007,61 +2951,54 @@ encounter an end-of-file (this is the expected behavior, and also the behavior of all major implementations):

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         get (char_type*, streamsize, char_type);
         
    -

    +

    Also sets failbit if it fails to extract any characters.

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         get (char_type*, streamsize);
         
    -

    +

    Also sets failbit if it fails to extract any characters.

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         getline (char_type*, streamsize, char_type);
         
    -

    +

    Also sets failbit if it fails to extract any characters.

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         getline (char_type*, streamsize);
         
    -

    +

    Also sets failbit if it fails to extract any characters.

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         ignore (int, int_type);
         
    -

    +

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         read (char_type*, streamsize);
         
    -

    +

    Also sets failbit if it encounters end-of-file.

    -

    -    streamsize readsome (char_type*, streamsize);
    +    

        streamsize readsome (char_type*, streamsize);
         
    -

    +

    The following unformated input member functions set failbit but @@ -3072,16 +3009,14 @@ also in conflict with all major implementation which set both eofbit and failbit):

    -

    -    int_type get();
    +    

        int_type get();
         
    -

    +

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         get (char_type&);
         
    -

    +

    These functions only set failbit of they extract no characters, otherwise they don't set any bits, even on failure (I find this @@ -3090,27 +3025,24 @@ conflict with all major implementations which set eofbit whenever they encounter end-of-file):

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         get (basic_streambuf<charT, traits>&, char_type);
         
    -

    +

    -

    -    basic_istream<charT, traits>&
    +    

        basic_istream<charT, traits>&
         get (basic_streambuf<charT, traits>&);
         
    -

    +

    This function sets no bits (all implementations except for STLport and Classic Iostreams set eofbit when they encounter end-of-file):

    -

    -    int_type peek ();
    +    

        int_type peek ();
         
    -

    +

    Proposed resolution:

    Informally, what we want is a global statement of intent saying that eofbit gets set if we trip across EOF, and then we can take @@ -3119,14 +3051,13 @@ end-of-file): and changing it on an individual basis wouldn't make things better. Dietmar will do this work.


    -

    401.  incorrect type casts in table 32 in lib.allocator.requirements

    Section: 20.1.5 [lib.allocator.requirements]  Status: Open  Submitter: Markus Mauhart  Date: 27 Feb 2003

    +

    401.  incorrect type casts in table 32 in lib.allocator.requirements

    Section: 20.1.5 [lib.allocator.requirements]  Status: Open  Submitter: Markus Mauhart  Date: 27 Feb 2003

    -I think that in par2 of 20.1.5 [lib.allocator.requirements] the last two +I think that in par2 of 20.1.5 [lib.allocator.requirements] the last two lines of table 32 contain two incorrect type casts. The lines are ...

    -
    -  a.construct(p,t)   Effect: new((void*)p) T(t)
    +
      a.construct(p,t)   Effect: new((void*)p) T(t)
       a.destroy(p)       Effect: ((T*)p)?->~T()
     
    @@ -3135,8 +3066,7 @@ lines of table 32 contain two incorrect type casts. The lines are ... from table 31:

    -
    -  alloc<T>             a     ;// an allocator for T
    +
      alloc<T>             a     ;// an allocator for T
       alloc<T>::pointer    p     ;// random access iterator
                                   // (may be different from T*)
       alloc<T>::reference  r = *p;// T&
    @@ -3160,7 +3090,7 @@ current requirement (being a random access iterator).
     

    Note: Actually I would prefer to replace "((T*)p)?->dtor_name" with "p?->dtor_name", but AFAICS this is not possible cause of an omission -in 13.5.6 [over.ref] (for which I have filed another DR on 29.11.2002). +in 13.5.6 [over.ref] (for which I have filed another DR on 29.11.2002).

    [Kona: The LWG thinks this is somewhere on the border between @@ -3172,26 +3102,7 @@ in 13.5.6 [over.ref] (for which I have filed a non-default pointer types.]


    -

    405. qsort and POD

    Section: 25.4 [lib.alg.c.library]  Status: Ready  Submitter: Ray Lischner  Date: 08 Apr 2003

    -

    -Section 25.4 [lib.alg.c.library] describes bsearch and qsort, from the C -standard library. Paragraph 4 does not list any restrictions on qsort, -but it should limit the base parameter to point to POD. Presumably, -qsort sorts the array by copying bytes, which requires POD. -

    -

    Proposed resolution:

    -

    -In 25.4 [lib.alg.c.library] paragraph 4, just after the declarations and -before the nonnormative note, add these words: "both of which have the -same behavior as the original declaration. The behavior is undefined -unless the objects in the array pointed to by base are of POD -type." -

    - -

    [Something along these lines is clearly necessary. Matt - provided wording.]

    -
    -

    406. vector::insert(s) exception safety

    Section: 23.2.4.3 [lib.vector.modifiers]  Status: Open  Submitter: Dave Abrahams  Date: 27 Apr 2003

    +

    406. vector::insert(s) exception safety

    Section: 23.2.4.3 [lib.vector.modifiers]  Status: Ready  Submitter: Dave Abrahams  Date: 27 Apr 2003

    There is a possible defect in the standard: the standard text was never intended to prevent arbitrary ForwardIterators, whose operations @@ -3202,29 +3113,26 @@ standard appears to impose requirements that aren't met by any existing implementation.

    Proposed resolution:

    -

    Replace 23.2.4.2 [lib.vector.capacity] paragraph 1 with:

    +

    Replace 23.2.4.3 [lib.vector.modifiers] paragraph 1 with:

    - 1 Notes: Causes reallocation if the new size is greater than the - old capacity. If no reallocation happens, all the iterators and - references before the insertion point remain valid. If an exception - is thrown other than by the copy constructor or assignment operator - of T (or, if first and last satisfy the forward iterator - requirements, an operation on first or last) there are no effects. + 1- Notes: Causes reallocation if the new size is greater than the + old capacity. If no reallocation happens, all the iterators and + references before the insertion point remain valid. If an exception + is thrown other than by the copy constructor or assignment operator + of T or by any InputIterator operation there are no effects.
    -

    [Something along these lines is probably a good idea. It's - unclear why we're making a distinction between Input Iterators and - Forward Iterators.]

    +

    [We probably need to say something similar for deque.]


    -

    408. Is vector<reverse_iterator<char*> > forbidden?

    Section: 24.1 [lib.iterator.requirements]  Status: Open  Submitter: Nathan Myers  Date: 3 June 2003

    +

    408. Is vector<reverse_iterator<char*> > forbidden?

    Section: 24.1 [lib.iterator.requirements]  Status: Open  Submitter: Nathan Myers  Date: 3 June 2003

    I've been discussing iterator semantics with Dave Abrahams, and a surprise has popped up. I don't think this has been discussed before.

    -24.1 [lib.iterator.requirements] says that the only operation that can be performed on "singular" +24.1 [lib.iterator.requirements] says that the only operation that can be performed on "singular" iterator values is to assign a non-singular value to them. (It doesn't say they can be destroyed, and that's probably a defect.) Some implementations have taken this to imply that there is no need @@ -3274,7 +3182,7 @@ T(), and so copying is defined if the result of T() is copyable.

    -Issue 235, which defines reverse_iterator's default +Issue 235, which defines reverse_iterator's default constructor more precisely, has some relevance to this issue. However, it is not the whole story.

    @@ -3300,7 +3208,7 @@ uninitialized, and possibly equal to an existing pointer value, or

    8.5 paragraph 5 seems to make clear that the second is required to -satisfy DR 235, at least for non-class Iterator argument +satisfy DR 235, at least for non-class Iterator argument types.

    @@ -3327,7 +3235,7 @@ are default-initialized, and it should explicitly allow destroying any iterator value, singular or not, default-initialized or not.

    -

    Related issue: 407

    +

    Related issue: 407

    Proposed resolution:

    [ @@ -3341,9 +3249,9 @@ wrong to impose so strict a requirement for iterators. ]


    -

    409. Closing an fstream should clear error state

    Section: 27.8.1.7 [lib.ifstream.members], 27.8.1.10 [lib.ofstream.members]  Status: Review  Submitter: Nathan Myers  Date: 3 June 2003

    +

    409. Closing an fstream should clear error state

    Section: 27.8.1.7 [lib.ifstream.members], 27.8.1.10 [lib.ofstream.members]  Status: Ready  Submitter: Nathan Myers  Date: 3 June 2003

    -A strict reading of 27.8.1 [lib.fstreams] shows that opening or +A strict reading of 27.8.1 [lib.fstreams] shows that opening or closing a basic_[io]fstream does not affect the error bits. This means, for example, that if you read through a file up to EOF, and then close the stream and reopen it at the beginning of the file, @@ -3351,7 +3259,7 @@ the EOF bit in the stream's error state is still set. This is counterintuitive.

    -The LWG considered this issue once before, as issue 22, +The LWG considered this issue once before, as issue 22, and put in a footnote to clarify that the strict reading was indeed correct. We did that because we believed the standard was unambiguous and consistent, and that we should not make architectural @@ -3360,40 +3268,47 @@ language, those considerations no longer apply.

    Proposed resolution:

    -

    Change 27.8.1.7 [lib.ifstream.members], para. 3 from:

    +

    Change 27.8.1.7 [lib.ifstream.members], para. 3 from:

    -Calls rdbuf()->open(s,mode|in). If that function returns a null pointer, calls setstate(failbit) (which may throw ios_base::failure [Footnote: (lib.iostate.flags)). +Calls rdbuf()->open(s,mode|in). If that function returns a null +pointer, calls setstate(failbit) (which may throw ios_base::failure +[Footnote: (lib.iostate.flags)].

    to:

    -
    -Calls rdbuf()->open(s,mode|in). If that function returns a null pointer, calls setstate(failbit) (which may throw ios_base::failure [Footnote: (lib.iostate.flags)), else calls clear(). +
    Calls rdbuf()->open(s,mode|in). If that function returns +a null pointer, calls setstate(failbit) (which may throw +ios_base::failure [Footnote: (lib.iostate.flags)), else calls clear().
    -

    Change 27.8.1.10 [lib.ofstream.members], para. 3 from:

    +

    Change 27.8.1.10 [lib.ofstream.members], para. 3 from:

    -
    -Calls rdbuf()->open(s,mode|out). If that function returns a null pointer, calls setstate(failbit) (which may throw ios_base::failure [Footnote: (lib.iostate.flags)). +
    Calls rdbuf()->open(s,mode|out). If that function +returns a null pointer, calls setstate(failbit) (which may throw +ios_base::failure [Footnote: (lib.iostate.flags)).

    to:

    -
    -Calls rdbuf()->open(s,mode|out). If that function returns a null pointer, calls setstate(failbit) (which may throw ios_base::failure [Footnote: (lib.iostate.flags)), else calls clear(). +
    Calls rdbuf()->open(s,mode|out). If that function +returns a null pointer, calls setstate(failbit) (which may throw +ios_base::failure [Footnote: (lib.iostate.flags)), else calls clear().
    -

    Change 27.8.1.13 [lib.fstream.members], para. 3 from:

    +

    Change 27.8.1.13 [lib.fstream.members], para. 3 from:

    -
    -Calls rdbuf()->open(s,mode), If that function returns a null pointer, calls setstate(failbit), (which may throw ios_base::failure). (lib.iostate.flags) ) +
    Calls rdbuf()->open(s,mode), If that function returns a +null pointer, calls setstate(failbit), (which may throw +ios_base::failure). (lib.iostate.flags) )

    to:

    -
    -Calls rdbuf()->open(s,mode), If that function returns a null pointer, calls setstate(failbit), (which may throw ios_base::failure). (lib.iostate.flags) ), else calls clear(). +
    Calls rdbuf()->open(s,mode), If that function returns a +null pointer, calls setstate(failbit), (which may throw +ios_base::failure). (lib.iostate.flags) ), else calls clear().
    @@ -3409,108 +3324,7 @@ flags.]

    of the three fstream class template instead.]


    -

    410. Missing semantics for stack and queue comparison operators

    Section: 23.2.3.1 [lib.queue], 23.2.3.3 [lib.stack]  Status: Ready  Submitter: Hans Bos  Date: 7 Jun 2003

    -

    -Sections 23.2.3.1 [lib.queue] and 23.2.3.3 [lib.stack] list -comparison operators (==, !=, <, <=, >, =>) for queue and -stack. Only the semantics for queue::operator== (23.2.3.1 [lib.queue] par2) and queue::operator< (23.2.3.1 [lib.queue] -par3) are defined. -

    -

    Proposed resolution:

    - -

    Add the following new paragraphs after 23.2.3.1 [lib.queue] - paragraph 3:

    - -
    - -
    -  operator!=
    -
    -

    Returns: x.c != y.c

    - -
    -  operator>
    -
    -

    Returns: x.c > y.c

    - -
    -  operator<=
    -
    -

    Returns: x.c <= y.c

    - -
    -  operator>=
    -
    -

    Returns: x.c >= y.c

    - -
    - -

    Add the following paragraphs at the end of 23.2.3.3 [lib.stack]:

    - -
    - -
    -  operator==
    -
    -

    Returns: x.c == y.c

    - -
    -  operator<
    -
    -

    Returns: x.c < y.c

    - -
    -  operator!=
    -
    -

    Returns: x.c != y.c

    - -
    -  operator>
    -
    -

    Returns: x.c > y.c

    - -
    -  operator<=
    -
    -

    Returns: x.c <= y.c

    - -
    -  operator>=
    -
    -

    Returns: x.c >= y.c

    - -
    - - -

    [Kona: Matt provided wording.]

    - -

    Rationale:

    -There isn't any real doubt about what these operators are -supposed to do, but we ought to spell it out. -
    -

    412. Typo in 27.4.4.3

    Section: 27.4.4.3 [lib.iostate.flags]  Status: Ready  Submitter: Martin Sebor  Date: 10 Jul 2003

    -

    -The Effects clause in 27.4.4.3 [lib.iostate.flags] paragraph 5 says that the -function only throws if the respective bits are already set prior to -the function call. That's obviously not the intent. The typo ought to -be corrected and the text reworded as: "If (state & -exceptions()) == 0, returns. ..." -

    -

    Proposed resolution:

    -

    -In 27.4.4.3 [lib.iostate.flags] paragraph 5, replace "If (rdstate() & -exceptions()) == 0" with "If ((state | (rdbuf() ? goodbit : badbit)) -& exceptions()) == 0". -

    - -

    [Kona: the original proposed resolution wasn't quite right. We - really do mean rdstate(); the ambiguity is that the wording in the - standard doesn't make it clear whether we mean rdstate() before - setting the new state, or rdsate() after setting it. We intend the - latter, of course. Post-Kona: Martin provided wording.]

    - -
    -

    413. Proposed resolution to LDR#64 still wrong

    Section: 27.6.1.2.3 [lib.istream::extractors]  Status: Open  Submitter: Bo Persson  Date: 13 Jul 2003

    +

    413. Proposed resolution to LDR#64 still wrong

    Section: 27.6.1.2.3 [lib.istream::extractors]  Status: Ready  Submitter: Bo Persson  Date: 13 Jul 2003

    The second sentence of the proposed resolution says:

    @@ -3529,7 +3343,7 @@ basic_istream (*this) and inserting into sb. I can't really tell if

    [ Sydney: Definitely a real issue. We are, indeed, extracting characters from an istream and not from sb. The problem was there in the FDIS and -wasn't fixed by issue 64. Probably what was intended was +wasn't fixed by issue 64. Probably what was intended was to have *this instead of sb. We're talking about the exception flag state of a basic_istream object, and there's only one basic_istream object in this discussion, so that would be a consistent @@ -3539,36 +3353,23 @@ extractors.) PJP will provide wording. ]

    Proposed resolution:

    -
    -

    415. behavior of std::ws

    Section: 27.6.1.4 [lib.istream.manip]  Status: Ready  Submitter: Martin Sebor  Date: 18 Sep 2003

    -

    -According to 27.6.1.4, the ws() manipulator is not required to construct -the sentry object. The manipulator is also not a member function so the -text in 27.6.1, p1 through 4 that describes the exception policy for -istream member functions does not apply. That seems inconsistent with -the rest of extractors and all the other input functions (i.e., ws will -not cause a tied stream to be flushed before extraction, it doesn't check -the stream's exceptions or catch exceptions thrown during input, and it -doesn't affect the stream's gcount). -

    -

    Proposed resolution:

    -

    -Add to 27.6.1.4 [lib.istream.manip], immediately before the first sentence -of paragraph 1, the following text: -

    +

    Change the sentence from:

    -
    - Behaves as an unformatted input function (as described in - 27.6.1.3, paragraph 1), except that it does not count the number - of characters extracted and does not affect the value returned by - subsequent calls to is.gcount(). After constructing a sentry - object... -
    +
    +If it inserted no characters because it caught an exception thrown +while extracting characters from sb and failbit is on in exceptions(), +then the caught exception is rethrown. +
    -

    [Post-Kona: Martin provided wording]

    +

    to:

    +
    +If it inserted no characters because it caught an exception thrown +while extracting characters from *this and failbit is on in exceptions(), +then the caught exception is rethrown. +

    -

    416. definitions of XXX_MIN and XXX_MAX macros in climits

    Section: 18.2.2 [lib.c.limits]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    416. definitions of XXX_MIN and XXX_MAX macros in climits

    Section: 18.2.2 [lib.c.limits]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    Given two overloads of the function foo(), one taking an argument of type @@ -3617,7 +3418,7 @@ where the actual type is easily detectable by overload resolution. <climits>.]


    -

    417. what does ctype::do_widen() return on failure

    Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    417. what does ctype::do_widen() return on failure

    Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    The Effects and Returns clauses of the do_widen() member function of the ctype facet fail to specify the behavior of the function on failure. @@ -3639,7 +3440,7 @@ and iostream to reliably detect this failure. existing library components aren't written with the assumption that widen can throw.]


    -

    418. exceptions thrown during iostream cleanup

    Section: 27.4.2.1.6 [lib.ios::Init]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    418. exceptions thrown during iostream cleanup

    Section: 27.4.2.1.6 [lib.ios::Init]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    The dtor of the ios_base::Init object is supposed to call flush() on the 6 standard iostream objects cout, cerr, clog, wcout, wcerr, and wclog. @@ -3665,7 +3466,7 @@ object throws. might reasonably swallow the exception, or call abort, or do something even more drastic.]


    -

    419. istream extractors not setting failbit if eofbit is already set

    Section: 27.6.1.1.2 [lib.istream::sentry]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    419. istream extractors not setting failbit if eofbit is already set

    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() @@ -3684,7 +3485,6 @@ eof = 1, fail = 1 on all of them.

    -
     #include <sstream>
     #include <cstdio>
     
    @@ -3744,7 +3544,7 @@ corrected.
       clearer.


    -

    421. is basic_streambuf copy-constructible?

    Section: 27.5.2.1 [lib.streambuf.cons]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    421. is basic_streambuf copy-constructible?

    Section: 27.5.2.1 [lib.streambuf.cons]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    The reflector thread starting with c++std-lib-11346 notes that the class template basic_streambuf, along with basic_stringbuf and basic_filebuf, @@ -3763,7 +3563,7 @@ of the standard provide a compiler-generated copy ctor and assignment operator yet fail to specify their semantics. It's believed that the only types for which this is actually a problem (i.e. types where the compiler-generated default may be inappropriate and may not have been -intended) are locale facets. See issue 439. +intended) are locale facets. See issue 439.

    Proposed resolution:

    @@ -3771,22 +3571,19 @@ intended) are locale facets. See issue 439.

    -
    -basic_streambuf(const basic_streambuf& sb);
    +
    basic_streambuf(const basic_streambuf& sb);
     basic_streambuf& operator=(const basic_streambuf& sb);
     

    Insert after 27.5.2.1, paragraph 2:

    -
    -basic_streambuf(const basic_streambuf& sb);
    +
    basic_streambuf(const basic_streambuf& sb);
     

    Constructs a copy of sb.

    Postcondtions:

    -
    -                eback() == sb.eback()
    +
                    eback() == sb.eback()
                     gptr()  == sb.gptr()
                     egptr() == sb.egptr()
                     pbase() == sb.pbase()
    @@ -3795,15 +3592,13 @@ basic_streambuf(const basic_streambuf& sb);
                     getloc() == sb.getloc()
     
    -
    -basic_streambuf& operator=(const basic_streambuf& sb);
    +
    basic_streambuf& operator=(const basic_streambuf& sb);
     

    Assigns the data members of sb to this.

    Postcondtions:

    -
    -                eback() == sb.eback()
    +
                    eback() == sb.eback()
                     gptr()  == sb.gptr()
                     egptr() == sb.egptr()
                     pbase() == sb.pbase()
    @@ -3822,8 +3617,7 @@ basic_streambuf& operator=(const basic_streambuf& sb);
     

    Insert into the basic_stringbuf synopsis in the private section:

    -
    -basic_stringbuf(const basic_stringbuf&);             // not defined
    +
    basic_stringbuf(const basic_stringbuf&);             // not defined
     basic_stringbuf& operator=(const basic_stringbuf&);  // not defined
     
    @@ -3833,8 +3627,7 @@ basic_stringbuf& operator=(const basic_stringbuf&); // not defined

    Insert into the basic_stringbuf synopsis in the public section:

    -
    -basic_stringbuf(const basic_stringbuf& sb);
    +
    basic_stringbuf(const basic_stringbuf& sb);
     basic_stringbuf& operator=(const basic_stringbuf& sb);
     
    @@ -3847,21 +3640,23 @@ Constructs an independent copy of sb as if with sb.str(), and with the openmode

    Postcondtions:

    -
    -               str() == sb.str()
    +
                   str() == sb.str()
                    gptr()  - eback() == sb.gptr()  - sb.eback()
                    egptr() - eback() == sb.egptr() - sb.eback()
                    pptr()  - pbase() == sb.pptr()  - sb.pbase()
                    getloc() == sb.getloc()
     
    -

    -Note: The only requirement on epptr() is that it point beyond the initialized range if an output sequence exists. There is no requirement that epptr() - pbase() == sb.epptr() - sb.pbase(). +

    Note: The only requirement on epptr() is that it point beyond the +initialized range if an output sequence exists. There is no requirement +that epptr() - pbase() == sb.epptr() - sb.pbase().

    basic_stringbuf& operator=(const basic_stringbuf& sb);
    -

    -After assignment the basic_stringbuf has the same state as if it were initially copy constructed from sb, except that the basic_stringbuf is allowed to retain any excess capacity it might have, which may in turn effect the value of epptr(). +

    After assignment the basic_stringbuf has the same state as if it +were initially copy constructed from sb, except that the +basic_stringbuf is allowed to retain any excess capacity it might have, +which may in turn effect the value of epptr().

    @@ -3870,8 +3665,7 @@ After assignment the basic_stringbuf has the same state as if it were initially

    Insert at the bottom of the basic_filebuf synopsis:

    -
    -private:
    +
    private:
       basic_filebuf(const basic_filebuf&);             // not defined
       basic_filebuf& operator=(const basic_filebuf&);  // not defined
     
    @@ -3921,7 +3715,7 @@ basic_filebuf.


    -

    422. explicit specializations of member functions of class templates

    Section: 17.4.3.1 [lib.reserved.names]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    422. explicit specializations of member functions of class templates

    Section: 17.4.3.1 [lib.reserved.names]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    It has been suggested that 17.4.3.1, p1 may or may not allow programs to explicitly specialize members of standard templates on user-defined types. @@ -3935,7 +3729,7 @@ the program) by relying on the "as if" rule.

    Proposed resolution:

    - Add the following sentence immediately after the text of 17.4.3.1 [lib.reserved.names], p1: + Add the following sentence immediately after the text of 17.4.3.1 [lib.reserved.names], p1:

    @@ -3959,7 +3753,7 @@ library class templates. We need to consult with CWG to make sure we use the right wording.]


    -

    423. effects of negative streamsize in iostreams

    Section: 27 [lib.input.output]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    423. effects of negative streamsize in iostreams

    Section: 27 [lib.input.output]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    A third party test suite tries to exercise istream::ignore(N) with @@ -3989,7 +3783,7 @@ ostream::write(). negative. Martin will do that review.]


    -

    424. normative notes

    Section: 17.3.1.1 [lib.structure.summary]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    424. normative notes

    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: @@ -4040,89 +3834,7 @@ None of these lists is meant to be exhaustive. ]


    -

    425. return value of std::get_temporary_buffer

    Section: 20.4.3 [lib.temporary.buffer]  Status: Ready  Submitter: Martin Sebor  Date: 18 Sep 2003

    -

    -The standard is not clear about the requirements on the value returned from -a call to get_temporary_buffer(0). In particular, it fails to specify whether -the call should return a distinct pointer each time it is called (like -operator new), or whether the value is unspecified (as if returned by -malloc). The standard also fails to mention what the required behavior -is when the argument is less than 0. -

    -

    Proposed resolution:

    -

    Change 20.4.3 [lib.temporary.buffer] paragraph 2 from "...or a pair of 0 -values if no storage can be obtained" to "...or a pair of 0 values if -no storage can be obtained or if n <= 0."

    -

    [Kona: Matt provided wording]

    -
    -

    426. search_n(), fill_n(), and generate_n() with negative n

    Section: 25.1.9 [lib.alg.search], 25.2.5 [lib.alg.fill], 25.2.6 [lib.alg.generate]  Status: Ready  Submitter: Martin Sebor  Date: 18 Sep 2003

    -

    -The complexity requirements for these function templates are incorrect -(or don't even make sense) for negative n:

    - -

    25.1.9, p7 (search_n): -
    -Complexity: At most (last1 - first1) * count applications -of the corresponding predicate.

    - -

    25.2.5, p3 (fill_n): -
    -Complexity: Exactly last - first (or n) assignments.

    -
    - -

    25.2.6, p3 (generate_n): -
    -Complexity: Exactly last - first (or n) assignments.

    - -

    -In addition, the Requirements or the Effects clauses for the latter two -templates don't say anything about the behavior when n is negative. -

    -

    Proposed resolution:

    -

    Change 25.1.9, p7 to

    - -
    -Complexity: At most (last1 - first1) * count applications -of the corresponding predicate if count is positive, -or 0 otherwise. -
    - -

    Change 25.2.5, p2 to

    -
    -Effects: Assigns value through all the iterators in the range [first, -last), or [first, first + n) if n is positive, none otherwise. -
    - -

    Change 25.2.5, p3 to:

    -
    -Complexity: Exactly last - first (or n if n is positive, -or 0 otherwise) assignments. -
    - -

    -Change 25.2.6, p1 -to (notice the correction for the misspelled "through"): -

    -
    -Effects: Invokes the function object genand assigns the return -value of gen through all the iterators in the range [first, last), -or [first, first + n) if n is positive, or [first, first) -otherwise. -
    - -

    Change 25.2.6, p3 to:

    -
    -Complexity: Exactly last - first (or n if n is positive, -or 0 otherwise) assignments. -
    -

    Rationale:

    -

    Informally, we want to say that whenever we see a negative number - we treat it the same as if it were zero. We believe the above - changes do that (although they may not be the minimal way of saying - so). The LWG considered and rejected the alternative of saying that - negative numbers are undefined behavior.

    -
    -

    427. stage 2 and rationale of DR 221

    Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    427. stage 2 and rationale of DR 221

    Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    The requirements specified in Stage 2 and reiterated in the rationale of DR 221 (and echoed again in DR 303) specify that num_get<charT>:: @@ -4153,7 +3865,7 @@ instantiate the num_get template on user-defined types. and traits is in order. The LWG considered and rejected the possibility of changing numeric facets to use narrowing instead of widening. This may be a good idea for other reasons (see issue - 459), but it doesn't solve the problem raised by this + 459), but it doesn't solve the problem raised by this issue. Whether we use widen or narrow the num_get facet still has no idea which traits class the user wants to use for the comparison, because only streams, not facets, are passed traits @@ -4169,7 +3881,7 @@ traits classes, then the facet could reasonably be required to use char_traits<charT>

    .
    -

    430. valarray subset operations

    Section: 26.3.2.4 [lib.valarray.sub]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    +

    430. valarray subset operations

    Section: 26.3.2.4 [lib.valarray.sub]  Status: Open  Submitter: Martin Sebor  Date: 18 Sep 2003

    The standard fails to specify the behavior of valarray::operator[](slice) and other valarray subset operations when they are passed an "invalid" @@ -4183,8 +3895,8 @@ 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.]


    -

    431. Swapping containers with unequal allocators

    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 +

    431. Swapping containers with unequal allocators

    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 that all instances of an allocator type compare equal. We gave @@ -4207,8 +3919,7 @@ object (e.g., slice (2, 1, 1) for a valarray of size 1).

    3. The operation swaps both the vectors' contents and their allocators. This would be an O(1) operation. That is:

    -
    -    my_alloc a1(...);
    +  
        my_alloc a1(...);
         my_alloc a2(...);
         assert(a1 != a2);
     
    @@ -4231,307 +3942,35 @@ object (e.g., slice (2, 1, 1) for a valarray of size 1).
     

    [pre-Sydney: Howard argues for option 3 in n1599.]


    -

    432. stringbuf::overflow() makes only one write position available

    Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: Ready  Submitter: Christian W Brock  Date: 24 Sep 2003

    -

    27.7.1.3 par 8 says:

    -
    -Notes: The function can make a write position available only if - ( mode & ios_base::out) != 0. To make a write position - available, the function reallocates (or initially allocates) an - array object with a sufficient number of elements to hold the - current array object (if any), plus one additional write position. - If ( mode & ios_base::in) != 0, the function alters the read end - pointer egptr() to point just past the new write position (as - does the write end pointer epptr()). -
    - +

    434. bitset::to_string() hard to use

    Section: 23.3.5.2 [lib.bitset.members]  Status: Ready  Submitter: Martin Sebor  Date: 15 Oct 2003

    -The sentences "plus one additional write position." and especially - "(as does the write end pointer epptr())" COULD by interpreted - (and is interpreted by at least my library vendor) as: +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 +entire template argument list (3 arguments). At least two implementations +provide a number of overloads of this template to make it easier to use.

    +

    Proposed resolution:

    +

    In order to allow callers to specify no template arguments at all, just the +first one (charT), or the first 2 (charT and traits), in addition to all +three template arguments, add the following three overloads to both the +interface (declarations only) of the class template bitset as well as to +section 23.3.5.2, immediately after p34, the Returns clause of the existing +to_string() member function template:

    -
    - post-condition: epptr() == pptr()+1 -
    +
        template <class charT, class traits>
    +    basic_string<charT, traits, allocator<charT> >
    +    to_string () const;
     
    -

    -This WOULD force sputc() to call the virtual overflow() each time. -

    + -34.1- Returns: to_string<charT, traits, allocator<charT> >(). -

    The proposed change also affects Defect Report 169.

    + template <class charT> + basic_string<charT, char_traits<charT>, allocator<charT> > + to_string () const; -

    Proposed resolution:

    -

    27.7.1.1/2 Change:

    + -34.2- Returns: to_string<charT, char_traits<charT>, allocator<charT> >(). -
    -2- Notes: The function allocates no array object. -
    - -

    -to: -

    - -
    -2- Postcondition: str() == "". -
    - -

    -27.7.1.1/3 Change: -

    - -
    -

    --3- Effects: Constructs an object of class basic_stringbuf, -initializing the base class with basic_streambuf() -(lib.streambuf.cons), and initializing mode with which . Then copies -the content of str into the basic_stringbuf underlying character -sequence and initializes the input and output sequences according to -which. If which & ios_base::out is true, initializes the output -sequence with the underlying sequence. If which & ios_base::in is -true, initializes the input sequence with the underlying sequence. -

    -
    - -

    to:

    - -
    -

    --3- Effects: Constructs an object of class basic_stringbuf, -initializing the base class with basic_streambuf() -(lib.streambuf.cons), and initializing mode with which. Then copies -the content of str into the basic_stringbuf underlying character -sequence. If which & ios_base::out is true, initializes the output -sequence such that pbase() points to the first underlying character, -epptr() points one past the last underlying character, and if (which & -ios_base::ate) is true, pptr() is set equal to -epptr() else pptr() is set equal to pbase(). If which & ios_base::in -is true, initializes the input sequence such that eback() and gptr() -point to the first underlying character and egptr() points one past -the last underlying character. -

    -
    - -

    27.7.1.2/1 Change:

    - -
    -

    --1- Returns: A basic_string object whose content is equal to the -basic_stringbuf underlying character sequence. If the buffer is only -created in input mode, the underlying character sequence is equal to -the input sequence; otherwise, it is equal to the output sequence. In -case of an empty underlying character sequence, the function returns -basic_string<charT,traits,Allocator>(). -

    -
    - -

    to:

    - -
    -

    --1- Returns: A basic_string object whose content is equal to the -basic_stringbuf underlying character sequence. If the basic_stringbuf -was created only in input mode, the resultant basic_string contains -the character sequence in the range [eback(), egptr()). If the -basic_stringbuf was created with (which & ios_base::out) being true -then the resultant basic_string contains the character sequence in the -range [pbase(), high_mark) where high_mark represents the position one -past the highest initialized character in the buffer. Characters can -be initialized either through writing to the stream, or by -constructing the basic_stringbuf with a basic_string, or by calling -the str(basic_string) member function. In the case of calling the -str(basic_string) member function, all characters initialized prior to -the call are now considered uninitialized (except for those -characters re-initialized by the new basic_string). Otherwise the -basic_stringbuf has been created in neither input nor output mode and -a zero length basic_string is returned. -

    -
    - -

    -27.7.1.2/2 Change: -

    - -
    -

    --2- Effects: If the basic_stringbuf's underlying character sequence is -not empty, deallocates it. Then copies the content of s into the -basic_stringbuf underlying character sequence and initializes the -input and output sequences according to the mode stored when creating -the basic_stringbuf object. If (mode&ios_base::out) is true, then -initializes the output sequence with the underlying sequence. If -(mode&ios_base::in) is true, then initializes the input sequence with -the underlying sequence. -

    -
    - -

    to:

    - -
    -

    --2- Effects: Copies the content of s into the basic_stringbuf -underlying character sequence. If mode & ios_base::out is true, -initializes the output sequence such that pbase() points to the first -underlying character, epptr() points one past the last underlying -character, and if (mode & ios_base::ate) is true, -pptr() is set equal to epptr() else pptr() is set equal to pbase(). If -mode & ios_base::in is true, initializes the input sequence such that -eback() and gptr() point to the first underlying character and egptr() -points one past the last underlying character. -

    -
    - -

    Remove 27.2.1.2/3. (Same rationale as issue 238: incorrect and unnecessary.)

    - -

    27.7.1.3/1 Change:

    - -
    -

    -1- Returns: If the input sequence has a read position available, -returns traits::to_int_type(*gptr()). Otherwise, returns -traits::eof(). -

    -
    - -

    to:

    - -
    -

    -1- Returns: If the input sequence has a read position available, -returns traits::to_int_type(*gptr()). Otherwise, returns -traits::eof(). Any character in the underlying buffer which has been -initialized is considered to be part of the input sequence. -

    -
    - -

    27.7.1.3/9 Change:

    - -
    -

    --9- Notes: The function can make a write position available only if ( -mode & ios_base::out) != 0. To make a write position available, the -function reallocates (or initially allocates) an array object with a -sufficient number of elements to hold the current array object (if -any), plus one additional write position. If ( mode & ios_base::in) != -0, the function alters the read end pointer egptr() to point just past -the new write position (as does the write end pointer epptr()). -

    -
    - -

    to:

    - -
    -

    --9- The function can make a write position available only if ( mode & -ios_base::out) != 0. To make a write position available, the function -reallocates (or initially allocates) an array object with a sufficient -number of elements to hold the current array object (if any), plus one -additional write position. If ( mode & ios_base::in) != 0, the -function alters the read end pointer egptr() to point just past the -new write position. -

    -
    - -

    27.7.1.3/12 Change:

    - -
    -

    --12- _ If (newoff + off) < 0, or (xend - xbeg) < (newoff + off), the -positioning operation fails. Otherwise, the function assigns xbeg + -newoff + off to the next pointer xnext . -

    -
    - -

    to:

    - -
    -

    --12- _ If (newoff + off) < 0, or if (newoff + off) refers to an -uninitialized character (as defined in 27.7.1.2 [lib.stringbuf.members] -paragraph 1), the positioning operation fails. Otherwise, the function -assigns xbeg + newoff + off to the next pointer xnext . -

    -
    - -

    [post-Kona: Howard provided wording. At Kona the LWG agreed that - something along these lines was a good idea, but the original - proposed resolution didn't say enough about the effect of various - member functions on the underlying character sequences.]

    - -

    Rationale:

    -

    The current basic_stringbuf description is over-constrained in such -a way as to prohibit vendors from making this the high-performance -in-memory stream it was meant to be. The fundamental problem is that -the pointers: eback(), gptr(), egptr(), pbase(), pptr(), epptr() are -observable from a derived client, and the current description -restricts the range [pbase(), epptr()) from being grown geometrically. -This change allows, but does not require, geometric growth of this -range.

    - -

    Backwards compatibility issues: These changes will break code that -derives from basic_stringbuf, observes epptr(), and depends upon -[pbase(), epptr()) growing by one character on each call to overflow() -(i.e. test suites). Otherwise there are no backwards compatibility -issues.

    - -

    27.7.1.1/2: The non-normative note is non-binding, and if it were -binding, would be over specification. The recommended change focuses -on the important observable fact.

    - -

    27.7.1.1/3: This change does two things: 1. It describes exactly -what must happen in terms of the sequences. The terms "input -sequence" and "output sequence" are not well defined. 2. It -introduces a common extension: open with app or ate mode. I concur -with issue 238 that paragraph 4 is both wrong and unnecessary.

    - -

    27.7.1.2/1: This change is the crux of the efficiency issue. The -resultant basic_string is not dependent upon epptr(), and thus -implementors are free to grow the underlying buffer geometrically -during overflow() *and* place epptr() at the end of that buffer.

    - -

    27.7.1.2/2: Made consistent with the proposed 27.7.1.1/3.

    - -

    27.7.1.3/1: Clarifies that characters written to the stream beyond -the initially specified string are available for reading in an i/o -basic_streambuf.

    - -

    27.7.1.3/9: Made normative by removing "Notes:", and removed the -trailing parenthetical comment concerning epptr().

    - -

    27.7.1.3/12: Restricting the positioning to [xbeg, xend) is no -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: Review  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 -entire template argument list (3 arguments). At least two implementations -provide a number of overloads of this template to make it easier to use. -

    -

    Proposed resolution:

    -

    In order to allow callers to specify no template arguments at all, just the -first one (charT), or the first 2 (charT and traits), in addition to all -three template arguments, add the following three overloads to both the -interface (declarations only) of the class template bitset as well as to -section 23.3.5.2, immediately after p34, the Returns clause of the existing -to_string() member function template:

    - -
    -    template <class charT, class traits>
    -    basic_string<charT, traits, allocator<charT> >
    -    to_string () const;
    -
    -    -34.1- Returns: to_string<charT, traits, allocator<charT> >().
    -
    -    template <class charT>
    -    basic_string<charT, char_traits<charT>, allocator<charT> >
    -    to_string () const;
    -
    -    -34.2- Returns: to_string<charT, char_traits<charT>, allocator<charT> >().
    -
    -    basic_string<char, char_traits<char>, allocator<char> >
    -    to_string () const;
    +    basic_string<char, char_traits<char>, allocator<char> >
    +    to_string () const;
     
         -34.3- Returns: to_string<char, char_traits<char>, allocator<char> >().
     
    @@ -4543,80 +3982,26 @@ to_string() member function template:

    ]


    -

    435. bug in DR 25

    Section: 21.3.7.9 [lib.string.io]  Status: Ready  Submitter: Martin Sebor  Date: 15 Oct 2003

    +

    438. Ambiguity in the "do the right thing" clause

    Section: 23.1.1 [lib.sequence.reqmts]  Status: Ready  Submitter: Howard Hinnant  Date: 20 Oct 2003

    -

    -It has been pointed out that the proposed resolution in DR 25 may not be -quite up to snuff:
    -http://gcc.gnu.org/ml/libstdc++/2003-09/msg00147.html -http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#25
    -

    - -

    -It looks like Petur is right. The complete corrected text is copied below. -I think we may have have been confused by the reference to 22.2.2.2.2 and -the subsequent description of `n' which actually talks about the second -argument to sputn(), not about the number of fill characters to pad with. -

    - -

    -So the question is: was the original text correct? If the intent was to -follow classic iostreams then it most likely wasn't, since setting width() -to less than the length of the string doesn't truncate it on output. This -is also the behavior of most implementations (except for SGI's standard -iostreams where the operator does truncate). -

    -

    Proposed resolution:

    -

    Change the text in 21.3.7.9, p4 from

    -
    - If bool(k) is true, inserts characters as if by calling - os.rdbuf()->sputn(str.data(), n), padding as described in stage 3 - of lib.facet.num.put.virtuals, where n is the larger of os.width() - and str.size(); -
    -

    to

    -
    - If bool(k) is true, determines padding as described in - lib.facet.num.put.virtuals, and then inserts the resulting - sequence of characters seq as if by calling - os.rdbuf()->sputn(seq, n), where n is the larger of - os.width() and str.size(); -
    - -

    [Kona: it appears that neither the original wording, DR25, nor the - proposed resolution, is quite what we want. We want to say that - the string will be output, padded to os.width() if necessary. We - don't want to duplicate the padding rules in clause 22, because - they're complicated, but we need to be careful because they weren't - quite written with quite this case in mind. We need to say what - the character sequence is, and then defer to clause 22. Post-Kona: - Benjamin provided wording.]

    - -
    -

    438. Ambiguity in the "do the right thing" clause

    Section: 23.1.1 [lib.sequence.reqmts]  Status: Review  Submitter: Howard Hinnant  Date: 20 Oct 2003

    - -

    Section 23.1.1 [lib.sequence.reqmts], paragraphs 9-11, fixed up the problem +

    Section 23.1.1 [lib.sequence.reqmts], paragraphs 9-11, fixed up the problem noticed with statements like:

    -
    -vector<int> v(10, 1);
    +
    vector<int> v(10, 1);
     

    The intent of the above statement was to construct with:

    -
    -vector(size_type, const value_type&);
    +
    vector(size_type, const value_type&);
     

    but early implementations failed to compile as they bound to:

    -
    -template <class InputIterator>
    +
    template <class InputIterator>
     vector(InputIterator f, InputIterator l);
     

    instead.

    Paragraphs 9-11 say that if InputIterator is an integral type, then the member template constructor will have the same effect as:

    -
    -vector<static_cast<size_type>(f), static_cast<value_type>(l));
    +
    vector<static_cast<size_type>(f), static_cast<value_type>(l));
     

    (and similarly for the other member template functions of sequences).

    @@ -4628,8 +4013,7 @@ vector<static_cast<size_type>(f), static_cast<value_type>(l));

    This might look something like:

    -
    -template <class T>
    +
    template <class T>
     struct vector
     {
          typedef unsigned size_type;
    @@ -4671,8 +4055,7 @@ every call with the member template, detect the type of InputIterator,
     and then redirect to the correct logic.  Something like:
     

    -
    -template <class T>
    +
    template <class T>
     template <class I>
     vector<T>::vector(I f, I l)
     {
    @@ -4701,8 +4084,7 @@ vector<T>::choose_init(I f, I l, int2type<true>)
     
     

    Both of these solutions solve the case the standard specifically mentions:

    -
    -vector<int> v(10, 1);  // ok, vector size 10, initialized to 1
    +
    vector<int> v(10, 1);  // ok, vector size 10, initialized to 1
     

    @@ -4710,8 +4092,7 @@ However, (and here is the problem), the two solutions have different behavior in some cases where the value_type of the sequence is not an integral type. For example consider:

    -
    -     pair<char, char>                     p('a', 'b');
    +
         pair<char, char>                     p('a', 'b');
          vector<vector<pair<char, char> > >   d('a', 'b');
     

    @@ -4719,8 +4100,7 @@ The second line of this snippet is likely an error. Solution A catches the error and refuses to compile. The reason is that there is no specialization of the member template constructor that looks like:

    -
    -template <>
    +
    template <>
     template <>
     vector<vector<pair<char, char> > >::vector(char, char) { ... }
     
    @@ -4737,8 +4117,7 @@ unsigned integral type and used to size the outer vector. 'b' is static casted to the inner vector using it's explicit constructor:

    -
    -explicit vector(size_type n);
    +
    explicit vector(size_type n);
     

    @@ -4755,8 +4134,7 @@ explicit qualifier on the inner vector has been thwarted at any rate. The standard is not clear whether the expression:

    -
    -     vector<vector<pair<char, char> > >   d('a', 'b');
    +
         vector<vector<pair<char, char> > >   d('a', 'b');
     

    @@ -4791,8 +4169,7 @@ the expression above would be to change "static_cast" in paragraphs

    -
    -template <class T, class U>
    +
    template <class T, class U>
     inline
     T implicit_cast(const U& u)
     {
    @@ -4803,32 +4180,29 @@ T implicit_cast(const U& u)
     
     

    Proposed resolution:

    -Replace 23.1.1 [lib.sequence.reqmts] paragraphs 9 - 11 with: +Replace 23.1.1 [lib.sequence.reqmts] paragraphs 9 - 11 with:

    For every sequence defined in this clause and in clause lib.strings:

    • If the constructor

      -
      -       template <class InputIterator>
      +       
             template <class InputIterator>
              X(InputIterator f, InputIterator l,
                const allocator_type& a = allocator_type())
              

      is called with a type InputIterator that does not qualify as an input iterator, then the constructor will behave as if the overloaded constructor:

      -
      -       X(size_type, const value_type& = value_type(),
      +       
             X(size_type, const value_type& = value_type(),
                const allocator_type& = allocator_type())
              
      -

      were called instead, with the arguments f, l and a, respectively.

      +

      were called instead, with the arguments static_cast<size_type>(f), l and a, respectively.

    • If the member functions of the forms:

      -
      -       template <class InputIterator>          //  such as  insert()
      +       
             template <class InputIterator>          //  such as  insert()
              rt fx1(iterator p, InputIterator f, InputIterator l);
       
              template <class InputIterator>          //  such as  append(), assign()
      @@ -4840,8 +4214,7 @@ Replace 23.1.1  [lib.sequence.
           

      are called with a type InputIterator that does not qualify as an input iterator, then these functions will behave as if the overloaded member functions:

      -
      -       rt fx1(iterator, size_type, const value_type&);
      +       
             rt fx1(iterator, size_type, const value_type&);
       
              rt fx2(size_type, const value_type&);
       
      @@ -4881,11 +4254,15 @@ Howard submitted new wording, and we will review this again in
       Redmond.
       ]

      +

      [Redmond: one very small change in wording: the first argument + is cast to size_t. This fixes the problem of something like + vector<vector<int> >(5, 5), where int is not + implicitly convertible to the value type.]

      +

      Rationale:

      The proposed resolution fixes:

      -
      -  vector<int> v(10, 1);
      +
        vector<int> v(10, 1);
       

      @@ -4895,8 +4272,7 @@ if).

      The proposed resolution breaks:

      -
      -  vector<vector<T> > v(10, 1);
      +
        vector<vector<T> > v(10, 1);
       

      @@ -4908,8 +4284,7 @@ The proposed resolution leaves the behavior of the following code unspecified.

      -
      -  struct A
      +
        struct A
         {
           operator int () const {return 10;}
         };
      @@ -4930,45 +4305,10 @@ then the implementation must reject the constructor as A is no longer
       implicitly convertible to B.
       


      -

      441. Is fpos::state const?

      Section: 27.4.3 [lib.fpos]  Status: Ready  Submitter: Vincent Leloup  Date: 17 Nov 2003

      -

      -In section 27.4.3.1 [lib.fpos.members] fpos<stateT>::state() is declared -non const, but in section 27.4.3 [lib.fpos] it is declared const. -

      -

      Proposed resolution:

      -

      -In section 27.4.3.1 [lib.fpos.members], change the declaration of -fpos<stateT>::state() to const. -

      -
      -

      442. sentry::operator bool() inconsistent signature

      Section: 27.6.2.3 [lib.ostream::sentry]  Status: Ready  Submitter: Vincent Leloup  Date: 18 Nov 2003

      -

      -In section 27.6.2.3 [lib.ostream::sentry] paragraph 4, in description part -basic_ostream<charT, traits>::sentry::operator bool() is declared -as non const, but in section 27.6.2.3, in synopsis it is declared -const. -

      -

      Proposed resolution:

      -

      -In section 27.6.2.3 [lib.ostream::sentry] paragraph 4, change the declaration -of sentry::operator bool() to const. -

      -
      -

      443. filebuf::close() inconsistent use of EOF

      Section: 27.8.1.3 [lib.filebuf.members]  Status: Ready  Submitter: Vincent Leloup  Date: 20 Nov 2003

      -

      -In section 27.8.1.3 [lib.filebuf.members] par6, in effects description of -basic_filebuf<charT, traits>::close(), overflow(EOF) is used twice; -should be overflow(traits::eof()). -

      -

      Proposed resolution:

      -

      -Change overflow(EOF) to overflow(traits::eof()). -

      -
      -

      444. Bad use of casts in fstream

      Section: 27.8.1 [lib.fstreams]  Status: Review  Submitter: Vincent Leloup  Date: 20 Nov 2003

      +

      444. Bad use of casts in fstream

      Section: 27.8.1 [lib.fstreams]  Status: Ready  Submitter: Vincent Leloup  Date: 20 Nov 2003

      -27.8.1.7 [lib.ifstream.members] p1, 27.8.1.10 [lib.ofstream.members] p1, 27.8.1.13 [lib.fstream.members] p1 seems have same problem as exposed in LWG issue -252. +27.8.1.7 [lib.ifstream.members] p1, 27.8.1.10 [lib.ofstream.members] p1, 27.8.1.13 [lib.fstream.members] p1 seems have same problem as exposed in LWG issue +252.

      Proposed resolution:

      @@ -5010,7 +4350,7 @@ Change overflow(EOF) to overflow(traits::eof()).
      -

      445. iterator_traits::reference unspecified for some iterator categories

      Section: 24.3.1 [lib.iterator.traits]  Status: Review  Submitter: Dave Abrahams  Date: 9 Dec 2003

      +

      445. iterator_traits::reference unspecified for some iterator categories

      Section: 24.3.1 [lib.iterator.traits]  Status: Ready  Submitter: Dave Abrahams  Date: 9 Dec 2003

      The standard places no restrictions at all on the reference type of input, output, or forward iterators (for forward iterators it @@ -5103,19 +4443,18 @@ so I've changed the wording to say that those types may be

      Proposed resolution:

      -

      In 24.3.1.1, after:

      +

      In 24.3.1 [lib.iterator.traits], after:

      be defined as the iterator's difference type, value type and iterator category, respectively.
      -

      In 24.3.1.1, add:

      +

      add

      In addition, the types -
      -iterator_traits<Iterator>::reference
      +
      iterator_traits<Iterator>::reference
       iterator_traits<Iterator>::pointer
       
      must be defined as the iterator's reference and pointer types, that @@ -5123,12 +4462,11 @@ is, the same type as the type of *a and a->, respectively.
      -

      In 24.3.1.1, change:

      +

      In 24.3.1 [lib.iterator.traits], change:

      In the case of an output iterator, the types -
      -iterator_traits<Iterator>::difference_type
      +
      iterator_traits<Iterator>::difference_type
       iterator_traits<Iterator>::value_type
       
      are both defined as void. @@ -5137,8 +4475,7 @@ are both defined as void.

      to:

      In the case of an output iterator, the types -
      -iterator_traits<Iterator>::difference_type
      +
      iterator_traits<Iterator>::difference_type
       iterator_traits<Iterator>::value_type
       iterator_traits<Iterator>::reference
       iterator_traits<Iterator>::pointer
      @@ -5146,36 +4483,26 @@ iterator_traits<Iterator>::pointer
       may be defined as void.
       
      -

      In 24.5.6, change:

      +

      In 24.5.3 [lib.istreambuf.iterator], change:

      -
      -typename traits::off_type, charT*, charT&>
      +
      typename traits::off_type, charT*, charT&>
       

      to:

      -
      -typename traits::off_type, charT*, charT>
      +
      typename traits::off_type, charT*, charT>
       

      [ -Sydney: Agreed that this is under-specified, but it's not the only -place where iterators are under-specified. We may need a more complete -review. One nice simple rule that would solve this problem: *a is -always reference by definition, and a-> is -always pointer by definition. If we do that, then we'll also -have to change a few existing iterators (e.g. istreambuf_iterator) so -they conform to that rule. We need a review of how extensive those -changes would be. Or instead of fixing pointer we could -remove it. (Which would require changing reverse_iterator as part of -that change, since the present reverse_iterator relies on the -existence of pointer.) Jeremy will supply a more detailed -analysis for Redmond. +Redmond: there was concern in Sydney that this might not be the only place +where things were underspecified and needed to be changed. Jeremy +reviewed iterators in the standard and confirmed that nothing else +needed to be changed. ]


      -

      446. Iterator equality between different containers

      Section: 24.1 [lib.iterator.requirements], 23.1 [lib.container.requirements]  Status: Open  Submitter: Andy Koenig  Date: 16 Dec 2003

      +

      446. Iterator equality between different containers

      Section: 24.1 [lib.iterator.requirements], 23.1 [lib.container.requirements]  Status: Open  Submitter: Andy Koenig  Date: 16 Dec 2003

      What requirements does the standard place on equality comparisons between iterators that refer to elements of different containers. For example, if @@ -5199,77 +4526,8 @@ reachability. ]


      -

      448. Random Access Iterators over abstract classes

      Section: 24.1.5 [lib.random.access.iterators]  Status: Ready  Submitter: Dave Abrahams  Date: 7 Jan 2004

      -

      -Table 76, the random access iterator requirement table, says that the -return type of a[n] must be "convertible to T". When an iterator's -value_type T is an abstract class, nothing is convertible to T. -Surely this isn't an intended restriction? -

      -

      Proposed resolution:

      -

      -Change the return type to "convertible to T const&". -

      -
      -

      449. Library Issue 306 Goes Too Far

      Section: 18.1 [lib.support.types]  Status: Ready  Submitter: Pete Becker  Date: 15 Jan 2004

      -

      Original text:

      -
      -The macro offsetof accepts a restricted set of type arguments in this -International Standard. type shall be a POD structure or a POD union -(clause 9). The result of applying the offsetof macro to a field that -is a static data member or a function member is undefined." -
      - -

      Revised text:

      -
      -"If type is not a POD structure or a POD union the results are undefined." -
      - -

      -Looks to me like the revised text should have replaced only the second -sentence. It doesn't make sense standing alone. -

      - -

      Proposed resolution:

      -

      Change 18.1, paragraph 5, to:

      - -
      -The macro offsetof accepts a restricted set of type arguments in this -International Standard. If type is not a POD structure or a POD union -the results are undefined. The result of applying the offsetof macro -to a field that is a static data member or a function member is -undefined." -
      -
      -

      452.  locale::combine should be permitted to generate a named locale

      Section: 22.1.1.3 [lib.locale.members]  Status: Open  Submitter: Bill Plauger  Date: 30 Jan 2004

      -
      -template<class Facet>
      -	locale::combine(const locale&) const;
      -
      -

      -is obliged to create a locale that has no name. This is overspecification -and overkill. The resulting locale should follow the usual rules -- it -has a name if the locale argument has a name and Facet is one of the -standard facets. -

      - -

      [ - Sydney and post-Sydney (see c++std-lib-13439, c++std-lib-13440, - c++std-lib-13443): agreed that it's overkill to say that the locale - is obligated to be nameless. However, we also can't require it to - have a name. At the moment, locale names are based on categories - and not on individual facets. If a locale contains two different - facets of different names from the same category, then this would - not fit into existing naming schemes. We need to give - implementations more freedom. Bill will provide wording. -]

      - -

      Proposed resolution:

      -

      Rationale:

      -
      -

      453. basic_stringbuf::seekoff need not always fail for an empty stream

      Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: Open  Submitter: Bill Plauger  Date: 30 Jan 2004

      -
      -  pos_type basic_stringbuf::seekoff(off_type, ios_base::seekdir,
      +

      453. basic_stringbuf::seekoff need not always fail for an empty stream

      Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: Ready  Submitter: Bill Plauger  Date: 30 Jan 2004

      +
        pos_type basic_stringbuf::seekoff(off_type, ios_base::seekdir,
                                           ios_base::openmode);
       

      @@ -5283,16 +4541,28 @@ an effective offset of zero.

      ]

      Proposed resolution:

      +

      Change the sentence from:

      +
      +For a sequence to be positioned, if its next pointer (either +gptr() or pptr()) is a null pointer, the positioning operation +fails. +
      + +

      to:

      + +
      +For a sequence to be positioned, if its next pointer (either +gptr() or pptr()) is a null pointer and the new offset newoff +is nonzero, the positioning operation fails. +

      -

      454. basic_filebuf::open should accept wchar_t names

      Section: 27.8.1.3 [lib.filebuf.members]  Status: Open  Submitter: Bill Plauger  Date: 30 Jan 2004

      -
      -    basic_filebuf *basic_filebuf::open(const char *, ios_base::open_mode);
      +

      454. basic_filebuf::open should accept wchar_t names

      Section: 27.8.1.3 [lib.filebuf.members]  Status: Ready  Submitter: Bill Plauger  Date: 30 Jan 2004

      +
          basic_filebuf *basic_filebuf::open(const char *, ios_base::open_mode);
       

      should be supplemented with the overload:

      -
      -    basic_filebuf *basic_filebuf::open(const wchar_t *, ios_base::open_mode);
      +
          basic_filebuf *basic_filebuf::open(const wchar_t *, ios_base::open_mode);
       

      @@ -5305,8 +4575,60 @@ actual filename. provide wording.]

      Proposed resolution:

      + +

      Change from:

      +
      +
      basic_filebuf<charT,traits>* open(
      +	const char* s,
      +	ios_base::openmode mode );
      +
      + +

      +Effects: If is_open() != false, returns a null pointer. +Otherwise, initializes the filebuf as required. It then +opens a file, if possible, whose name is the NTBS s ("as if" +by calling std::fopen(s,modstr)).

      +
      + +

      to:

      + +
      +
      basic_filebuf<charT,traits>* open(
      +	const char* s,
      +	ios_base::openmode mode );
      +
      +basic_filebuf<charT,traits>* open(
      +	const wchar_t* ws,
      +	ios_base::openmode mode );
      +
      + +

      +Effects: If is_open() != false, returns a null pointer. +Otherwise, initializes the filebuf as required. It then +opens a file, if possible, whose name is the NTBS s ("as if" +by calling std::fopen(s,modstr)). +For the second signature, the NTBS s is determined from the +WCBS ws in an implementation-defined manner. +

      + +

      +(NOTE: For a system that "naturally" represents a filename +as a WCBS, the NTBS s in the first signature may instead +be mapped to a WCBS; if so, it follows the same mapping +rules as the first argument to open.) +

      +
      + +

      Rationale:

      +

      +Slightly controversial, but by a 7-1 straw poll the LWG agreed to move +this to Ready. The controversy was because the mapping between wide +names and files in a filesystem is implementation defined. The +counterargument, which most but not all LWG members accepted, is that +the mapping between narrow files names and files is also +implemenation defined.


      -

      455. cerr::tie() and wcerr::tie() are overspecified

      Section: 27.3 [lib.iostream.objects]  Status: Open  Submitter: Bill Plauger  Date: 30 Jan 2004

      +

      455. cerr::tie() and wcerr::tie() are overspecified

      Section: 27.3 [lib.iostream.objects]  Status: Ready  Submitter: Bill Plauger  Date: 30 Jan 2004

      Both cerr::tie() and wcerr::tie() are obliged to be null at program startup. This is overspecification and overkill. It is both traditional @@ -5315,11 +4637,27 @@ whenever an error message is written. This behavior should at least be permitted if not required. Same for wcerr::tie().

      Proposed resolution:

      + +

      Add to the description of cerr:

      +
      +After the object cerr is initialized, cerr.tie() returns &cout. +Its state is otherwise the same as required for basic_ios<char>::init +(lib.basic.ios.cons). +
      + +

      Add to the description of wcerr:

      + +
      +After the object wcerr is initialized, wcerr.tie() returns &wcout. +Its state is otherwise the same as required for basic_ios<wchar_t>::init +(lib.basic.ios.cons). +
      +

      [Sydney: straw poll (3-1): we should require, not just - permit, cout and cerr to be tied on startup. Bill will provide - wording.]

      + permit, cout and cerr to be tied on startup. Pre-Redmond: Bill will + provide wording.]


      -

      456. Traditional C header files are overspecified

      Section: 17.4.1.2 [lib.headers]  Status: Open  Submitter: Bill Plauger  Date: 30 Jan 2004

      +

      456. Traditional C header files are overspecified

      Section: 17.4.1.2 [lib.headers]  Status: Open  Submitter: Bill Plauger  Date: 30 Jan 2004

      The C++ Standard effectively requires that the traditional C headers (of the form <xxx.h>) be defined in terms of the newer C++ @@ -5403,7 +4741,7 @@ declaring C names in headers.

      Proposed resolution:


      -

      457. bitset constructor: incorrect number of initialized bits

      Section: 23.3.5.1 [lib.bitset.cons]  Status: Review  Submitter: Dag Henriksson  Date: 30 Jan 2004

      +

      457. bitset constructor: incorrect number of initialized bits

      Section: 23.3.5.1 [lib.bitset.cons]  Status: Ready  Submitter: Dag Henriksson  Date: 30 Jan 2004

      The constructor from unsigned long says it initializes "the first M bit positions to the corresponding bit values in val. M is the smaller @@ -5417,14 +4755,14 @@ uses to hold the value. Thus, the first M bit position above is not guaranteed to have any corresponding bit values in val.

      Proposed resolution:

      -

      In 23.3.5.1 [lib.bitset.cons] paragraph 2, change "M is the smaller of +

      In 23.3.5.1 [lib.bitset.cons] paragraph 2, change "M is the smaller of N and the value CHAR_BIT * sizeof (unsigned long). (249)" to "M is the smaller of N and the number of bits in - the value representation (section 3.9 [basic.types]) of unsigned + the value representation (section 3.9 [basic.types]) of unsigned long."


      -

      458. 24.1.5 contains unintented limitation for operator-

      Section: 24.1.5 [lib.random.access.iterators]  Status: Open  Submitter: Daniel Frey  Date: 27 Feb 2004

      +

      458. 24.1.5 contains unintented limitation for operator-

      Section: 24.1.5 [lib.random.access.iterators]  Status: Open  Submitter: Daniel Frey  Date: 27 Feb 2004

      In 24.1.5 [lib.random.access.iterators], table 76 the operational semantics for the expression "r -= n" are defined as "return r += -n". @@ -5453,7 +4791,7 @@ operational semantics for this column to:


      -

      459. Requirement for widening in stage 2 is overspecification

      Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: Open  Submitter: Martin Sebor  Date: 16 Mar 2004

      +

      459. Requirement for widening in stage 2 is overspecification

      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. @@ -5471,8 +4809,7 @@ widen() allows, i.e. without making a virtual call to do_narrow every time, is as follows:

      -
      -  inline char ctype<wchar_t>::narrow (wchar_t wc, char dflt) const
      +
        inline char ctype<wchar_t>::narrow (wchar_t wc, char dflt) const
         {
             const unsigned wi = unsigned (wc);
       
      @@ -5498,11 +4835,11 @@ drastic. Existing implementations with the exception of libstdc++
       currently already use narrow() so the impact of the change on programs
       would presumably be isolated to just a single implementation. Further,
       since narrow() is not required to translate alternate wide digit
      -representations such as those mentioned in issue 303 to
      +representations such as those mentioned in issue 303 to
       their narrow equivalents (i.e., the portable source characters '0'
       through '9'), the change does not necessarily imply that these
       alternate digits would be treated as ordinary digits and accepted as
      -part of numbers during parsing. In fact, the requirement in 22.2.1.1.2  [lib.locale.ctype.virtuals], p13 forbids narrow() to translate an alternate
      +part of numbers during parsing. In fact, the requirement in 22.2.1.1.2  [lib.locale.ctype.virtuals], p13 forbids narrow() to translate an alternate
       digit character, wc, to an ordinary digit in the basic source
       character set unless the expression
       (ctype<charT>::is(ctype_base::digit, wc) == true) holds. This in
      @@ -5531,7 +4868,7 @@ technique to perform the comparison:

      if it the source and destination types are the same

    • -

      460. Default modes missing from basic_fstream member specifications

      Section: 27.8.1 [lib.fstreams]  Status: New  Submitter: Ben Hutchings  Date: 1 Apr 2004

      +

      460. Default modes missing from basic_fstream member specifications

      Section: 27.8.1 [lib.fstreams]  Status: Ready  Submitter: Ben Hutchings  Date: 1 Apr 2004

      The second parameters of the non-default constructor and of the open member function for basic_fstream, named "mode", are optional @@ -5542,10 +4879,21 @@ constructor declaration has the "explicit" function-specifier implying that it is intended to be callable with one argument.

      Proposed resolution:

      -

      -

      +

      In 27.8.1.12 [lib.fstream.cons], change

      +
        explicit basic_fstream(const char* s, ios_base::openmode mode); 
      +
      +

      to

      +
        explicit basic_fstream(const char* s,
      +                         ios_base::openmode mode = ios_base::in|ios_base::out);
      +
      +

      In 27.8.1.13 [lib.fstream.members], change

      +
        void open(const char*s, ios_base::openmode mode); 
      +
      +

      to

      + void open(const char*s, + ios_base::openmode mode = ios_base::in|ios_base::out);
      -

      461. time_get hard or impossible to implement

      Section: 22.2.5.1 [lib.locale.time.get]  Status: New  Submitter: Bill Plauger  Date: 23 Mar 2004

      +

      461. time_get hard or impossible to implement

      Section: 22.2.5.1.2 [lib.locale.time.get.virtuals]  Status: Review  Submitter: Bill Plauger  Date: 23 Mar 2004

      Template time_get currently contains difficult, if not impossible, requirements for do_date_order, do_get_time, and do_get_date. All require @@ -5580,10 +4928,59 @@ and maximum latitude, we can permit an implementation to parse whatever %x or %X generates, but we shouldn't require it.

      Proposed resolution:

      + +

      In the description:

      +
      iter_type do_get_time(iter_type s, iter_type end, ios_base& str,
      +        ios_base::iostate& err, tm* t) const;
      +
      + +

      +2 Effects: Reads characters starting at suntil it has extracted those +struct tm members, and remaining format characters, used by +time_put<>::put to produce the format specified by 'X', or until it +encounters an error or end of sequence. +

      + +

      change: 'X'

      + +

      to: "%H:%M:%S"

      + + +

      In the description:

      +
      iter_type do_get_date(iter_type s, iter_type end, ios_base& str,
      +        ios_base::iostate& err, tm* t) const;
      +
      +

      +4 Effects: Reads characters starting at suntil it has extracted those +struct tm members, and remaining format characters, used by +time_put<>::put to produce the format specified by 'x', or until it +encounters an error. +

      +

      +change: used by time_put<>::put to produce the format +specified by 'x', or until it encounters an error.

      + +

      to: used by time_put<>:: put to produce one of the +following formats, or until it encounters an error. The format depends +on the value returned by date_order() as follows: +

      +
              date_order()  format
      +
      +        no_order      "%m/%d/%y"
      +        dmy           "%d/%m/%y"
      +        mdy           "%m/%d/%y"
      +        ymd           "%y/%m/%d"
      +        ydm           "%y/%d/%m"
      +
      + +

      [Redmond: agreed that this is a real problem. The solution is + probably to match C99's parsing rules. Bill provided wording. +]

      +
      -

      462. Destroying objects with static storage duration

      Section: 3.6.3 [basic.start.term], 18.3 [lib.support.start.term]  Status: New  Submitter: Bill Plauger  Date: 23 Mar 2004

      +

      462. Destroying objects with static storage duration

      Section: 3.6.3 [basic.start.term], 18.3 [lib.support.start.term]  Status: Open  Submitter: Bill Plauger  Date: 23 Mar 2004

      3.6.3 Termination spells out in detail the interleaving of static destructor calls and calls to functions registered with atexit. To @@ -5606,13 +5003,21 @@ suites. At the very least, we should permit deferred destruction even if we don't require it.

      Proposed resolution:

      + +

      [If this is to be changed, it should probably be changed by CWG. + At this point, however, the LWG is leaning toward NAD. Implementing + what the standard says is hard work, but it's not impossible and + most vendors went through that pain years ago. Changing this + behavior would be a user-visible change, and would break at least + one real application.]

      +


      -

      463. auto_ptr usability issues

      Section: 20.4.5 [lib.auto.ptr]  Status: New  Submitter: Rani Sharoni  Date: 7 Dec 2003

      +

      463. auto_ptr usability issues

      Section: 20.4.5 [lib.auto.ptr]  Status: Open  Submitter: Rani Sharoni  Date: 7 Dec 2003

      -TC1 CWG DR #84 effectively made the template%lt;class Y> operator auto_ptr%lt;Y>() +TC1 CWG DR #84 effectively made the template<class Y> operator auto_ptr<Y>() member of auto_ptr (20.4.5.3/4) obsolete.

      @@ -5621,15 +5026,14 @@ The sole purpose of this obsolete conversion member is to enable copy initialization base from r-value derived (or any convertible types like cv-types) case:

      -
      -#include %lt;memory>
      +
      #include <memory>
       using std::auto_ptr;
       
       struct B {};
       struct D : B {};
       
      -auto_ptr%lt;D> source();
      -int sink(auto_ptr%lt;B>);
      +auto_ptr<D> source();
      +int sink(auto_ptr<B>);
       int x1 = sink( source() ); // #1 EDG - no suitable copy constructor
       
      @@ -5652,14 +5056,13 @@ conversions and in fact current compilers conform to DR #84. I was surprised to discover that the obsolete conversion member actually has negative impact of the copy initialization base from l-value derived case:

      -
      -auto_ptr%lt;D> dp;
      +
      auto_ptr<D> dp;
       int x2 = sink(dp); // #2 EDG - more than one user-defined conversion applies
       

      I'm sure that the original intention was allowing this initialization using -the template%lt;class Y> auto_ptr(auto_ptr%lt;Y>& a) constructor (20.4.5.1/4) but +the template<class Y> auto_ptr(auto_ptr<Y>& a) constructor (20.4.5.1/4) but since in this copy initialization it's merely user defined conversion (UDC) and the obsolete conversion member is UDC with the same rank (for the early overloading stage) there is an ambiguity between them. @@ -5669,16 +5072,14 @@ overloading stage) there is an ambiguity between them. Removing the obsolete member will have impact on code that explicitly invokes it:

      -
      -int y = sink(source().operator auto_ptr%lt;B>());
      +
      int y = sink(source().operator auto_ptr<B>());
       

      IMHO no one ever wrote such awkward code and the reasonable workaround for #1 is:

      -
      -int y = sink( auto_ptr%lt;B>(source()) );
      +
      int y = sink( auto_ptr<B>(source()) );
       

      @@ -5698,9 +5099,8 @@ no candidates.

      I also found exception safety issue with auto_ptr related to auto_ptr_ref:

      -
      -int f(auto_ptr%lt;B>, std::string);
      -auto_ptr%lt;B> source2();
      +
      int f(auto_ptr<B>, std::string);
      +auto_ptr<B> source2();
       
       // string constructor throws while auto_ptr_ref
       // "holds" the pointer
      @@ -5711,18 +5111,18 @@ int x4 = f(source2(), "xyz"); // #4
       The theoretic execution sequence that will cause a leak:
       

        -
      1. call auto_ptr%lt;B>::operator auto_ptr_ref%lt;B>()
      2. +
      3. call auto_ptr<B>::operator auto_ptr_ref<B>()
      4. call string::string(char const*) and throw

      According to 20.4.5.3/3 and 20.4.5/2 the auto_ptr_ref conversion member -returns auto_ptr_ref%lt;Y> that holds *this and this is another defect since -the type of *this is auto_ptr%lt;X> where X might be different from Y. Several -library vendors (e.g. SGI) implement auto_ptr_ref%lt;Y> with Y* as member which +returns auto_ptr_ref<Y> that holds *this and this is another defect since +the type of *this is auto_ptr<X> where X might be different from Y. Several +library vendors (e.g. SGI) implement auto_ptr_ref<Y> with Y* as member which is much more reasonable. Other vendor implemented auto_ptr_ref as defectively required and it results with awkward and catastrophic code: -int oops = sink(auto_ptr%lt;B>(source())); // warning recursive on all control +int oops = sink(auto_ptr<B>(source())); // warning recursive on all control paths

      @@ -5741,7 +5141,7 @@ constructor template with sole propose to generate ill-formed, diagnostic required, instance for const auto_ptr arguments during instantiation of declaration. This special constructor will not be instantiated for other types which is achievable using 14.8.2/2 (SFINAE). Having this constructor -in hand makes the constructor template%lt;class Y> auto_ptr(auto_ptr%lt;Y> const&) +in hand makes the constructor template<class Y> auto_ptr(auto_ptr<Y> const&) legitimate since the actual argument can't be const yet non const r-value are acceptable.

      @@ -5756,18 +5156,17 @@ that involve const auto_ptr arguments.

      The proposed auto_ptr interface:

      -
      -namespace std {
      -    template%lt;class X> class auto_ptr {
      +
      namespace std {
      +    template<class X> class auto_ptr {
           public:
               typedef X element_type;
       
               // 20.4.5.1 construct/copy/destroy:
               explicit auto_ptr(X* p=0) throw();
               auto_ptr(auto_ptr&) throw();
      -        template%lt;class Y> auto_ptr(auto_ptr%lt;Y> const&) throw();
      +        template<class Y> auto_ptr(auto_ptr<Y> const&) throw();
               auto_ptr& operator=(auto_ptr&) throw();
      -        template%lt;class Y> auto_ptr& operator=(auto_ptr%lt;Y>) throw();
      +        template<class Y> auto_ptr& operator=(auto_ptr<Y>) throw();
               ~auto_ptr() throw();
       
               // 20.4.5.2 members:
      @@ -5778,9 +5177,9 @@ namespace std {
               void reset(X* p=0) throw();
       
           private:
      -        template%lt;class U>
      +        template<class U>
               auto_ptr(U& rhs, typename
      -unspecified_error_on_const_auto_ptr%lt;U>::type = 0);
      +unspecified_error_on_const_auto_ptr<U>::type = 0);
           };
       }
       
      @@ -5790,12 +5189,11 @@ One compliant technique to implement the unspecified_error_on_const_auto_ptr helper class is using additional private auto_ptr member class template like the following:

      -
      -template%lt;typename T> struct unspecified_error_on_const_auto_ptr;
      +
      template<typename T> struct unspecified_error_on_const_auto_ptr;
       
      -template%lt;typename T>
      -struct unspecified_error_on_const_auto_ptr%lt;auto_ptr%lt;T> const>
      -{ typedef typename auto_ptr%lt;T>::const_auto_ptr_is_not_allowed type; };
      +template<typename T>
      +struct unspecified_error_on_const_auto_ptr<auto_ptr<T> const>
      +{ typedef typename auto_ptr<T>::const_auto_ptr_is_not_allowed type; };
       

      @@ -5811,19 +5209,18 @@ verifying this with core language experts.

      Remove section 20.4.5.3

      Change 20.4.5/2 to read something like: -Initializing auto_ptr%lt;X> from const auto_ptr%lt;Y> will result with unspecified +Initializing auto_ptr<X> from const auto_ptr<Y> will result with unspecified ill-formed declaration that will require unspecified diagnostic.

      Change 20.4.5.1/4,5,6 to read:

      -
      template%lt;class Y> auto_ptr(auto_ptr%lt;Y> const& a) throw();
      +
      template<class Y> auto_ptr(auto_ptr<Y> const& a) throw();

      4 Requires: Y* can be implicitly converted to X*.

      -

      5 Effects: Calls const_cast%lt;auto_ptr%lt;Y>&>(a).release().

      +

      5 Effects: Calls const_cast<auto_ptr<Y>&>(a).release().

      6 Postconditions: *this holds the pointer returned from a.release().

      Change 20.4.5.1/10

      -
      -template%lt;class Y> auto_ptr& operator=(auto_ptr%lt;Y> a) throw();
      +
      template<class Y> auto_ptr& operator=(auto_ptr<Y> a) throw();
       

      10 Requires: Y* can be implicitly converted to X*. The expression delete @@ -5838,11 +5235,10 @@ as before and accept non-const auto_ptr& since they have effect on the form of the implicitly declared copy constructor and copy assignment operator of class that contains auto_ptr as member per 12.8/5,10:

      -
      -struct X {
      +
      struct X {
           // implicit X(X&)
           // implicit X& operator=(X&)
      -    auto_ptr%lt;D> aptr_;
      +    auto_ptr<D> aptr_;
       };
       
      @@ -5854,24 +5250,25 @@ current auto_ptr behavior.

      Dave Abrahams encouraged me to suggest fallback implementation in case that my suggestion that involves removing of auto_ptr_ref will not be accepted. -In this case removing the obsolete conversion member to auto_ptr%lt;Y> and +In this case removing the obsolete conversion member to auto_ptr<Y> and 20.4.5.3/4,5 is still required in order to eliminate ambiguity in legal cases. The two constructors that I suggested will co exist with the current members but will make auto_ptr_ref obsolete in initialization contexts. auto_ptr_ref will be effective in assignment contexts as suggested in DR #127 and I can't see any serious exception safety issues in those cases -(although it's possible to synthesize such). auto_ptr_ref%lt;X> semantics will +(although it's possible to synthesize such). auto_ptr_ref<X> semantics will have to be revised to say that it strictly holds pointer of type X and not -reference to an auto_ptr for the favor of cases in which auto_ptr_ref%lt;Y> is -constructed from auto_ptr%lt;X> in which X is different from Y (i.e. assignment +reference to an auto_ptr for the favor of cases in which auto_ptr_ref<Y> is +constructed from auto_ptr<X> in which X is different from Y (i.e. assignment from r-value derived to base).

      Proposed resolution:

      -

      -

      +

      [Redmond: punt for the moment. We haven't decided yet whether we + want to fix auto_ptr for C++-0x, or remove it and replace it with + move_ptr and unique_ptr.]


      -

      464. Suggestion for new member functions in standard containers

      Section: 23.2.4 [lib.vector], 23.3.1 [lib.map]  Status: New  Submitter: Thorsten Ottosen  Date: 12 May 2004

      +

      464. Suggestion for new member functions in standard containers

      Section: 23.2.4 [lib.vector], 23.3.1 [lib.map]  Status: Review  Submitter: Thorsten Ottosen  Date: 12 May 2004

      To add slightly more convenience to vector<T> and map<Key,T> we should consider to add

        @@ -5884,7 +5281,9 @@ semantics: if( empty() ) return 0; else return buffer_;

        Rationale:

          -
        • To obtain a pointer to the vector's buffer, one must use either operator[]() (which can give undefined behavior for empty vectors) or at() (which will then throw if the vector is empty).
        • +
        • To obtain a pointer to the vector's buffer, one must use either +operator[]() (which can give undefined behavior for empty vectors) or +at() (which will then throw if the vector is empty).
        • tr1::array<T,sz> already has a data() member
        • e cannot use operator[]() when T is not DefaultDonstructible
        • Neither when the map is const.
        • @@ -5893,14 +5292,54 @@ semantics: if( empty() ) return 0; else return buffer_;

        Proposed resolution:

        -

        -

        +

        In 23.2.4 [lib.vector], add the following to the vector + synopsis after "element access" and before "modifiers":

        +
          // [lib.vector.data] data access
        +  pointer       data();
        +  const_pointer data() const;
        +
        + +

        Add a new subsection of 23.2.4 [lib.vector]:

        +
        +

        23.2.4.x vector data access

        +
           pointer       data();
        +   const_pointer data() const;
        +
        +

        Returns: A pointer such that [data(), data() + size()) is a valid + range that contains the same elements as [begin(), end()).

        +

        Complexity: Constant time.

        +

        Throws: Nothing.

        +
        + +

        In 23.3.1 [lib.map], add the following to the map +synopsis immediately after the line for operator[]:

        +
          T&       at(const key_type& x);
        +  const T& at(const key_type& x) const;
        +
        + +

        Add the following to 23.3.1.2 [lib.map.access]:

        +
        +
          T&       at(const key_type& x);
        +  const T& at(const key_type& x) const;
        +
        + +

        Returns: A reference to the element whose key is equivalent + to x, if such an element is present in the map.

        +

        Throws: out_of_range if no such element is present.

        + +
        + +

        Rationale:

        +

        Neither of these additions provides any new functionality but the + LWG agreed that they are convenient, especially for novices. The + exception type chosen for at, std::out_of_range, + was chosen to match vector::at.


        -

        465. Contents of <ciso646>

        Section: 17.4.1.2 [lib.headers]  Status: New  Submitter: Steve Clamage  Date: 3 Jun 2004

        +

        465. Contents of <ciso646>

        Section: 17.4.1.2 [lib.headers]  Status: Review  Submitter: Steve Clamage  Date: 3 Jun 2004

        C header <iso646.h> defines macros for some operators, such as not_eq for !=.

        -

        Section 17.4.1.2 [lib.headers] "Headers" says that except as noted in +

        Section 17.4.1.2 [lib.headers] "Headers" says that except as noted in clauses 18 through 27, the <cname> C++ header contents are the same as the C header <name.h>. In particular, table 12 lists <ciso646> as a C++ header.

        @@ -5917,18 +5356,26 @@ of <iso646.h>.

        I don't find any normative text to support C.2.2.2.

        Proposed resolution:

        -

        -Add a section somewhere (clause 18? clause 22?) that says <iso646.h> and <ciso646> are empty for C++. -

        +

        Add to section 17.4.1.2 Headers [lib.headers] a new paragraph after + paragraph 6 (the one about functions must be functions):

        + +
        +

        Identifiers that are keywords or operators in C++ shall not be defined +as macros in C++ standard library headers. +[Footnote:In particular, including the standard header <iso646.h> +or <ciso646> has no effect.

        +
        + +

        [post-Redmond: Steve provided wording.]

        +
        -

        466. basic_string ctor should prevent null pointer error

        Section: 21.3.1 [lib.string.cons]  Status: New  Submitter: Daniel Frey  Date: 10 Jun 2004

        +

        466. basic_string ctor should prevent null pointer error

        Section: 21.3.1 [lib.string.cons]  Status: Open  Submitter: Daniel Frey  Date: 10 Jun 2004

        Today, my colleagues and me wasted a lot of time. After some time, I found the problem. It could be reduced to the following short example:

        -
        -  #include <string>
        +
          #include <string>
           int main() { std::string( 0 ); }
         
        @@ -5943,10 +5390,15 @@ argument. This would catch the above code at compile time and would not ambiguate any other legal ctors.

        Proposed resolution:

        -

        -

        +

        [Redmond: No great enthusiasm for doing this. If we do, + however, we want to do it for all places that take charT* + pointers, not just the single-argument constructor. The other + question is whether we want to catch this at compile time (in which + case we catch the error of a literal 0, but not an expression whose + value is a null pointer), at run time, or both.]

        +
        -

        467. char_traits::lt(), compare(), and memcmp()

        Section: 21.1.3.1 [lib.char.traits.specializations.char]  Status: New  Submitter: Martin Sebor  Date: 28 Jun 2004

        +

        467. char_traits::lt(), compare(), and memcmp()

        Section: 21.1.3.1 [lib.char.traits.specializations.char]  Status: Review  Submitter: Martin Sebor  Date: 28 Jun 2004

        Table 37 describes the requirements on Traits::compare() in terms of @@ -5969,28 +5421,31 @@ imposed by Table 37 on compare() when char is signed.

        Change 21.1.3.1, p6 from

        -
        +
        The two-argument members assign, eq, and lt are defined identically to the built-in operators =, ==, and < respectively. -
        +

    to

    -
    -    The two-argument members assign and eq are defined identically
    -    to the built-in operators = and == respectively. The two-argument
    -    member lt is defined identically to the built-in operator < for
    -    type unsigned char.
    -
    +
    + The two-argument member assign is defined identically to + the built-in operators = and == respectively. The two + argument members eq and lt are defined identically to + the built-in operators == and < for type unsigned char. +
    + +

    [Redmond: The LWG agreed with this general direction, but we + also need to change eq to be consistent with this change. + Post-Redmond: Martin provided wording.]


    -

    468. unexpected consequences of ios_base::operator void*()

    Section: 27.4.4.3 [lib.iostate.flags]  Status: New  Submitter: Martin Sebor  Date: 28 Jun 2004

    +

    468. unexpected consequences of ios_base::operator void*()

    Section: 27.4.4.3 [lib.iostate.flags]  Status: Review  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 std::cout or any object derived from basic_ios to void*.

    -
    -    #include <cassert>
    +
        #include <cassert>
         #include <iostream>
     
         int main ()
    @@ -6012,20 +5467,16 @@ the value need not be valid.
     

    Specifically, change in [lib.ios] the signature of

    -
    -    operator void*() const;
    +
        operator void*() const;
     

    to

    -
    -    operator unspecified_pointer_type () const;
    +
        operator unspecified_pointer_type () const;
     

    and change [lib.iostate.flags], p1 from

    -
    -    operator void*() const;
    +
        operator void*() const;
     

    to

    -
    -    operator unspecified_pointer_type() const;
    +
        operator unspecified_pointer_type() const;
         -1- Returns: If fail() then a null pointer; otherwise some
             non-null but not necessarily valid pointer to indicate
             success.
    @@ -6036,8 +5487,10 @@ the value need not be valid.
             Footnote 1: A pointer-to-member might be one such suitable type.
     
    +

    [Redmond: 5-4 straw poll in favor of doing this.]

    +
    -

    469. vector<bool> ill-formed relational operators

    Section: 23.2.5 [lib.vector.bool]  Status: New  Submitter: Martin Sebor  Date: 28 Jun 2004

    +

    469. vector<bool> ill-formed relational operators

    Section: 23.2.5 [lib.vector.bool]  Status: Ready  Submitter: Martin Sebor  Date: 28 Jun 2004

    The overloads of relational operators for vector<bool> specified @@ -6053,7 +5506,7 @@ Remove all overloads of overloads of relational operators for vector<bool> from [lib.vector.bool].


    -

    470. accessing containers from their elements' special functions

    Section: 23 [lib.containers]  Status: New  Submitter: Martin Sebor  Date: 28 Jun 2004

    +

    470. accessing containers from their elements' special functions

    Section: 23 [lib.containers]  Status: Open  Submitter: Martin Sebor  Date: 28 Jun 2004

    The standard doesn't prohibit the destructors (or any other special @@ -6071,8 +5524,7 @@ in some surprising (i.e., undefined) behavior.

    Add to Container Requirements the following new paragraph:

    -
    -    Unless otherwise specified, the behavior of a program that
    +
        Unless otherwise specified, the behavior of a program that
         invokes a container member function f from a member function
         g of the container's value_type on a container object c that
         called g from its mutating member function h, is undefined.
    @@ -6080,12 +5532,16 @@ in some surprising (i.e., undefined) behavior.
         c.h() from v.g() called from c.f(), is undefined.
     
    +

    [Redmond: This is a real issue, but it's probably a clause 17 + issue, not clause 23. We get the same issue, for example, if we + try to destroy a stream from one of the stream's callback functions.]

    + +
    -

    471. result of what() implementation-defined

    Section: 18.6.1 [lib.exception]  Status: New  Submitter: Martin Sebor  Date: 28 Jun 2004

    +

    471. result of what() implementation-defined

    Section: 18.6.1 [lib.exception]  Status: Open  Submitter: Martin Sebor  Date: 28 Jun 2004

    [lib.exception] specifies the following:

    -
    -    exception (const exception&) throw();
    +
        exception (const exception&) throw();
         exception& operator= (const exception&) throw();
     
         -4- Effects: Copies an exception object.
    @@ -6115,15 +5571,27 @@ then I believe the standard ought to be clarified to spell out
     exactly what the effects are on the copy (i.e., after the copy
     ctor was called).
     

    + +

    [Redmond: Yes, this is fuzzy. The issue of derived classes is + fuzzy too.]

    +

    Proposed resolution:


    -

    472. Missing "Returns" clause in std::equal_range

    Section: 25.3.3.3 [lib.equal.range]  Status: New  Submitter: Prateek R Karandikar  Date: 29 Feb 1900

    +

    472. Missing "Returns" clause in std::equal_range

    Section: 25.3.3.3 [lib.equal.range]  Status: Review  Submitter: Prateek R Karandikar  Date: 29 Feb 1900

    There is no "Returns:" clause for std::equal_range, which returns non-void.

    Proposed resolution:

    +

    In 25.3.3.3 [lib.equal.range], change

    +
    + Effects: Finds the largest subrange [i, j)... +
    +

    to

    +
    + Returns: The largest subrange [i, j)... +

    -

    473. underspecified ctype calls

    Section: 22.2.1.1 [lib.locale.ctype]  Status: New  Submitter: Martin Sebor  Date: 1 Jul 2004

    +

    473. underspecified ctype calls

    Section: 22.2.1.1 [lib.locale.ctype]  Status: New  Submitter: Martin Sebor  Date: 1 Jul 2004

    Most ctype member functions come in two forms: one that operates on a single character at a time and another form that operates @@ -6192,8 +5660,7 @@ Add two paragraphs immediately after 22.2.1.1 [lib.locale.ctype], p2, with the following text:

    -
    -  -3- Each ctype non-virtual member function that comes in two forms,
    +
      -3- Each ctype non-virtual member function that comes in two forms,
           one that takes a range of elements of char_type, and another
           that takes just a single element of char_type, is required to
           call the corresponding form of the virtual member function
    @@ -6219,7 +5686,7 @@ p2, with the following text:
     

    -

    474. confusing Footnote 297

    Section: 27.6.2.5.4 [lib.ostream.inserters.character]  Status: New  Submitter: Martin Sebor  Date: 1 Jul 2004

    +

    474. confusing Footnote 297

    Section: 27.6.2.5.4 [lib.ostream.inserters.character]  Status: New  Submitter: Martin Sebor  Date: 1 Jul 2004

    I think Footnote 297 is confused. The paragraph it applies to seems @@ -6232,7 +5699,7 @@ value of widen(c) is otherwise. I propose to strike the Footnote.


    -

    475. May the function object passed to for_each modify the elements of the iterated sequence?

    Section: 25.1.1 [lib.alg.foreach]  Status: New  Submitter: Stephan T. Lavavej, Jaakko Jarvi  Date: 9 Jul 2004

    +

    475. May the function object passed to for_each modify the elements of the iterated sequence?

    Section: 25.1.1 [lib.alg.foreach]  Status: New  Submitter: Stephan T. Lavavej, Jaakko Jarvi  Date: 9 Jul 2004

    It is not clear whether the function object passed to for_each is allowed to modify the elements of the sequence being iterated over. @@ -6291,7 +5758,7 @@ We suggest that the standard be clarified to explicitly allow the function objec passed to for_each modify its argument.

    Proposed resolution:

    -

    Add the following sentence to the Effects in 25.1.1 [lib.alg.foreach]:

    +

    Add the following sentence to the Effects in 25.1.1 [lib.alg.foreach]:

    "f may apply non-constant functions through the dereferenced iterators @@ -6300,7 +5767,7 @@ of a mutable iterator (24.1)."

    -

    476. Forward Iterator implied mutability

    Section: 24.1.3 [lib.forward.iterators]  Status: New  Submitter: Dave Abrahams  Date: 9 Jul 2004

    +

    476. Forward Iterator implied mutability

    Section: 24.1.3 [lib.forward.iterators]  Status: New  Submitter: Dave Abrahams  Date: 9 Jul 2004

    24.1/3 says:

    @@ -6329,12 +5796,11 @@ relationship between forward iterator and output iterator. requirements.

    -

    477. Operator-> for const forward iterators

    Section: 24.1.3 [lib.forward.iterators]  Status: New  Submitter: Dave Abrahams  Date: 11 Jul 2004

    +

    477. Operator-> for const forward iterators

    Section: 24.1.3 [lib.forward.iterators]  Status: New  Submitter: Dave Abrahams  Date: 11 Jul 2004

    The Forward Iterator requirements table contains the following:

    -
    - expression  return type         operational  precondition
    +
     expression  return type         operational  precondition
                                       semantics
       ==========  ==================  ===========  ==========================
       a->m        U& if X is mutable, (*a).m       pre: (*a).m is well-defined.
    @@ -6360,15 +5826,14 @@ of referenced members.  But Paragraph 11 of [lib.iterator.requirements] says:
     

    AFAICT if we need the second line at all, it should read the same as the first line.

    -

    Related issue: 478

    +

    Related issue: 478

    Proposed resolution:


    -

    478. Should forward iterator requirements table have a line for r->m?

    Section: 24.1.3 [lib.forward.iterators]  Status: New  Submitter: Dave Abrahams  Date: 11 Jul 2004

    +

    478. Should forward iterator requirements table have a line for r->m?

    Section: 24.1.3 [lib.forward.iterators]  Status: New  Submitter: Dave Abrahams  Date: 11 Jul 2004

    The Forward Iterator requirements table contains the following:

    -
    - expression  return type         operational  precondition
    +
     expression  return type         operational  precondition
                                       semantics
       ==========  ==================  ===========  ==========================
       a->m        U& if X is mutable, (*a).m       pre: (*a).m is well-defined.
    @@ -6408,8 +5873,312 @@ answer is to change
     
     

    in paragraph 11 of [lib.iterator.requirements].

    -

    Related issue: 477

    +

    Related issue: 477

    Proposed resolution:

    +
    +

    479. Container requirements and placement new

    Section: 23.1 [lib.container.requirements]  Status: New  Submitter: Herb Sutter  Date: 1 Aug 2004

    +

    Nothing in the standard appears to make this program ill-formed:

    + +
      struct C {
    +    void* operator new( size_t s ) { return ::operator new( s ); }
    +    // NOTE: this hides in-place and nothrow new
    +  };
    +
    +  int main() {
    +    vector<C> v;
    +    v.push_back( C() );
    +  }
    +
    + +

    Is that intentional? We should clarify whether or not we intended + to require containers to support types that define their own special + versions of operator new.

    + +

    Proposed resolution:

    +
    +

    480. unary_function and binary_function should have protected nonvirtual destructors

    Section: 20.3.1 [lib.base]  Status: New  Submitter: Joe Gottman  Date: 19 Aug 2004

    +

    The classes std::unary_function and std::binary_function are both +designed to be inherited from but contain no virtual functions. This +makes it too easy for a novice programmer to write code like +binary_function<int, int, int> *p = new plus<int>; delete p;

    + +

    There are two common ways to prevent this source of undefined +behavior: give the base class a public virtual destructor, or give it +a protected nonvirtual destructor. Since unary_function and +binary_function have no other virtual functions, (note in particular +the absence of an operator()() ), it would cost too much to give them +public virtual destructors. Therefore, they should be given protected +nonvirtual destructors.

    +

    Proposed resolution:

    +

    Change Paragraph 20.3.1 of the Standard from

    +
        template <class Arg, class Result>
    +    struct unary_function {
    +        typedef Arg argument_type;
    +        typedef Result result_type;
    +    };
    +
    +    template <class Arg1, class Arg2, class Result>
    +    struct binary_function {
    +        typedef Arg1 first_argument_type;
    +        typedef Arg2 second_argument_type;
    +        typedef Result result_type;
    +    };
    +
    + +

    to

    +
        template <class Arg, class Result>
    +        struct unary_function {
    +        typedef Arg argument_type;
    +        typedef Result result_type;
    +    protected:
    +        ~unary_function() {}
    +    };
    +
    +    template <class Arg1, class Arg2, class Result>
    +    struct binary_function {
    +        typedef Arg1 first_argument_type;
    +        typedef Arg2 second_argument_type;
    +        typedef Result result_type;
    +    protected:
    +        ~binary_function() {}
    +    };
    +
    +
    +

    481. unique's effects on the range [result, last)

    Section: 25.2.8 [lib.alg.unique]  Status: New  Submitter: Andrew Koenig  Date: 30 Aug 2004

    +

    +The standard says that unique(first, last) "eliminates all but the +first element from every consecutive group of equal elements" in +[first, last) and returns "the end of the resulting range". So a +postcondition is that [first, result) is the same as the old [first, +last) except that duplicates have been eliminated. +

    + +

    What postconditions are there on the range [result, last)? One + might argue that the standard says nothing about those values, so + they can be anything. One might also argue that the standard + doesn't permit those values to be changed, so they must not be. + Should the standard say something explicit one way or the other?

    + +

    Proposed resolution:

    +

    +

    +
    +

    482. Swapping pairs

    Section: 20.2.2 [lib.pairs], 25.2.2 [lib.alg.swap]  Status: New  Submitter: Andrew Koenig  Date: 14 Sep 2004

    +

    (Based on recent comp.std.c++ discussion)

    + +

    Pair (and tuple) should specialize std::swap to work in terms of +std::swap on their components. For example, there's no obvious reason +why swapping two objects of type pair<vector<int>, +list<double> > should not take O(1).

    +

    Proposed resolution:

    +
    +

    483. Heterogeneous equality and EqualityComparable

    Section: 25.1 [lib.alg.nonmodifying], 25.2 [lib.alg.modifying.operations]  Status: New  Submitter: Peter Dimov  Date: 20 Sep 2004

    +

    c++std-lib-14262

    + +

    [lib.alg.find] requires T to be EqualityComparable:

    + +
    template <class InputIterator, class T>
    +   InputIterator find(InputIterator first, InputIterator last,
    +                      const T& value);
    +
    + +

    +However the condition being tested, as specified in the Effects +clause, is actually *i == value, where i is an InputIterator. +

    + +

    +The two clauses are in agreement only if the type of *i is T, but this +isn't necessarily the case. *i may have a heterogeneous comparison +operator that takes a T, or a T may be convertible to the type of *i. +

    + +

    Further discussion (c++std-lib-14264): this problem affects a + number of algorithsm in clause 25, not just find. We + should try to resolve this problem everywhere it appears.

    +

    Proposed resolution:

    + +

    [lib.alg.find]:

    +
    + Remove [lib.alg.find]/1. +
    + +

    [lib.alg.count]:

    +
    + Remove [lib.alg.count]/1. +
    + +

    [lib.alg.search]:

    +
    + Remove "Type T is EqualityComparable (20.1.1), " from [lib.alg.search]/4. +
    + +

    [lib.alg.replace]:

    + +
    +

    + Remove [lib.alg.replace]/1. + Replace [lb.alg.replace]/2 with: +

    + +
    + For every iterator i in the range [first, last) for which *i == value + or pred(*i) holds perform *i = new_value. +
    + +

    + Remove the first sentence of /4. + Replace the beginning of /5 with: +

    + +
    + For every iterator i in the range [result, result + (last - + first)), assign to *i either... +
    + +

    (Note the defect here, current text says assign to i, not *i).

    +
    + +

    [lib.alg.fill]:

    + +
    +

    + Remove "Type T is Assignable (23.1), " from /1. + Replace /2 with: +

    + +
    + For every iterator i in the range [first, last) or [first, first + n), + perform *i = value. +
    +
    + +

    [lib.alg.remove]:

    +
    + Remove /1. + Remove the first sentence of /6. +
    + +

    Rationale:

    +

    Specifying EqualityComparable is redundant where it's correct, + because the equality requirements are implicit in the descriptions + of the algorithms' behavior.

    +
    +

    484. Convertible to T

    Section: 24.1.1 [lib.input.iterators]  Status: New  Submitter: Chris  Date: 16 Sep 2004

    +

    From comp.std.c++:

    + +

    +I note that given an input iterator a for type T, +then *a only has to be "convertable to T", not actually of type T. +

    + +

    Firstly, I can't seem to find an exact definition of "convertable to T". +While I assume it is the obvious definition (an implicit conversion), I +can't find an exact definition. Is there one?

    + +

    Slightly more worryingly, there doesn't seem to be any restriction on +the this type, other than it is "convertable to T". Consider two input +iterators a and b. I would personally assume that most people would +expect *a==*b would perform T(*a)==T(*b), however it doesn't seem that +the standard requires that, and that whatever type *a is (call it U) +could have == defined on it with totally different symantics and still +be a valid inputer iterator.

    + +

    Is this a correct reading? When using input iterators should I write +T(*a) all over the place to be sure that the object i'm using is the +class I expect?

    + +

    This is especially a nuisance for operations that are defined to be + "convertible to bool". (This is probably allowed so that + implementations could return say an int and avoid an unnessary + conversion. However all implementations I have seen simply return a + bool anyway. Typical implemtations of STL algorithms just write + things like while(a!=b && *a!=0). But strictly + speaking, there are lots of types that are convertible to T but + that also overload the appropriate operators so this doesn't behave + as expected.

    + +

    If we want to make code like this legal (which most people seem to + expect), then we'll need to tighten up what we mean by "convertible + to T".

    + +

    Proposed resolution:

    +

    +

    +
    +

    485. output iterator insufficently constrained

    Section: 24.1.2 [lib.output.iterators]  Status: New  Submitter: Chris  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 +progressed through only once and that each iterator is written to only +once, it does not require the following things:

    + +

    Note: Here it is assumed that x is an output iterator of type X which +has not yet been assigned to.

    + +

    a) That each value of the output iterator is written to: +The standard allows: +++x; ++x; ++x; +

    + +

    +b) That assignments to the output iterator are made in order +X a(x); ++a; *a=1; *x=2; is allowed +

    + +

    +c) Chains of output iterators cannot be constructed: +X a(x); ++a; X b(a); ++b; X c(b); ++c; is allowed, and under the current +wording (I believe) x,a,b,c could be written to in any order. +

    + +

    I do not believe this was the intension of the standard?

    +

    Proposed resolution:

    +

    Add to the note:

    + +

    "The values of an output iterator must be assigned to in the order they +are generated. It is undefined to progress forward more than once from a +value of an output iterator which has not yet been assigned."

    + +

    This is I believe the intension of the existing text. The "progress +forward once" is allowed so that "*r++=t" is allowed. It may be prefered +to instead allow something more along the lines of:

    + +

    "The values of an output iterator must be assigned to in the order they +are generated. With the exception of '*r++=t', an iterator must always +be assigned to before it is incremented".

    +
    +

    486. min/max CopyConstructible requirement is too strict

    Section: 25.3.7 [lib.alg.min.max]  Status: New  Submitter: Dave Abrahams  Date: 13 Oct 2004

    +

    A straightforward implementation of these algorithms does not need to +copy T.

    +

    Proposed resolution:

    +

    drop the the words "and CopyConstructible" from paragraphs 1 and 4

    +
    +

    487. Allocator::construct is too limiting

    Section: 20.1.5 [lib.allocator.requirements]  Status: New  Submitter: Dhruv Matani  Date: 17 Oct 2004

    +

    +The standard's version of allocator::construct(pointer, +const_reference) severely limits what you can construct using this +function. Say you can construct a socket from a file descriptor. Now, +using this syntax, I first have to manually construct a socket from +the fd, and then pass the constructed socket to the construct() +function so it will just to an uninitialized copy of the socket I +manually constructed. Now it may not always be possible to copy +construct a socket eh! So, I feel that the changes should go in the +allocator::construct(), making it: +

    +
        template<typename T>
    +    struct allocator{
    +      template<typename T1>
    +      void construct(pointer T1 const& rt1);
    +    };
    +
    + +

    +Now, the ctor of the class T which matches the one that takes a T1 can +be called! Doesn't that sound great? +

    +

    Proposed resolution:

    +

    +

    ----- 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 6f6cf2343dd..42f93f0f91b 100644 --- a/libstdc++-v3/docs/html/ext/lwg-defects.html +++ b/libstdc++-v3/docs/html/ext/lwg-defects.html @@ -1,15 +1,15 @@ - -C++ Standard Library Defect Report List +C++ Standard Library Defect Report List + - + - + - + @@ -19,48 +19,56 @@ -
    Doc. no.N1658=04-0098N1709=04-0149
    Date:16 Jul 20045 Nov 2004
    Project:Reply to: Matt Austern <austern@apple.com>
    -

    C++ Standard Library Defect Report List (Revision 31)

    + +

    C++ Standard Library Defect Report List (Revision 33)

    Reference ISO/IEC IS 14882:1998(E)

    Also see:

    This document contains only library issues which have been closed by the Library Working Group (LWG) after being found to be defects - in the standard. That is, issues which have a status of DR, TC, or RR. See the - Library Closed Issues List for issues closed as non-defects. See the - Library Active Issues List for active issues and more information. The + in the standard. That is, issues which have a status of DR, TC, or RR. See the + Library Closed Issues List for issues closed as non-defects. See the + Library Active Issues List for active issues and more information. The introductory material in that document also applies to this document.

    Revision History

      +
    • R33: +2004-11 post-Redmond mailing. Reflections actions taken in Redmond. +
    • +
    • R32: +2004-09 pre-Redmond mailing: reflects new proposed resolutions and +new issues received after the 2004-07 mailing. Added +new issues 479-481. +
    • R31: 2004-07 mid-term mailing: reflects new proposed resolutions and new issues received after the post-Sydney mailing. Added -new issues 463-478. +new issues 463-478.
    • R30: Post-Sydney mailing: reflects decisions made at the Sydney meeting. Voted all "Ready" issues from R29 into the working paper. -Added new issues 460-462. +Added new issues 460-462.
    • R29: -Pre-Sydney mailing. Added new issues 441-457. +Pre-Sydney mailing. Added new issues 441-457.
    • R28: Post-Kona mailing: reflects decisions made at the Kona meeting. -Added new issues 432-440. +Added new issues 432-440.
    • R27: -Pre-Kona mailing. Added new issues 404-431. +Pre-Kona mailing. Added new issues 404-431.
    • R26: Post-Oxford mailing: reflects decisions made at the Oxford meeting. @@ -68,139 +76,139 @@ All issues in Ready status were voted into DR status. All issues in DR status were voted into WP status.
    • R25: -Pre-Oxford mailing. Added new issues 390-402. +Pre-Oxford mailing. Added new issues 390-402.
    • R24: Post-Santa Cruz mailing: reflects decisions made at the Santa Cruz -meeting. All Ready issues from R23 with the exception of 253, which has been given a new proposed resolution, were -moved to DR status. Added new issues 383-389. (Issues 387-389 were discussed -at the meeting.) Made progress on issues 225, 226, 229: 225 and 229 have been moved to Ready status, and the only remaining -concerns with 226 involve wording. +meeting. All Ready issues from R23 with the exception of 253, which has been given a new proposed resolution, were +moved to DR status. Added new issues 383-389. (Issues 387-389 were discussed +at the meeting.) Made progress on issues 225, 226, 229: 225 and 229 have been moved to Ready status, and the only remaining +concerns with 226 involve wording.
    • R23: -Pre-Santa Cruz mailing. Added new issues 367-382. +Pre-Santa Cruz mailing. Added new issues 367-382. Moved issues in the TC to TC status.
    • R22: -Post-Curaçao mailing. Added new issues 362-366. +Post-Curaçao mailing. Added new issues 362-366.
    • R21: -Pre-Curaçao mailing. Added new issues 351-361. +Pre-Curaçao mailing. Added new issues 351-361.
    • R20: Post-Redmond mailing; reflects actions taken in Redmond. Added -new issues 336-350, of which issues -347-350 were added since Redmond, hence +new issues 336-350, of which issues +347-350 were added since Redmond, hence not discussed at the meeting. All Ready issues were moved to DR status, with the exception of issues -284, 241, and 267. +284, 241, and 267. Noteworthy issues discussed at Redmond include -120 202, 226, 233, -270, 253, 254, 323. +120 202, 226, 233, +270, 253, 254, 323.
    • R19: Pre-Redmond mailing. Added new issues -323-335. +323-335.
    • R18: Post-Copenhagen mailing; reflects actions taken in Copenhagen. -Added new issues 312-317, and discussed -new issues 271-314. +Added new issues 312-317, and discussed +new issues 271-314. Changed status of issues -103 118 136 153 -165 171 183 184 -185 186 214 221 -234 237 243 248 -251 252 256 260 -261 262 263 265 -268 +103 118 136 153 +165 171 183 184 +185 186 214 221 +234 237 243 248 +251 252 256 260 +261 262 263 265 +268 to DR. Changed status of issues -49 109 117 182 -228 230 232 235 -238 241 242 250 -259 264 266 267 -271 272 273 275 -281 284 285 286 -288 292 295 297 -298 301 303 306 -307 308 312 +49 109 117 182 +228 230 232 235 +238 241 242 250 +259 264 266 267 +271 272 273 275 +281 284 285 286 +288 292 295 297 +298 301 303 306 +307 308 312 to Ready. Closed issues -111 277 279 287 -289 293 302 313 -314 +111 277 279 287 +289 293 302 313 +314 as NAD.
    • R17: Pre-Copenhagen mailing. Converted issues list to XML. Added proposed -resolutions for issues 49, 76, 91, 235, 250, 267. -Added new issues 278-311. +resolutions for issues 49, 76, 91, 235, 250, 267. +Added new issues 278-311.
    • R16: post-Toronto mailing; reflects actions taken in Toronto. Added new -issues 265-277. Changed status of issues -3, 8, 9, 19, -26, 31, 61, -63, 86, 108, -112, 114, 115, -122, 127, 129, -134, 137, 142, -144, 146, 147, -159, 164, 170, -181, 199, 208, -209, 210, 211, -212, 217, 220, -222, 223, 224, -227 to "DR". Reopened issue 23. Reopened -issue 187. Changed issues 2 and -4 to NAD. Fixed a typo in issue 17. Fixed -issue 70: signature should be changed both places it -appears. Fixed issue 160: previous version didn't fix +issues 265-277. Changed status of issues +3, 8, 9, 19, +26, 31, 61, +63, 86, 108, +112, 114, 115, +122, 127, 129, +134, 137, 142, +144, 146, 147, +159, 164, 170, +181, 199, 208, +209, 210, 211, +212, 217, 220, +222, 223, 224, +227 to "DR". Reopened issue 23. Reopened +issue 187. Changed issues 2 and +4 to NAD. Fixed a typo in issue 17. Fixed +issue 70: signature should be changed both places it +appears. Fixed issue 160: previous version didn't fix the bug in enough places.
    • R15: pre-Toronto mailing. Added issues -233-264. Some small HTML formatting +233-264. Some small HTML formatting changes so that we pass Weblint tests.
    • R14: post-Tokyo II mailing; reflects committee actions taken in -Tokyo. Added issues 228 to 232. (00-0019R1/N1242) +Tokyo. Added issues 228 to 232. (00-0019R1/N1242)
    • R13: -pre-Tokyo II updated: Added issues 212 to 227. +pre-Tokyo II updated: Added issues 212 to 227.
    • R12: -pre-Tokyo II mailing: Added issues 199 to -211. Added "and paragraph 5" to the proposed resolution -of issue 29. Add further rationale to issue -178. +pre-Tokyo II mailing: Added issues 199 to +211. Added "and paragraph 5" to the proposed resolution +of issue 29. Add further rationale to issue +178.
    • R11: post-Kona mailing: Updated to reflect LWG and full committee actions in Kona (99-0048/N1224). Note changed resolution of issues -4 and 38. Added issues 196 -to 198. Closed issues list split into "defects" and +4 and 38. Added issues 196 +to 198. Closed issues list split into "defects" and "closed" documents. Changed the proposed resolution of issue -4 to NAD, and changed the wording of proposed resolution -of issue 38. +4 to NAD, and changed the wording of proposed resolution +of issue 38.
    • R10: -pre-Kona updated. Added proposed resolutions 83, -86, 91, 92, -109. Added issues 190 to -195. (99-0033/D1209, 14 Oct 99) +pre-Kona updated. Added proposed resolutions 83, +86, 91, 92, +109. Added issues 190 to +195. (99-0033/D1209, 14 Oct 99)
    • R9: -pre-Kona mailing. Added issues 140 to -189. Issues list split into separate "active" and +pre-Kona mailing. Added issues 140 to +189. Issues list split into separate "active" and "closed" documents. (99-0030/N1206, 25 Aug 99)
    • R8: @@ -208,47 +216,47 @@ post-Dublin mailing. Updated to reflect LWG and full committee actions in Dublin. (99-0016/N1193, 21 Apr 99)
    • R7: -pre-Dublin updated: Added issues 130, 131, -132, 133, 134, -135, 136, 137, -138, 139 (31 Mar 99) +pre-Dublin updated: Added issues 130, 131, +132, 133, 134, +135, 136, 137, +138, 139 (31 Mar 99)
    • R6: -pre-Dublin mailing. Added issues 127, 128, -and 129. (99-0007/N1194, 22 Feb 99) +pre-Dublin mailing. Added issues 127, 128, +and 129. (99-0007/N1194, 22 Feb 99)
    • R5: -update issues 103, 112; added issues -114 to 126. Format revisions to prepare +update issues 103, 112; added issues +114 to 126. Format revisions to prepare for making list public. (30 Dec 98)
    • R4: -post-Santa Cruz II updated: Issues 110, -111, 112, 113 added, several +post-Santa Cruz II updated: Issues 110, +111, 112, 113 added, several issues corrected. (22 Oct 98)
    • R3: -post-Santa Cruz II: Issues 94 to 109 +post-Santa Cruz II: Issues 94 to 109 added, many issues updated to reflect LWG consensus (12 Oct 98)
    • R2: -pre-Santa Cruz II: Issues 73 to 93 added, -issue 17 updated. (29 Sep 98) +pre-Santa Cruz II: Issues 73 to 93 added, +issue 17 updated. (29 Sep 98)
    • R1: -Correction to issue 55 resolution, 60 code -format, 64 title. (17 Sep 98) +Correction to issue 55 resolution, 60 code +format, 64 title. (17 Sep 98)

    Defect Reports


    -

    1. C library linkage editing oversight

    Section: 17.4.2.2 [lib.using.linkage]  Status: TC  Submitter: Beman Dawes  Date: 16 Nov 1997

    +

    1. C library linkage editing oversight

    Section: 17.4.2.2 [lib.using.linkage]  Status: TC  Submitter: Beman Dawes  Date: 16 Nov 1997

    The change specified in the proposed resolution below did not make it into the Standard. This change was accepted in principle at the London meeting, and the exact wording below was accepted at the Morristown meeting.

    Proposed resolution:

    -

    Change 17.4.2.2 [lib.using.linkage] paragraph 2 +

    Change 17.4.2.2 [lib.using.linkage] paragraph 2 from:

    @@ -266,7 +274,7 @@ from:

    use extern "C++" linkage for this purpose.


    -

    3. Atexit registration during atexit() call is not described

    Section: 18.3 [lib.support.start.term]  Status: TC  Submitter: Steve Clamage  Date: 12 Dec 1997

    +

    3. Atexit registration during atexit() call is not described

    Section: 18.3 [lib.support.start.term]  Status: TC  Submitter: Steve Clamage  Date: 12 Dec 1997

    We appear not to have covered all the possibilities of exit processing with respect to atexit registration.
    @@ -385,7 +393,7 @@ committee decides.

    See 99-0039/N1215, October 22, 1999, by Stephen D. Clamage for the analysis supporting to the proposed resolution.


    -

    5. String::compare specification questionable

    Section: 21.3.6.8 [lib.string::compare]  Status: TC  Submitter: Jack Reeves  Date: 11 Dec 1997

    +

    5. String::compare specification questionable

    Section: 21.3.6.8 [lib.string::compare]  Status: TC  Submitter: Jack Reeves  Date: 11 Dec 1997

    At the very end of the basic_string class definition is the signature: int compare(size_type pos1, size_type n1, const charT* s, size_type n2 = npos) const; In the following text this is defined as: returns @@ -405,7 +413,7 @@ something like: str.compare(1, str.size()-1, s, strlen(s)-1);

    pos1, size_type n1, const charT* s) const int compare(size_type pos1, size_type n1, const charT* s, size_type n2) const; each defined in terms of the corresponding constructor.

    Proposed resolution:

    -

    Replace the compare signature in 21.3 [lib.basic.string] +

    Replace the compare signature in 21.3 [lib.basic.string] (at the very end of the basic_string synopsis) which reads:

    @@ -424,7 +432,7 @@ charT* s, size_type n2) const; each defined in terms of the corresponding constr size_type n2) const;

    -

    Replace the portion of 21.3.6.8 [lib.string::compare] +

    Replace the portion of 21.3.6.8 [lib.string::compare] paragraphs 5 and 6 which read:

    @@ -463,8 +471,8 @@ becomes const, matching the existing synopsis.

    the Standard which must be fixed.  The same problem was also identified in issues 7 (item 5) and 87.


    -

    7. String clause minor problems

    Section: 21 [lib.strings]  Status: TC  Submitter: Matt Austern  Date: 15 Dec 1997

    -

    (1) In 21.3.5.4 [lib.string::insert], the description of template +

    7. String clause minor problems

    Section: 21 [lib.strings]  Status: TC  Submitter: Matt Austern  Date: 15 Dec 1997

    +

    (1) In 21.3.5.4 [lib.string::insert], the description of template <class InputIterator> insert(iterator, InputIterator, InputIterator) makes no sense. It refers to a member function that doesn't exist. It also talks about the return value of a void @@ -485,9 +493,9 @@ possible const charT&.

    charT* in the description. Second, given what it says in RETURNS, leaving out the final argument will always result in an exception getting thrown. This is paragraphs 5 and 6 of -21.3.6.8 [lib.string::compare]

    +21.3.6.8 [lib.string::compare]

    -

    (6) In table 37, in section 21.1.1 [lib.char.traits.require], +

    (6) In table 37, in section 21.1.1 [lib.char.traits.require], there's a note for X::move(s, p, n). It says "Copies correctly even where p is in [s, s+n)". This is correct as far as it goes, but it doesn't go far enough; it should also guarantee that the copy @@ -532,7 +540,7 @@ with:
         "Copies correctly even where the ranges [p, p+n) and [s, s+n) overlap."


    -

    8. Locale::global lacks guarantee

    Section: 22.1.1.5 [lib.locale.statics]  Status: TC  Submitter: Matt Austern  Date: 24 Dec 1997

    +

    8. Locale::global lacks guarantee

    Section: 22.1.1.5 [lib.locale.statics]  Status: TC  Submitter: Matt Austern  Date: 24 Dec 1997

    It appears there's an important guarantee missing from clause 22. We're told that invoking locale::global(L) sets the C locale if L has a name. However, we're not told whether or not invoking @@ -541,7 +549,7 @@ setlocale(s) sets the global C++ locale.

    The intent, I think, is that it should not, but I can't find any such words anywhere.

    Proposed resolution:

    -

    Add a sentence at the end of 22.1.1.5 [lib.locale.statics], +

    Add a sentence at the end of 22.1.1.5 [lib.locale.statics], paragraph 2: 

    @@ -550,7 +558,7 @@ paragraph 2: 


    -

    9. Operator new(0) calls should not yield the same pointer

    Section: 18.4.1 [lib.new.delete]  Status: TC  Submitter: Steve Clamage  Date: 4 Jan 1998

    +

    9. Operator new(0) calls should not yield the same pointer

    Section: 18.4.1 [lib.new.delete]  Status: TC  Submitter: Steve Clamage  Date: 4 Jan 1998

    Scott Meyers, in a comp.std.c++ posting: I just noticed that section 3.7.3.1 of CD2 seems to allow for the possibility that all calls to operator new(0) yield the same pointer, an implementation @@ -604,7 +612,7 @@ list maintainer's note: the IS is the same.]

    See 99-0040/N1216, October 22, 1999, by Stephen D. Clamage for the analysis supporting to the proposed resolution.


    -

    11. Bitset minor problems

    Section: 23.3.5 [lib.template.bitset]  Status: TC  Submitter: Matt Austern  Date: 22 Jan 1998

    +

    11. Bitset minor problems

    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.

    @@ -618,7 +626,7 @@ go in the Effects clause.

    Proposed resolution:

    ITEMS 1 AND 2:

    -In the bitset synopsis (23.3.5 [lib.template.bitset]), +In the bitset synopsis (23.3.5 [lib.template.bitset]), replace the member function

        reference operator[](size_t pos);
    @@ -628,7 +636,7 @@ with the two member functions
        bool operator[](size_t pos) const;
        reference operator[](size_t pos);

    -Add the following text at the end of 23.3.5.2 [lib.bitset.members], +Add the following text at the end of 23.3.5.2 [lib.bitset.members], immediately after paragraph 45:

    @@ -646,18 +654,18 @@ immediately after paragraph 45:

    Rationale:

    The LWG believes Item 3 is not a defect. "Formatted -input" implies the desired semantics. See 27.6.1.2 [lib.istream.formatted]. +input" implies the desired semantics. See 27.6.1.2 [lib.istream.formatted].


    -

    13. Eos refuses to die

    Section: 27.6.1.2.3 [lib.istream::extractors]  Status: TC  Submitter: William M. Miller  Date: 3 Mar 1998

    +

    13. Eos refuses to die

    Section: 27.6.1.2.3 [lib.istream::extractors]  Status: TC  Submitter: William M. Miller  Date: 3 Mar 1998

    In 27.6.1.2.3, there is a reference to "eos", which is the only one in the whole draft (at least using Acrobat search), so it's undefined.

    Proposed resolution:

    -

    In 27.6.1.2.3 [lib.istream::extractors], replace "eos" with +

    In 27.6.1.2.3 [lib.istream::extractors], replace "eos" with "charT()"


    -

    14. Locale::combine should be const

    Section: 22.1.1.3 [lib.locale.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    14. Locale::combine should be const

    Section: 22.1.1.3 [lib.locale.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    locale::combine is the only member function of locale (other than constructors and destructor) that is not const. There is no reason for it not to be const, and good reasons why it should have been const. Furthermore, leaving it non-const conflicts with 22.1.1 @@ -669,31 +677,31 @@ function. As constructors are never const, there was no "const" in the interface which was transformed into member "combine". It should have been added at that time, but the omission was not noticed.

    Proposed resolution:

    -

    In 22.1.1 [lib.locale] and also in 22.1.1.3 [lib.locale.members], add +

    In 22.1.1 [lib.locale] and also in 22.1.1.3 [lib.locale.members], add "const" to the declaration of member combine:

    template <class Facet> locale combine(const locale& other) const; 

    -

    15. Locale::name requirement inconsistent

    Section: 22.1.1.3 [lib.locale.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    15. Locale::name requirement inconsistent

    Section: 22.1.1.3 [lib.locale.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    locale::name() is described as returning a string that can be passed to a locale constructor, but there is no matching constructor.

    Proposed resolution:

    -

    In 22.1.1.3 [lib.locale.members], paragraph 5, replace +

    In 22.1.1.3 [lib.locale.members], paragraph 5, replace "locale(name())" with "locale(name().c_str())".


    -

    16. Bad ctype_byname<char> decl

    Section: 22.2.1.4 [lib.locale.ctype.byname.special]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    16. Bad ctype_byname<char> decl

    Section: 22.2.1.4 [lib.locale.ctype.byname.special]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The new virtual members ctype_byname<char>::do_widen and do_narrow did not get edited in properly. Instead, the member do_widen appears four times, with wrong argument lists.

    Proposed resolution:

    The correct declarations for the overloaded members do_narrow and do_widen should be copied -from 22.2.1.3 [lib.facet.ctype.special].

    +from 22.2.1.3 [lib.facet.ctype.special].


    -

    17. Bad bool parsing

    Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    17. Bad bool parsing

    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 @@ -735,7 +743,7 @@ I believe the correct algorithm is "as if":

    when one is a substring of the other. The proposed text below captures the logic of the code above.

    Proposed resolution:

    -

    In 22.2.2.1.2 [lib.facet.num.get.virtuals], in the first line of paragraph 14, +

    In 22.2.2.1.2 [lib.facet.num.get.virtuals], in the first line of paragraph 14, change "&&" to "&".

    Then, replace paragraphs 15 and 16 as follows:

    @@ -772,17 +780,17 @@ change "&&" to "&".

    err==str.failbit. --end example]


    -

    18. Get(...bool&) omitted

    Section: 22.2.2.1.1 [lib.facet.num.get.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    18. Get(...bool&) omitted

    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 virtual is listed everywhere appropriate.

    Proposed resolution:

    -

    Add at the beginning of 22.2.2.1.1 [lib.facet.num.get.members] +

    Add at the beginning of 22.2.2.1.1 [lib.facet.num.get.members] another get member for bool&, copied from the entry in -22.2.2.1 [lib.locale.num.get].

    +22.2.2.1 [lib.locale.num.get].


    -

    19. "Noconv" definition too vague

    Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    19. "Noconv" definition too vague

    Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In the definitions of codecvt<>::do_out and do_in, they are specified to return noconv if "no conversion is @@ -792,7 +800,7 @@ normatively what is done with the buffers.

    Proposed resolution:

    Change the entry for noconv in the table under paragraph 4 in section -22.2.1.5.2 [lib.locale.codecvt.virtuals] to read: +22.2.1.5.2 [lib.locale.codecvt.virtuals] to read:

    noconv: internT and externT are the same type, @@ -806,22 +814,22 @@ Change the entry for noconv in the table under paragraph 4 in section unchanged, and there are no changes to the values in [to, to_limit).


    -

    20. Thousands_sep returns wrong type

    Section: 22.2.3.1.2 [lib.facet.numpunct.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    20. Thousands_sep returns wrong type

    Section: 22.2.3.1.2 [lib.facet.numpunct.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The synopsis for numpunct<>::do_thousands_sep, and the definition of numpunct<>::thousands_sep which calls it, specify that it returns a value of type char_type. Here it is erroneously described as returning a "string_type".

    Proposed resolution:

    -

    In 22.2.3.1.2 [lib.facet.numpunct.virtuals], above paragraph 2, change +

    In 22.2.3.1.2 [lib.facet.numpunct.virtuals], above paragraph 2, change "string_type" to "char_type".


    -

    21. Codecvt_byname<> instantiations

    Section: 22.1.1.1.1 [lib.locale.category]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    21. Codecvt_byname<> instantiations

    Section: 22.1.1.1.1 [lib.locale.category]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In the second table in the section, captioned "Required instantiations", the instantiations for codecvt_byname<> have been omitted. These are necessary to allow users to construct a locale by name from facets.

    Proposed resolution:

    -

    Add in 22.1.1.1.1 [lib.locale.category] to the table captioned +

    Add in 22.1.1.1.1 [lib.locale.category] to the table captioned "Required instantiations", in the category "ctype" the lines

    @@ -830,7 +838,7 @@ the lines

    codecvt_byname<wchar_t,char,mbstate_t>

    -

    22. Member open vs. flags

    Section: 27.8.1.7 [lib.ifstream.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    22. Member open vs. flags

    Section: 27.8.1.7 [lib.ifstream.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The description of basic_istream<>::open leaves unanswered questions about how it responds to or changes flags in the error status for the stream. A strict reading indicates that it ignores the bits and does not change them, which confuses users who do @@ -838,7 +846,7 @@ not expect eofbit and failbit to remain set after a successful open. There are t reasonable resolutions: 1) status quo 2) fail if fail(), ignore eofbit 3) clear failbit and eofbit on call to open().

    Proposed resolution:

    -

    In 27.8.1.7 [lib.ifstream.members] paragraph 3, and in 27.8.1.10 [lib.ofstream.members] paragraph 3, under open() effects, add a footnote: +

    In 27.8.1.7 [lib.ifstream.members] paragraph 3, and in 27.8.1.10 [lib.ofstream.members] paragraph 3, under open() effects, add a footnote:

    @@ -856,22 +864,22 @@ one case. The resolution of this issue clarifies what the LWG believes to have been the original intent.


    -

    24. "do_convert" doesn't exist

    Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    24. "do_convert" doesn't exist

    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 and do_out".

    Proposed resolution:

    -

    In 22.2.1.5 [lib.locale.codecvt], paragraph 3, change -"do_convert" to "do_in or do_out". Also, in 22.2.1.5.2 [lib.locale.codecvt.virtuals], change "do_convert()" to "do_in +

    In 22.2.1.5 [lib.locale.codecvt], paragraph 3, change +"do_convert" to "do_in or do_out". Also, in 22.2.1.5.2 [lib.locale.codecvt.virtuals], change "do_convert()" to "do_in or do_out".


    -

    25. String operator<< uses width() value wrong

    Section: 21.3.7.9 [lib.string.io]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    25. String operator<< uses width() value wrong

    Section: 21.3.7.9 [lib.string.io]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In the description of operator<< applied to strings, the standard says that uses the smaller of os.width() and str.size(), to pad "as described in stage 3" elsewhere; but this is inconsistent, as this allows no possibility of space for padding.

    Proposed resolution:

    -

    Change 21.3.7.9 [lib.string.io] paragraph 4 from:
    +

    Change 21.3.7.9 [lib.string.io] paragraph 4 from:

        "... where n is the smaller of os.width() and str.size(); ..."
    @@ -881,7 +889,7 @@ to:
        "... where n is the larger of os.width() and str.size(); ..."


    -

    26. Bad sentry example

    Section: 27.6.1.1.2 [lib.istream::sentry]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    26. Bad sentry example

    Section: 27.6.1.1.2 [lib.istream::sentry]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In paragraph 6, the code in the example:

      template <class charT, class traits = char_traits<charT> >
    @@ -905,7 +913,7 @@ particular, it fails to use traits operators, and specifies incorrect
     semantics. (E.g. it specifies skipping over the first character in the
     sequence without examining it.) 

    Proposed resolution:

    -

    Remove the example above from 27.6.1.1.2 [lib.istream::sentry] +

    Remove the example above from 27.6.1.1.2 [lib.istream::sentry] paragraph 6.

    Rationale:

    The originally proposed replacement code for the example was not @@ -915,13 +923,13 @@ code ran over one page in length and was quite complicated. The LWG decided that it would be counter-productive to include such a lengthy example, which might well still contain errors.


    -

    27. String::erase(range) yields wrong iterator

    Section: 21.3.5.5 [lib.string::erase]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    27. String::erase(range) yields wrong iterator

    Section: 21.3.5.5 [lib.string::erase]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The string::erase(iterator first, iterator last) is specified to return an element one place beyond the next element after the last one erased. E.g. for the string "abcde", erasing the range ['b'..'d') would yield an iterator for element 'e', while 'd' has not been erased.

    Proposed resolution:

    -

    In 21.3.5.5 [lib.string::erase], paragraph 10, change:

    +

    In 21.3.5.5 [lib.string::erase], paragraph 10, change:

    Returns: an iterator which points to the element immediately following _last_ prior to @@ -935,7 +943,7 @@ while 'd' has not been erased.

    other elements being erased.


    -

    28. Ctype<char>is ambiguous

    Section: 22.2.1.3.2 [lib.facet.ctype.char.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    28. Ctype<char>is ambiguous

    Section: 22.2.1.3.2 [lib.facet.ctype.char.members]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The description of the vector form of ctype<char>::is can be interpreted to mean something very different from what was intended. Paragraph 4 says

    @@ -947,22 +955,22 @@ something very different from what was intended. Paragraph 4 says

    This is intended to copy the value indexed from table()[] into the place identified in vec[].

    Proposed resolution:

    -

    Change 22.2.1.3.2 [lib.facet.ctype.char.members], paragraph 4, to read

    +

    Change 22.2.1.3.2 [lib.facet.ctype.char.members], paragraph 4, to read

    Effects: The second form, for all *p in the range [low, high), assigns into vec[p-low] the value table()[(unsigned char)*p].


    -

    29. Ios_base::init doesn't exist

    Section: 27.3.1 [lib.narrow.stream.objects]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    -

    Sections 27.3.1 [lib.narrow.stream.objects] and 27.3.2 [lib.wide.stream.objects] mention +

    29. Ios_base::init doesn't exist

    Section: 27.3.1 [lib.narrow.stream.objects]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    Sections 27.3.1 [lib.narrow.stream.objects] and 27.3.2 [lib.wide.stream.objects] mention a function ios_base::init, which is not defined. Probably they mean -basic_ios<>::init, defined in 27.4.4.1 [lib.basic.ios.cons], +basic_ios<>::init, defined in 27.4.4.1 [lib.basic.ios.cons], paragraph 3.

    Proposed resolution:

    [R12: modified to include paragraph 5.]

    -

    In 27.3.1 [lib.narrow.stream.objects] paragraph 2 and 5, change

    +

    In 27.3.1 [lib.narrow.stream.objects] paragraph 2 and 5, change

    ios_base::init

    @@ -974,27 +982,27 @@ paragraph 3.

    basic_ios<char>::init

    -

    Also, make a similar change in 27.3.2 [lib.wide.stream.objects] except it +

    Also, make a similar change in 27.3.2 [lib.wide.stream.objects] except it should read

    basic_ios<wchar_t>::init


    -

    30. Wrong header for LC_*

    Section: 22.1.1.1.1 [lib.locale.category]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    30. Wrong header for LC_*

    Section: 22.1.1.1.1 [lib.locale.category]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    Paragraph 2 implies that the C macros LC_CTYPE etc. are defined in <cctype>, where they are in fact defined elsewhere to appear in <clocale>.

    Proposed resolution:

    -

    In 22.1.1.1.1 [lib.locale.category], paragraph 2, change +

    In 22.1.1.1.1 [lib.locale.category], paragraph 2, change "<cctype>" to read "<clocale>".


    -

    31. Immutable locale values

    Section: 22.1.1 [lib.locale]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    31. Immutable locale values

    Section: 22.1.1 [lib.locale]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    Paragraph 6, says "An instance of locale is immutable; once a facet reference is obtained from it, ...". This has caused some confusion, because locale variables are manifestly assignable.

    Proposed resolution:

    -

    In 22.1.1 [lib.locale] replace paragraph 6

    +

    In 22.1.1 [lib.locale] replace paragraph 6

    An instance of locale is immutable; once a facet @@ -1011,7 +1019,7 @@ are manifestly assignable.

    long as some locale object refers to that facet.


    -

    32. Pbackfail description inconsistent

    Section: 27.5.2.4.4 [lib.streambuf.virt.pback]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    32. Pbackfail description inconsistent

    Section: 27.5.2.4.4 [lib.streambuf.virt.pback]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The description of the required state before calling virtual member basic_streambuf<>::pbackfail requirements is inconsistent with the conditions described in 27.5.2.2.4 [lib.streambuf.pub.pback] where member sputbackc calls it. @@ -1025,7 +1033,7 @@ Specifically, the latter says it calls pbackfail if:

    It appears that the pbackfail description is wrong.

    Proposed resolution:

    -

    In 27.5.2.4.4 [lib.streambuf.virt.pback], paragraph 1, change:

    +

    In 27.5.2.4.4 [lib.streambuf.virt.pback], paragraph 1, change:

    "traits::eq(*gptr(),traits::to_char_type( c))"

    @@ -1041,7 +1049,7 @@ Specifically, the latter says it calls pbackfail if:

    Note deliberate reordering of arguments for clarity in addition to the correction of the argument value.


    -

    33. Codecvt<> mentions from_type

    Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    33. Codecvt<> mentions from_type

    Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In the table defining the results from do_out and do_in, the specification for the result error says

    @@ -1052,19 +1060,19 @@ result error says

    but from_type is not defined. This clearly is intended to be an externT for do_in, or an internT for do_out.

    Proposed resolution:

    -

    In 22.2.1.5.2 [lib.locale.codecvt.virtuals] paragraph 4, replace the definition +

    In 22.2.1.5.2 [lib.locale.codecvt.virtuals] paragraph 4, replace the definition in the table for the case of _error_ with

    encountered a character in [from,from_end) that it could not convert.


    -

    34. True/falsename() not in ctype<>

    Section: 22.2.2.2.2 [lib.facet.num.put.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    34. True/falsename() not in ctype<>

    Section: 22.2.2.2.2 [lib.facet.num.put.virtuals]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In paragraph 19, Effects:, members truename() and falsename are used from facet ctype<charT>, but it has no such members. Note that this is also a problem in 22.2.2.1.2, addressed in (4).

    Proposed resolution:

    -

    In 22.2.2.2.2 [lib.facet.num.put.virtuals], paragraph 19, in the Effects: +

    In 22.2.2.2.2 [lib.facet.num.put.virtuals], paragraph 19, in the Effects: clause for member put(...., bool), replace the initialization of the string_type value s as follows:

    @@ -1073,12 +1081,12 @@ string_type value s as follows:

    string_type s = val ? np.truename() : np.falsename();

    -

    35. No manipulator unitbuf in synopsis

    Section: 27.4 [lib.iostreams.base]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    -

    In 27.4.5.1 [lib.fmtflags.manip], we have a definition for a manipulator +

    35. No manipulator unitbuf in synopsis

    Section: 27.4 [lib.iostreams.base]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    In 27.4.5.1 [lib.fmtflags.manip], we have a definition for a manipulator named "unitbuf". Unlike other manipulators, it's not listed in synopsis. Similarly for "nounitbuf".

    Proposed resolution:

    -

    Add to the synopsis for <ios> in 27.4 [lib.iostreams.base], after +

    Add to the synopsis for <ios> in 27.4 [lib.iostreams.base], after the entry for "nouppercase", the prototypes:

    @@ -1086,7 +1094,7 @@ the entry for "nouppercase", the prototypes:

    ios_base& nounitbuf(ios_base& str);

    -

    36. Iword & pword storage lifetime omitted

    Section: 27.4.2.5 [lib.ios.base.storage]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    36. Iword & pword storage lifetime omitted

    Section: 27.4.2.5 [lib.ios.base.storage]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In the definitions for ios_base::iword and pword, the lifetime of the storage is specified badly, so that an implementation which only keeps the last value stored appears to conform. In particular, it says:

    @@ -1096,7 +1104,7 @@ member with a different index ...

    This is not idle speculation; at least one implementation was done this way.

    Proposed resolution:

    -

    Add in 27.4.2.5 [lib.ios.base.storage], in both paragraph 2 and also in +

    Add in 27.4.2.5 [lib.ios.base.storage], in both paragraph 2 and also in paragraph 4, replace the sentence:

    @@ -1115,7 +1123,7 @@ paragraph 4, replace the sentence:

    substituting "iword" or "pword" as appropriate.


    -

    37. Leftover "global" reference

    Section: 22.1.1 [lib.locale]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    37. Leftover "global" reference

    Section: 22.1.1 [lib.locale]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    In the overview of locale semantics, paragraph 4, is the sentence

    @@ -1126,14 +1134,14 @@ paragraph 4, replace the sentence:

    This is not supported by the definition of use_facet<>, and represents semantics from an old draft.

    Proposed resolution:

    -

    In 22.1.1 [lib.locale], paragraph 4, delete the parenthesized +

    In 22.1.1 [lib.locale], paragraph 4, delete the parenthesized expression

    (or, failing that, in the global locale)


    -

    38. Facet definition incomplete

    Section: 22.1.2 [lib.locale.global.templates]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    38. Facet definition incomplete

    Section: 22.1.2 [lib.locale.global.templates]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    It has been noticed by Esa Pulkkinen that the definition of "facet" is incomplete. In particular, a class derived from another facet, but which does not define a member id, cannot @@ -1152,7 +1160,7 @@ reads:

    Requires: Facet is a facet class whose definition - contains the public static member id as defined in 22.1.1.1.2 [lib.locale.facet].

    + contains the public static member id as defined in 22.1.1.1.2 [lib.locale.facet].

    [ @@ -1163,7 +1171,7 @@ contains (not inherits) the public static member ]


    -

    39. istreambuf_iterator<>::operator++(int) definition garbled

    Section: 24.5.3.4 [lib.istreambuf.iterator::op++]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    39. istreambuf_iterator<>::operator++(int) definition garbled

    Section: 24.5.3.4 [lib.istreambuf.iterator::op++]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    Following the definition of istreambuf_iterator<>::operator++(int) in paragraph 3, the standard contains three lines of garbage text left over from a previous edit.

    @@ -1173,26 +1181,26 @@ sbuf_->sbumpc(); return(tmp);

    Proposed resolution:

    -

    In 24.5.3.4 [lib.istreambuf.iterator::op++], delete the three lines of code at the +

    In 24.5.3.4 [lib.istreambuf.iterator::op++], delete the three lines of code at the end of paragraph 3.


    -

    40. Meaningless normative paragraph in examples

    Section: 22.2.8 [lib.facets.examples]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    40. Meaningless normative paragraph in examples

    Section: 22.2.8 [lib.facets.examples]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    Paragraph 3 of the locale examples is a description of part of an implementation technique that has lost its referent, and doesn't mean anything.

    Proposed resolution:

    -

    Delete 22.2.8 [lib.facets.examples] paragraph 3 which begins "This +

    Delete 22.2.8 [lib.facets.examples] paragraph 3 which begins "This initialization/identification system depends...", or (at the editor's option) replace it with a place-holder to keep the paragraph numbering the same.


    -

    41. Ios_base needs clear(), exceptions()

    Section: 27.4.2 [lib.ios.base]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    -

    The description of ios_base::iword() and pword() in 27.4.2.4 [lib.ios.members.static], say that if they fail, they "set badbit, +

    41. Ios_base needs clear(), exceptions()

    Section: 27.4.2 [lib.ios.base]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    The description of ios_base::iword() and pword() in 27.4.2.4 [lib.ios.members.static], say that if they fail, they "set badbit, which may throw an exception". However, ios_base offers no interface to set or to test badbit; those interfaces are defined in basic_ios<>.

    Proposed resolution:

    -

    Change the description in 27.4.2.5 [lib.ios.base.storage] in +

    Change the description in 27.4.2.5 [lib.ios.base.storage] in paragraph 2, and also in paragraph 4, as follows. Replace

    @@ -1212,7 +1220,7 @@ paragraph 2, and also in paragraph 4, as follows. Replace

    setstate(badbit).]


    -

    42. String ctors specify wrong default allocator

    Section: 21.3 [lib.basic.string]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    42. String ctors specify wrong default allocator

    Section: 21.3 [lib.basic.string]  Status: TC  Submitter: Nathan Myers  Date: 6 Aug 1998

    The basic_string<> copy constructor:

    basic_string(const basic_string& str, size_type pos = 0,
    @@ -1228,7 +1236,7 @@ vector) do not have this form of constructor, so it is inconsistent,
     and an evident source of confusion, for basic_string<> to have
     it, so it might better be removed. 

    Proposed resolution:

    -

    In 21.3 [lib.basic.string], replace the declaration of the copy +

    In 21.3 [lib.basic.string], replace the declaration of the copy constructor as follows:

    @@ -1237,7 +1245,7 @@ basic_string(const basic_string& str, size_type pos, size_type n = npos, const Allocator& a = Allocator());
    -

    In 21.3.1 [lib.string.cons], replace the copy constructor declaration +

    In 21.3.1 [lib.string.cons], replace the copy constructor declaration as above. Add to paragraph 5, Effects:

    @@ -1250,7 +1258,7 @@ just an unfortunate design choice.

    The LWG considered two other possible resolutions:

    -

    A. In 21.3 [lib.basic.string], replace the declaration of the copy +

    A. In 21.3 [lib.basic.string], replace the declaration of the copy constructor as follows:

    @@ -1260,7 +1268,7 @@ basic_string(const basic_string& str, size_type pos, size_type n, const Allocator& a);
    -

    In 21.3.1 [lib.string.cons], replace the copy constructor declaration +

    In 21.3.1 [lib.string.cons], replace the copy constructor declaration as above. Add to paragraph 5, Effects:

    @@ -1268,7 +1276,7 @@ as above. Add to paragraph 5, Effects:

    value str.get_allocator().

    -

    B. In 21.3 [lib.basic.string], and also in 21.3.1 [lib.string.cons], replace +

    B. In 21.3 [lib.basic.string], and also in 21.3.1 [lib.string.cons], replace the declaration of the copy constructor as follows:

    @@ -1285,7 +1293,7 @@ Kona: issue editing snafu fixed - the proposed resolution now correctly reflects the LWG consensus. ]


    -

    44. Iostreams use operator== on int_type values

    Section: 27 [lib.input.output]  Status: WP  Submitter: Nathan Myers  Date: 6 Aug 1998

    +

    44. Iostreams use operator== on int_type values

    Section: 27 [lib.input.output]  Status: WP  Submitter: Nathan Myers  Date: 6 Aug 1998

    Many of the specifications for iostreams specify that character values or their int_type equivalents are compared using operators == or !=, though in other places traits::eq() or traits::eq_int_type is @@ -1551,10 +1559,10 @@ change uses of == and != to use the traits members instead.


-

46. Minor Annex D errors

Section: D.7 [depr.str.strstreams]  Status: TC  Submitter: Brendan Kehoe  Date:  1 Jun 1998

+

46. Minor Annex D errors

Section: D.7 [depr.str.strstreams]  Status: TC  Submitter: Brendan Kehoe  Date:  1 Jun 1998

See lib-6522 and edit-814.

Proposed resolution:

-

Change D.7.1 [depr.strstreambuf] (since streambuf is a typedef of +

Change D.7.1 [depr.strstreambuf] (since streambuf is a typedef of basic_streambuf<char>) from:

         virtual streambuf<char>* setbuf(char* s, streamsize n);
@@ -1563,7 +1571,7 @@ basic_streambuf<char>) from:

         virtual streambuf* setbuf(char* s, streamsize n);
-

In D.7.4 [depr.strstream] insert the semicolon now missing after +

In D.7.4 [depr.strstream] insert the semicolon now missing after int_type:

     namespace std {
@@ -1575,27 +1583,27 @@ int_type:

typedef typename char_traits<char>::int_type int_type typedef typename char_traits<char>::pos_type pos_type;

-

47. Imbue() and getloc() Returns clauses swapped

Section: 27.4.2.3 [lib.ios.base.locales]  Status: TC  Submitter: Matt Austern  Date: 21 Jun 1998

+

47. Imbue() and getloc() Returns clauses swapped

Section: 27.4.2.3 [lib.ios.base.locales]  Status: TC  Submitter: Matt Austern  Date: 21 Jun 1998

Section 27.4.2.3 specifies how imbue() and getloc() work. That section has two RETURNS clauses, and they make no sense as stated. They make perfect sense, though, if you swap them. Am I correct in thinking that paragraphs 2 and 4 just got mixed up by accident?

Proposed resolution:

-

In 27.4.2.3 [lib.ios.base.locales] swap paragraphs 2 and 4.

+

In 27.4.2.3 [lib.ios.base.locales] swap paragraphs 2 and 4.


-

48. Use of non-existent exception constructor

Section: 27.4.2.1.1 [lib.ios::failure]  Status: TC  Submitter: Matt Austern  Date: 21 Jun 1998

+

48. Use of non-existent exception constructor

Section: 27.4.2.1.1 [lib.ios::failure]  Status: TC  Submitter: Matt Austern  Date: 21 Jun 1998

27.4.2.1.1, paragraph 2, says that class failure initializes the base class, exception, with exception(msg). Class exception (see 18.6.1) has no such constructor.

Proposed resolution:

-

Replace 27.4.2.1.1 [lib.ios::failure], paragraph 2, with

+

Replace 27.4.2.1.1 [lib.ios::failure], paragraph 2, with

EFFECTS: Constructs an object of class failure.


-

49. Underspecification of ios_base::sync_with_stdio

Section: 27.4.2.4 [lib.ios.members.static]  Status: WP  Submitter: Matt Austern  Date: 21 Jun 1998

+

49. Underspecification of ios_base::sync_with_stdio

Section: 27.4.2.4 [lib.ios.members.static]  Status: WP  Submitter: Matt Austern  Date: 21 Jun 1998

Two problems

(1) 27.4.2.4 doesn't say what ios_base::sync_with_stdio(f) @@ -1608,7 +1616,7 @@ synchronized with stdio. Again, of course, I can make some guesses. (And I'm unhappy about the performance implications of those guesses, but that's another matter.)

Proposed resolution:

-

Change the following sentence in 27.4.2.4 [lib.ios.members.static] +

Change the following sentence in 27.4.2.4 [lib.ios.members.static] returns clause from:

@@ -1624,41 +1632,35 @@ returns clause from:

false.

-

Add the following immediately after 27.4.2.4 [lib.ios.members.static], +

Add the following immediately after 27.4.2.4 [lib.ios.members.static], paragraph 2:

When a standard iostream object str is synchronized with a standard stdio stream f, the effect of inserting a character c by

-
-  fputc(f, c);
+
  fputc(f, c);
 

is the same as the effect of

-
-  str.rdbuf()->sputc(c);
+
  str.rdbuf()->sputc(c);
 

for any sequence of characters; the effect of extracting a character c by

-
-  c = fgetc(f);
+
  c = fgetc(f);
 

is the same as the effect of:

-
-  c = str.rdbuf()->sbumpc(c);
+
  c = str.rdbuf()->sbumpc(c);
 

for any sequences of characters; and the effect of pushing back a character c by

-
-  ungetc(c, f);
+
  ungetc(c, f);
 

is the same as the effect of

-
-  str.rdbuf()->sputbackc(c);
+
  str.rdbuf()->sputbackc(c);
 

for any sequence of characters. [Footnote: This implies @@ -1675,7 +1677,7 @@ of "synchronization"]

text was added in the non-normative footnote to say that operations on the two streams can be mixed arbitrarily.]


-

50. Copy constructor and assignment operator of ios_base

Section: 27.4.2 [lib.ios.base]  Status: TC  Submitter: Matt Austern  Date: 21 Jun 1998

+

50. Copy constructor and assignment operator of ios_base

Section: 27.4.2 [lib.ios.base]  Status: TC  Submitter: Matt Austern  Date: 21 Jun 1998

As written, ios_base has a copy constructor and an assignment operator. (Nothing in the standard says it doesn't have one, and all classes have copy constructors and assignment operators unless you @@ -1695,13 +1697,13 @@ that intention would have required a explicit description of the semantics (e.g. what happens to the iarray and parray stuff).

Proposed resolution:

-

In 27.4.2 [lib.ios.base], class ios_base, specify the copy +

In 27.4.2 [lib.ios.base], class ios_base, specify the copy constructor and operator= members as being private.

Rationale:

The LWG believes the difficulty of specifying correct semantics outweighs any benefit of allowing ios_base objects to be copyable.


-

51. Requirement to not invalidate iterators missing

Section: 23.1 [lib.container.requirements]  Status: TC  Submitter: David Vandevoorde  Date: 23 Jun 1998

+

51. Requirement to not invalidate iterators missing

Section: 23.1 [lib.container.requirements]  Status: TC  Submitter: David Vandevoorde  Date: 23 Jun 1998

The std::sort algorithm can in general only sort a given sequence by moving around values. The list<>::sort() member on the other hand could move around values or just update internal pointers. Either @@ -1747,15 +1749,15 @@ proposed resolution below is somewhat updated from CD2-23-011, particularly the addition of the phrase "or change the values of"


-

52. Small I/O problems

Section: 27.4.3.2 [lib.fpos.operations]  Status: TC  Submitter: Matt Austern  Date: 23 Jun 1998

-

First, 27.4.4.1 [lib.basic.ios.cons], table 89. This is pretty obvious: +

52. Small I/O problems

Section: 27.4.3.2 [lib.fpos.operations]  Status: TC  Submitter: Matt Austern  Date: 23 Jun 1998

+

First, 27.4.4.1 [lib.basic.ios.cons], table 89. This is pretty obvious: it should be titled "basic_ios<>() effects", not "ios_base() effects".

-

[The second item is a duplicate; see issue 6 for +

[The second item is a duplicate; see issue 6 for resolution.]

-

Second, 27.4.3.2 [lib.fpos.operations] table 88 . There are a couple +

Second, 27.4.3.2 [lib.fpos.operations] table 88 . There are a couple different things wrong with it, some of which I've already discussed with Jerry, but the most obvious mechanical sort of error is that it uses expressions like P(i) and p(i), without ever defining what sort @@ -1770,16 +1772,16 @@ streampos arithmetic, but that it wasn't actually supposed to do anything meaningful except on platforms, like Unix, where genuine arithmetic is possible.)

Proposed resolution:

-

Change 27.4.4.1 [lib.basic.ios.cons] table 89 title from +

Change 27.4.4.1 [lib.basic.ios.cons] table 89 title from "ios_base() effects" to "basic_ios<>() effects".


-

53. Basic_ios destructor unspecified

Section: 27.4.4.1 [lib.basic.ios.cons]  Status: TC  Submitter: Matt Austern  Date: 23 Jun 1998

+

53. Basic_ios destructor unspecified

Section: 27.4.4.1 [lib.basic.ios.cons]  Status: TC  Submitter: Matt Austern  Date: 23 Jun 1998

There's nothing in 27.4.4 saying what basic_ios's destructor does. The important question is whether basic_ios::~basic_ios() destroys rdbuf().

Proposed resolution:

-

Add after 27.4.4.1 [lib.basic.ios.cons] paragraph 2:

+

Add after 27.4.4.1 [lib.basic.ios.cons] paragraph 2:

virtual ~basic_ios();

@@ -1788,25 +1790,25 @@ rdbuf().

Rationale:

The LWG reviewed the additional question of whether or not rdbuf(0) may set badbit. The answer is -clearly yes; it may be set via clear(). See 27.4.4.2 [lib.basic.ios.members], paragraph 6. This issue was reviewed at length +clearly yes; it may be set via clear(). See 27.4.4.2 [lib.basic.ios.members], paragraph 6. This issue was reviewed at length by the LWG, which removed from the original proposed resolution a footnote which incorrectly said "rdbuf(0) does not set badbit".


-

54. Basic_streambuf's destructor

Section: 27.5.2.1 [lib.streambuf.cons]  Status: TC  Submitter: Matt Austern  Date: 25 Jun 1998

+

54. Basic_streambuf's destructor

Section: 27.5.2.1 [lib.streambuf.cons]  Status: TC  Submitter: Matt Austern  Date: 25 Jun 1998

The class synopsis for basic_streambuf shows a (virtual) destructor, but the standard doesn't say what that destructor does. My assumption is that it does nothing, but the standard should say so explicitly.

Proposed resolution:

-

Add after 27.5.2.1 [lib.streambuf.cons] paragraph 2:

+

Add after 27.5.2.1 [lib.streambuf.cons] paragraph 2:

virtual  ~basic_streambuf();

Effects: None.


-

55. Invalid stream position is undefined

Section: 27 [lib.input.output]  Status: TC  Submitter: Matt Austern  Date: 26 Jun 1998

+

55. Invalid stream position is undefined

Section: 27 [lib.input.output]  Status: TC  Submitter: Matt Austern  Date: 26 Jun 1998

Several member functions in clause 27 are defined in certain circumstances to return an "invalid stream position", a term that is defined nowhere in the standard. Two places (27.5.2.4.2, @@ -1827,52 +1829,52 @@ should not be changed. Here are the three places where "invalid stream position" should not be changed:

-

27.7.1.3 [lib.stringbuf.virtuals], paragraph 14
- 27.8.1.4 [lib.filebuf.virtuals], paragraph 14
- D.7.1.3 [depr.strstreambuf.virtuals], paragraph 17 +

27.7.1.3 [lib.stringbuf.virtuals], paragraph 14
+ 27.8.1.4 [lib.filebuf.virtuals], paragraph 14
+ D.7.1.3 [depr.strstreambuf.virtuals], paragraph 17

Proposed resolution:

-

In 27.5.2.4.2 [lib.streambuf.virt.buffer], paragraph 4, change "Returns an +

In 27.5.2.4.2 [lib.streambuf.virt.buffer], paragraph 4, change "Returns an object of class pos_type that stores an invalid stream position (_lib.iostreams.definitions_)" to "Returns pos_type(off_type(-1))".

-

In 27.5.2.4.2 [lib.streambuf.virt.buffer], paragraph 6, change "Returns +

In 27.5.2.4.2 [lib.streambuf.virt.buffer], paragraph 6, change "Returns an object of class pos_type that stores an invalid stream position" to "Returns pos_type(off_type(-1))".

-

In 27.7.1.3 [lib.stringbuf.virtuals], paragraph 13, change "the object +

In 27.7.1.3 [lib.stringbuf.virtuals], paragraph 13, change "the object stores an invalid stream position" to "the return value is pos_type(off_type(-1))".

-

In 27.8.1.4 [lib.filebuf.virtuals], paragraph 13, change "returns an +

In 27.8.1.4 [lib.filebuf.virtuals], paragraph 13, change "returns an invalid stream position (27.4.3)" to "returns pos_type(off_type(-1))"

-

In 27.8.1.4 [lib.filebuf.virtuals], paragraph 15, change "Otherwise +

In 27.8.1.4 [lib.filebuf.virtuals], paragraph 15, change "Otherwise returns an invalid stream position (_lib.iostreams.definitions_)" to "Otherwise returns pos_type(off_type(-1))"

-

In D.7.1.3 [depr.strstreambuf.virtuals], paragraph 15, change "the object +

In D.7.1.3 [depr.strstreambuf.virtuals], paragraph 15, change "the object stores an invalid stream position" to "the return value is pos_type(off_type(-1))"

-

In D.7.1.3 [depr.strstreambuf.virtuals], paragraph 18, change "the object +

In D.7.1.3 [depr.strstreambuf.virtuals], paragraph 18, change "the object stores an invalid stream position" to "the return value is pos_type(off_type(-1))"


-

56. Showmanyc's return type

Section: 27.5.2 [lib.streambuf]  Status: TC  Submitter: Matt Austern  Date: 29 Jun 1998

+

56. Showmanyc's return type

Section: 27.5.2 [lib.streambuf]  Status: TC  Submitter: Matt Austern  Date: 29 Jun 1998

The class summary for basic_streambuf<>, in 27.5.2, says that showmanyc has return type int. However, 27.5.2.4.3 says that its return type is streamsize.

Proposed resolution:

Change showmanyc's return type in the -27.5.2 [lib.streambuf] class summary to streamsize.

+27.5.2 [lib.streambuf] class summary to streamsize.


-

57. Mistake in char_traits

Section: 21.1.3.2 [lib.char.traits.specializations.wchar.t]  Status: TC  Submitter: Matt Austern  Date: 1 Jul 1998

+

57. Mistake in char_traits

Section: 21.1.3.2 [lib.char.traits.specializations.wchar.t]  Status: TC  Submitter: Matt Austern  Date: 1 Jul 1998

21.1.3.2, paragraph 3, says "The types streampos and wstreampos may be different if the implementation supports no shift encoding in narrow-oriented iostreams but supports one or more shift @@ -1886,11 +1888,11 @@ to clause 21, we see in 21.1.3.1 and 21.1.3.2 that char_traits<char>::state_type and char_traits<wchar_t>::state_type must both be mbstate_t.

Proposed resolution:

-

Remove the sentence in 21.1.3.2 [lib.char.traits.specializations.wchar.t] paragraph 3 which +

Remove the sentence in 21.1.3.2 [lib.char.traits.specializations.wchar.t] paragraph 3 which begins "The types streampos and wstreampos may be different..." .


-

59. Ambiguity in specification of gbump

Section: 27.5.2.3.1 [lib.streambuf.get.area]  Status: TC  Submitter: Matt Austern  Date: 28 Jul 1998

+

59. Ambiguity in specification of gbump

Section: 27.5.2.3.1 [lib.streambuf.get.area]  Status: TC  Submitter: Matt Austern  Date: 28 Jul 1998

27.5.2.3.1 says that basic_streambuf::gbump() "Advances the next pointer for the input sequence by n."

@@ -1903,7 +1905,7 @@ pbump.

(The "classic" AT&T implementation used the former interpretation.)

Proposed resolution:

-

Change 27.5.2.3.1 [lib.streambuf.get.area] paragraph 4 gbump effects from:

+

Change 27.5.2.3.1 [lib.streambuf.get.area] paragraph 4 gbump effects from:

Effects: Advances the next pointer for the input sequence by n.

@@ -1915,10 +1917,10 @@ former interpretation.)

Effects: Adds n to the next pointer for the input sequence.

-

Make the same change to 27.5.2.3.2 [lib.streambuf.put.area] paragraph 4 pbump +

Make the same change to 27.5.2.3.2 [lib.streambuf.put.area] paragraph 4 pbump effects.


-

60. What is a formatted input function?

Section: 27.6.1.2.1 [lib.istream.formatted.reqmts]  Status: TC  Submitter: Matt Austern  Date: 3 Aug 1998

+

60. What is a formatted input function?

Section: 27.6.1.2.1 [lib.istream.formatted.reqmts]  Status: TC  Submitter: Matt Austern  Date: 3 Aug 1998

Paragraph 1 of 27.6.1.2.1 contains general requirements for all formatted input functions. Some of the functions defined in section 27.6.1.2 explicitly say that those requirements apply ("Behaves @@ -1949,17 +1951,17 @@ that the "Common requirements" listed in section 27.6.1.2.1 (for basic_istream) and section 27.6.2.5.1 (for basic_ostream) do not apply to them.

-

Additional comments from Dietmar Kühl: It appears to be somewhat -nonsensical to consider the functions defined in 27.6.1.2.3 [lib.istream::extractors] paragraphs 1 to 5 to be "Formatted input +

Additional comments from Dietmar Kühl: It appears to be somewhat +nonsensical to consider the functions defined in 27.6.1.2.3 [lib.istream::extractors] paragraphs 1 to 5 to be "Formatted input function" but since these functions are defined in a section labeled "Formatted input functions" it is unclear to me whether these operators are considered formatted input functions which -have to conform to the "common requirements" from 27.6.1.2.1 [lib.istream.formatted.reqmts]: If this is the case, all manipulators, not +have to conform to the "common requirements" from 27.6.1.2.1 [lib.istream.formatted.reqmts]: If this is the case, all manipulators, not just ws, would skip whitespace unless noskipws is set (... but setting noskipws using the manipulator syntax would also skip whitespace :-)

It is not clear which functions are to be considered unformatted input functions. As written, it seems -that all functions in 27.6.1.3 [lib.istream.unformatted] are unformatted input +that all functions in 27.6.1.3 [lib.istream.unformatted] are unformatted input functions. However, it does not really make much sense to construct a sentry object for gcount(), sync(), ... Also it is unclear what happens to the gcount() if @@ -2214,7 +2216,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.


-

61. Ambiguity in iostreams exception policy

Section: 27.6.1.3 [lib.istream.unformatted]  Status: TC  Submitter: Matt Austern  Date: 6 Aug 1998

+

61. Ambiguity in iostreams exception policy

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 @@ -2249,7 +2251,7 @@ parenthetical comment: "(Exceptions thrown from

The LWG looked to two alternative wordings, and choose the proposed resolution as better standardese.


-

62. Sync's return value

Section: 27.6.1.3 [lib.istream.unformatted]  Status: TC  Submitter: Matt Austern  Date: 6 Aug 1998

+

62. Sync's return value

Section: 27.6.1.3 [lib.istream.unformatted]  Status: TC  Submitter: Matt Austern  Date: 6 Aug 1998

The Effects clause for sync() (27.6.1.3, paragraph 36) says that it "calls rdbuf()->pubsync() and, if that function returns -1 ... returns traits::eof()."

@@ -2257,11 +2259,11 @@ resolution as better standardese.

That looks suspicious, because traits::eof() is of type traits::int_type while the return type of sync() is int.

Proposed resolution:

-

In 27.6.1.3 [lib.istream.unformatted], paragraph 36, change "returns +

In 27.6.1.3 [lib.istream.unformatted], paragraph 36, change "returns traits::eof()" to "returns -1".


-

63. Exception-handling policy for unformatted output

Section: 27.6.2.6 [lib.ostream.unformatted]  Status: TC  Submitter: Matt Austern  Date: 11 Aug 1998

+

63. Exception-handling policy for unformatted output

Section: 27.6.2.6 [lib.ostream.unformatted]  Status: TC  Submitter: Matt Austern  Date: 11 Aug 1998

Clause 27 details an exception-handling policy for formatted input, unformatted input, and formatted output. It says nothing for unformatted output (27.6.2.6). 27.6.2.6 should either include the same @@ -2291,12 +2293,12 @@ input, unformatted input, and formatted output.


64. Exception handling in basic_istream::operator>>(basic_streambuf*) -

Section: 27.6.1.2.3 [lib.istream::extractors]  Status: TC  Submitter: Matt Austern  Date: 11 Aug 1998

+

Section: 27.6.1.2.3 [lib.istream::extractors]  Status: TC  Submitter: Matt Austern  Date: 11 Aug 1998

27.6.1.2.3, paragraph 13, is ambiguous. It can be interpreted two different ways, depending on whether the second sentence is read as an elaboration of the first.

Proposed resolution:

-

Replace 27.6.1.2.3 [lib.istream::extractors], paragraph 13, which begins +

Replace 27.6.1.2.3 [lib.istream::extractors], paragraph 13, which begins "If the function inserts no characters ..." with:

@@ -2308,14 +2310,14 @@ elaboration of the first.

(27.4.4.3), then the caught exception is rethrown.


-

66. Strstreambuf::setbuf

Section: D.7.1.3 [depr.strstreambuf.virtuals]  Status: TC  Submitter: Matt Austern  Date: 18 Aug 1998

+

66. Strstreambuf::setbuf

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 cut-and-paste from basic_streambuf. There are no classes derived from strstreambuf.

Proposed resolution:

-

D.7.1.3 [depr.strstreambuf.virtuals], paragraph 19, replace the setbuf effects +

D.7.1.3 [depr.strstreambuf.virtuals], paragraph 19, replace the setbuf effects clause which currently says "Performs an operation that is defined separately for each class derived from strstreambuf" with:

@@ -2325,7 +2327,7 @@ with:

setbuf(0,0) has no effect.


-

68. Extractors for char* should store null at end

Section: 27.6.1.2.3 [lib.istream::extractors]  Status: TC  Submitter: Angelika Langer  Date: 14 Jul 1998

+

68. Extractors for char* should store null at end

Section: 27.6.1.2.3 [lib.istream::extractors]  Status: TC  Submitter: Angelika Langer  Date: 14 Jul 1998

Extractors for char* (27.6.1.2.3) do not store a null character after the extracted character sequence whereas the unformatted functions like get() do. Why is this?

@@ -2335,7 +2337,7 @@ glitch. You'll notice that the last item of the list of what stops extraction doesn't make any sense. It was supposed to be the line that said a null is stored.

Proposed resolution:

-

27.6.1.2.3 [lib.istream::extractors], paragraph 7, change the last list +

27.6.1.2.3 [lib.istream::extractors], paragraph 7, change the last list item from:

@@ -2351,7 +2353,7 @@ item from:

extracted.

-

69. Must elements of a vector be contiguous?

Section: 23.2.4 [lib.vector]  Status: TC  Submitter: Andrew Koenig  Date: 29 Jul 1998

+

69. Must elements of a vector be contiguous?

Section: 23.2.4 [lib.vector]  Status: TC  Submitter: Andrew Koenig  Date: 29 Jul 1998

The issue is this: Must the elements of a vector be in contiguous memory?

(Please note that this is entirely separate from the question of @@ -2359,7 +2361,7 @@ whether a vector iterator is required to be a pointer; the answer to that question is clearly "no," as it would rule out debugging implementations)

Proposed resolution:

-

Add the following text to the end of 23.2.4 [lib.vector], +

Add the following text to the end of 23.2.4 [lib.vector], paragraph 1.

@@ -2376,15 +2378,15 @@ directly defined in the standard. Discussion included:


-

70. Uncaught_exception() missing throw() specification

Section: 18.6 [lib.support.exception], 18.6.4 [lib.uncaught]  Status: TC  Submitter: Steve Clamage  Date: Unknown

+

70. Uncaught_exception() missing throw() specification

Section: 18.6 [lib.support.exception], 18.6.4 [lib.uncaught]  Status: TC  Submitter: Steve Clamage  Date: Unknown

In article 3E04@pratique.fr, Valentin Bonnard writes:

uncaught_exception() doesn't have a throw specification.

@@ -2395,29 +2397,29 @@ handle exceptions thrown from uncaught_exception() ?

uncaught_exception() is called in exception handling contexts where exception safety is very important.

Proposed resolution:

-

In 15.5.3 [except.uncaught], paragraph 1, 18.6 [lib.support.exception], and 18.6.4 [lib.uncaught], add "throw()" to uncaught_exception().

+

In 15.5.3 [except.uncaught], paragraph 1, 18.6 [lib.support.exception], and 18.6.4 [lib.uncaught], add "throw()" to uncaught_exception().


-

71. Do_get_monthname synopsis missing argument

Section: 22.2.5.1 [lib.locale.time.get]  Status: TC  Submitter: Nathan Myers  Date: 13 Aug 1998

+

71. Do_get_monthname synopsis missing argument

Section: 22.2.5.1 [lib.locale.time.get]  Status: TC  Submitter: Nathan Myers  Date: 13 Aug 1998

The locale facet member time_get<>::do_get_monthname -is described in 22.2.5.1.2 [lib.locale.time.get.virtuals] with five arguments, +is described in 22.2.5.1.2 [lib.locale.time.get.virtuals] with five arguments, consistent with do_get_weekday and with its specified use by member get_monthname. However, in the synopsis, it is specified instead with four arguments. The missing argument is the "end" iterator value.

Proposed resolution:

-

In 22.2.5.1 [lib.locale.time.get], add an "end" argument to +

In 22.2.5.1 [lib.locale.time.get], add an "end" argument to the declaration of member do_monthname as follows:

  virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base&,
                                      ios_base::iostate& err, tm* t) const;

74. Garbled text for codecvt::do_max_length -

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Matt Austern  Date: 8 Sep 1998

+

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: TC  Submitter: Matt Austern  Date: 8 Sep 1998

The text of codecvt::do_max_length's "Returns" clause (22.2.1.5.2, paragraph 11) is garbled. It has unbalanced parentheses and a spurious n.

Proposed resolution:

-

Replace 22.2.1.5.2 [lib.locale.codecvt.virtuals] paragraph 11 with the +

Replace 22.2.1.5.2 [lib.locale.codecvt.virtuals] paragraph 11 with the following:

@@ -2428,7 +2430,7 @@ following:

mbstate_t>::do_max_length() returns 1.

-

75. Contradiction in codecvt::length's argument types

Section: 22.2.1.5 [lib.locale.codecvt]  Status: TC  Submitter:  Matt +

75. Contradiction in codecvt::length's argument types

Section: 22.2.1.5 [lib.locale.codecvt]  Status: TC  Submitter:  Matt Austern  Date:  18 Sep 1998

The class synopses for classes codecvt<> (22.2.1.5) and codecvt_byname<> (22.2.1.6) say that the first @@ -2442,7 +2444,7 @@ synopsis or the summary must be changed.

then we must also add text saying how do_length changes its stateT argument.

Proposed resolution:

-

In 22.2.1.5 [lib.locale.codecvt], and also in 22.2.1.6 [lib.locale.codecvt.byname], +

In 22.2.1.5 [lib.locale.codecvt], and also in 22.2.1.6 [lib.locale.codecvt.byname], change the stateT argument type on both member length() and member do_length() from

@@ -2456,7 +2458,7 @@ change the stateT argument type on both member

stateT&

-

In 22.2.1.5.2 [lib.locale.codecvt.virtuals], add to the definition for member +

In 22.2.1.5.2 [lib.locale.codecvt.virtuals], add to the definition for member do_length a paragraph:

@@ -2466,7 +2468,7 @@ change the stateT argument type on both member max elements.


-

76. Can a codecvt facet always convert one internal character at a time?

Section: 22.2.1.5 [lib.locale.codecvt]  Status: WP  Submitter: Matt Austern  Date: 25 Sep 1998

+

76. Can a codecvt facet always convert one internal character at a time?

Section: 22.2.1.5 [lib.locale.codecvt]  Status: WP  Submitter: Matt Austern  Date: 25 Sep 1998

This issue concerns the requirements on classes derived from codecvt, including user-defined classes. What are the restrictions on the conversion from external characters @@ -2501,8 +2503,8 @@ sequence of M external characters that maps to a sequence of subsequence that maps to N-1 internal characters.)

Some of the wording in the standard, such as the description of -codecvt::do_max_length (22.2.1.5.2 [lib.locale.codecvt.virtuals], -paragraph 11) and basic_filebuf::underflow (27.8.1.4 [lib.filebuf.virtuals], paragraph 3) suggests that it must always be +codecvt::do_max_length (22.2.1.5.2 [lib.locale.codecvt.virtuals], +paragraph 11) and basic_filebuf::underflow (27.8.1.4 [lib.filebuf.virtuals], paragraph 3) suggests that it must always be possible to pick off internal characters one at a time from a sequence of external characters. However, this is never explicitly stated one way or the other.

@@ -2515,25 +2517,21 @@ be aware of the assumptions that the library makes. This issue affects positioning operations on basic_filebuf, unbuffered input, and several of codecvt's member functions.

Proposed resolution:

-

Add the following text as a new paragraph, following 22.2.1.5.2 [lib.locale.codecvt.virtuals] paragraph 2:

+

Add the following text as a new paragraph, following 22.2.1.5.2 [lib.locale.codecvt.virtuals] paragraph 2:

A codecvt facet that is used by basic_filebuf -(27.8 [lib.file.streams]) must have the property that if

-
-    do_out(state, from, from_end, from_next, to, to_lim, to_next)
+(27.8  [lib.file.streams]) must have the property that if

+
    do_out(state, from, from_end, from_next, to, to_lim, to_next)
 
would return ok, where from != from_end, then -
-    do_out(state, from, from + 1, from_next, to, to_end, to_next)
+
    do_out(state, from, from + 1, from_next, to, to_end, to_next)
 
must also return ok, and that if -
-    do_in(state, from, from_end, from_next, to, to_lim, to_next)
+
    do_in(state, from, from_end, from_next, to, to_lim, to_next)
 
would return ok, where to != to_lim, then -
-    do_in(state, from, from_end, from_next, to, to + 1, to_next)
+
    do_in(state, from, from_end, from_next, to, to + 1, to_next)
 

must also return ok. [Footnote: Informally, this means that basic_filebuf assumes that the mapping from @@ -2578,34 +2576,34 @@ return value.]

does not expect basic_filebuf to be able to use it.


-

78. Typo: event_call_back

Section: 27.4.2 [lib.ios.base]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

78. Typo: event_call_back

Section: 27.4.2 [lib.ios.base]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

typo: event_call_back should be event_callback  

Proposed resolution:

-

In the 27.4.2 [lib.ios.base] synopsis change +

In the 27.4.2 [lib.ios.base] synopsis change "event_call_back" to "event_callback".


-

79. Inconsistent declaration of polar()

Section: 26.2.1 [lib.complex.synopsis], 26.2.7 [lib.complex.value.ops]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

-

In 26.2.1 [lib.complex.synopsis] polar is declared as follows:

+

79. Inconsistent declaration of polar()

Section: 26.2.1 [lib.complex.synopsis], 26.2.7 [lib.complex.value.ops]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

In 26.2.1 [lib.complex.synopsis] polar is declared as follows:

   template<class T> complex<T> polar(const T&, const T&); 
-

In 26.2.7 [lib.complex.value.ops] it is declared as follows:

+

In 26.2.7 [lib.complex.value.ops] it is declared as follows:

   template<class T> complex<T> polar(const T& rho, const T& theta = 0); 

Thus whether the second parameter is optional is not clear.

Proposed resolution:

-

In 26.2.1 [lib.complex.synopsis] change:

+

In 26.2.1 [lib.complex.synopsis] change:

   template<class T> complex<T> polar(const T&, const T&);

to:

   template<class T> complex<T> polar(const T& rho, const T& theta = 0); 

-

80. Global Operators of complex declared twice

Section: 26.2.1 [lib.complex.synopsis], 26.2.2 [lib.complex]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

80. Global Operators of complex declared twice

Section: 26.2.1 [lib.complex.synopsis], 26.2.2 [lib.complex]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

Both 26.2.1 and 26.2.2 contain declarations of global operators for class complex. This redundancy should be removed.

Proposed resolution:

Reduce redundancy according to the general style of the standard.


-

83. String::npos vs. string::max_size()

Section: 21.3 [lib.basic.string]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

83. String::npos vs. string::max_size()

Section: 21.3 [lib.basic.string]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

Many string member functions throw if size is getting or exceeding npos. However, I wonder why they don't throw if size is getting or exceeding max_size() instead of npos. May be npos is known at compile @@ -2613,7 +2611,7 @@ time, while max_size() is known at runtime. However, what happens if size exceeds max_size() but not npos, then? It seems the standard lacks some clarifications here.

Proposed resolution:

-

After 21.3 [lib.basic.string] paragraph 4 ("The functions +

After 21.3 [lib.basic.string] paragraph 4 ("The functions described in this clause...") add a new paragraph:

@@ -2624,7 +2622,7 @@ described in this clause...") add a new paragraph:

Rationale:

The LWG believes length_error is the correct exception to throw.


-

86. String constructors don't describe exceptions

Section: 21.3.1 [lib.string.cons]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

86. String constructors don't describe exceptions

Section: 21.3.1 [lib.string.cons]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

The constructor from a range:

template<class InputIterator> 
@@ -2635,15 +2633,15 @@ described in this clause...") add a new paragraph:

according to the other constructors if the numbers of characters in the range equals npos (or exceeds max_size(), see above).

Proposed resolution:

-

In 21.3.1 [lib.string.cons], Strike throws paragraphs for +

In 21.3.1 [lib.string.cons], Strike throws paragraphs for constructors which say "Throws: length_error if n == npos."

Rationale:

Throws clauses for length_error if n == npos are no longer needed because they are subsumed by the general wording added by the -resolution for issue 83.

+resolution for issue 83.


-

90. Incorrect description of operator >> for strings

Section: 21.3.7.9 [lib.string.io]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

90. Incorrect description of operator >> for strings

Section: 21.3.7.9 [lib.string.io]  Status: TC  Submitter: Nico Josuttis  Date: 29 Sep 1998

The effect of operator >> for strings contain the following item:

    isspace(c,getloc()) is true for the next available input @@ -2651,7 +2649,7 @@ character c.

Here getloc() has to be replaced by is.getloc().

Proposed resolution:

-

In 21.3.7.9 [lib.string.io] paragraph 1 Effects clause replace:

+

In 21.3.7.9 [lib.string.io] paragraph 1 Effects clause replace:

isspace(c,getloc()) is true for the next available input character c.

@@ -2663,13 +2661,13 @@ character c.

isspace(c,is.getloc()) is true for the next available input character c.


-

91. Description of operator>> and getline() for string<> might cause endless loop

Section: 21.3.7.9 [lib.string.io]  Status: WP  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

91. Description of operator>> and getline() for string<> might cause endless loop

Section: 21.3.7.9 [lib.string.io]  Status: WP  Submitter: Nico Josuttis  Date: 29 Sep 1998

Operator >> and getline() for strings read until eof() in the input stream is true. However, this might never happen, if the stream can't read anymore without reaching EOF. So shouldn't it be changed into that it reads until !good() ?

Proposed resolution:

-

In 21.3.7.9 [lib.string.io], paragraph 1, replace:

+

In 21.3.7.9 [lib.string.io], paragraph 1, replace:

Effects: Begins by constructing a sentry object k as if k were constructed by typename basic_istream<charT,traits>::sentry k( is). If @@ -2681,7 +2679,7 @@ extracted and appended until any of the following occurs:

with:

-Effects: Behaves as a formatted input function (27.6.1.2.1 [lib.istream.formatted.reqmts]). After constructing a sentry object, if the +Effects: Behaves as a formatted input function (27.6.1.2.1 [lib.istream.formatted.reqmts]). After constructing a sentry object, if the sentry converts to true, calls str.erase() and then extracts characters from is and appends them to str as if by calling str.append(1,c). If is.width() is greater than zero, the maximum @@ -2690,7 +2688,7 @@ str.max_size(). Characters are extracted and appended until any of the following occurs:
-

In 21.3.7.9 [lib.string.io], paragraph 6, replace

+

In 21.3.7.9 [lib.string.io], paragraph 6, replace

Effects: Begins by constructing a sentry object k as if by typename basic_istream<charT,traits>::sentry k( is, true). If bool( k) is true, @@ -2700,7 +2698,7 @@ following occurs:

with:

-Effects: Behaves as an unformatted input function (27.6.1.3 [lib.istream.unformatted]), except that it does not affect the value returned +Effects: Behaves as an unformatted input function (27.6.1.3 [lib.istream.unformatted]), except that it does not affect the value returned by subsequent calls to basic_istream<>::gcount(). After constructing a sentry object, if the sentry converts to true, calls str.erase() and then extracts characters from is and appends them to @@ -2714,7 +2712,7 @@ should be a formatted input function, not an unformatted input function. there is no mechanism for gcount to be set except by one of basic_istream's member functions.]

-

[Curaçao: Nico agrees with proposed resolution.]

+

[Curaçao: Nico agrees with proposed resolution.]

Rationale:

The real issue here is whether or not these string input functions @@ -2724,7 +2722,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.


-

92. Incomplete Algorithm Requirements

Section: 25 [lib.algorithms]  Status: WP  Submitter: Nico Josuttis  Date: 29 Sep 1998

+

92. Incomplete Algorithm Requirements

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:

@@ -2773,7 +2771,7 @@ cost it could be avoided (just implement it directly instead of calling find_if()).

Proposed resolution:

-

Add a new paragraph following 25 [lib.algorithms] paragraph 8:

+

Add a new paragraph following 25 [lib.algorithms] paragraph 8:

[Note: Unless otherwise specified, algorithms that take function objects as arguments are permitted to copy those function objects @@ -2801,7 +2799,7 @@ library book for a detailed discussion.]

[Kona: Nico will provide wording to the effect that "unless otherwise specified, the number of copies of and calls to function objects by algorithms is unspecified".  Consider placing in -25 [lib.algorithms] after paragraph 9.]

+25 [lib.algorithms] after paragraph 9.]

[Santa Cruz: The standard doesn't currently guarantee that functions object won't be copied, and what isn't forbidden is @@ -2816,8 +2814,8 @@ objects by algorithms is unspecified".  Consider placing in


-

98. Input iterator requirements are badly written

Section: 24.1.1 [lib.input.iterators]  Status: WP  Submitter: AFNOR  Date: 7 Oct 1998

-

Table 72 in 24.1.1 [lib.input.iterators] specifies semantics for +

98. Input iterator requirements are badly written

Section: 24.1.1 [lib.input.iterators]  Status: WP  Submitter: AFNOR  Date: 7 Oct 1998

+

Table 72 in 24.1.1 [lib.input.iterators] specifies semantics for *r++ of:

   { T tmp = *r; ++r; return tmp; }

@@ -2830,11 +2828,11 @@ This is too specific: we want to allow *r++ to return an lvalue.

suggests that the effects *r++ should precisely replicate the behavior of this code, including side effects. (Does this mean that *r++ should invoke the copy constructor exactly as many times as the sample -code above would?) See issue 334 for a similar +code above would?) See issue 334 for a similar problem.

Proposed resolution:

-In Table 72 in 24.1.1 [lib.input.iterators], change the return type +In Table 72 in 24.1.1 [lib.input.iterators], change the return type for *r++ from T to "convertible to T".

Rationale:

This issue has two parts: the return type, and the number of times @@ -2856,7 +2854,7 @@ for *r++ from T to "convertible to T". of input iterators, we can't impose any requirements in the Input Iterator requirements table that forward iterators don't satisfy.


-

103. set::iterator is required to be modifiable, but this allows modification of keys

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: AFNOR  Date: 7 Oct 1998

+

103. set::iterator is required to be modifiable, but this allows modification of keys

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: AFNOR  Date: 7 Oct 1998

Set::iterator is described as implementation-defined with a reference to the container requirement; the container requirement says that const_iterator is an iterator pointing to const T and iterator an @@ -2871,7 +2869,7 @@ const_iterator. Set, for example, has the following:

typedef implementation defined iterator;
       // See _lib.container.requirements_

-

23.1 [lib.container.requirements] actually requires that iterator type pointing +

23.1 [lib.container.requirements] actually requires that iterator type pointing to T (table 65). Disallowing user modification of keys by changing the standard to require an iterator for associative container to be the same as const_iterator would be overkill since that will unnecessarily @@ -2884,7 +2882,7 @@ goes in line with trusting user knows what he is doing.

Other Options Evaluated:

-

Option A.   In 23.1.2 [lib.associative.reqmts], paragraph 2, after +

Option A.   In 23.1.2 [lib.associative.reqmts], paragraph 2, after first sentence, and before "In addition,...", add one line:

@@ -2892,7 +2890,7 @@ first sentence, and before "In addition,...", add one line:

Modification of keys shall not change their strict weak ordering.

-

Option B. Add three new sentences to 23.1.2 [lib.associative.reqmts]:

+

Option B. Add three new sentences to 23.1.2 [lib.associative.reqmts]:

At the end of paragraph 5: "Keys in an associative container @@ -2904,7 +2902,7 @@ first sentence, and before "In addition,...", add one line: type."

-

Option C. To 23.1.2 [lib.associative.reqmts], paragraph 3, which +

Option C. To 23.1.2 [lib.associative.reqmts], paragraph 3, which currently reads:

@@ -2927,7 +2925,7 @@ currently reads:

different than it was the previous time k2 was in the container.]

Proposed resolution:

-

Add the following to 23.1.2 [lib.associative.reqmts] at +

Add the following to 23.1.2 [lib.associative.reqmts] at the indicated location:

@@ -2965,7 +2963,7 @@ conversion from iterator to const_iterator.

[Tokyo: The LWG crafted the proposed resolution and rationale.]


-

106. Numeric library private members are implementation defined

Section: 26.3.5 [lib.template.slice.array]  Status: TC  Submitter: AFNOR  Date: 7 Oct 1998

+

106. Numeric library private members are implementation defined

Section: 26.3.5 [lib.template.slice.array]  Status: TC  Submitter: AFNOR  Date: 7 Oct 1998

This is the only place in the whole standard where the implementation has to document something private.

Proposed resolution:

@@ -2974,23 +2972,23 @@ Remove the comment which says "// remainder implementation defined" from:


-

108. Lifetime of exception::what() return unspecified

Section: 18.6.1 [lib.exception]  Status: TC  Submitter: AFNOR  Date: 7 Oct 1998

+

108. Lifetime of exception::what() return unspecified

Section: 18.6.1 [lib.exception]  Status: TC  Submitter: AFNOR  Date: 7 Oct 1998

In 18.6.1, paragraphs 8-9, the lifetime of the return value of exception::what() is left unspecified. This issue has implications with exception safety of exception handling: some exceptions should not throw bad_alloc.

Proposed resolution:

-

Add to 18.6.1 [lib.exception] paragraph 9 (exception::what notes +

Add to 18.6.1 [lib.exception] paragraph 9 (exception::what notes clause) the sentence:

@@ -3003,7 +3001,7 @@ to set internal state that should affect the contents of the string returned by what().


-

109. Missing binders for non-const sequence elements

Section: 20.3.6 [lib.binders]  Status: WP  Submitter: Bjarne Stroustrup  Date: 7 Oct 1998

+

109. Missing binders for non-const sequence elements

Section: 20.3.6 [lib.binders]  Status: WP  Submitter: Bjarne Stroustrup  Date: 7 Oct 1998

There are no versions of binders that apply to non-const elements of a sequence. This makes examples like for_each() using bind2nd() on @@ -3078,7 +3076,7 @@ public:

Howard believes there is a flaw in this resolution. See c++std-lib-9127. We may need to reopen this issue.

-

In 20.3.6.1 [lib.binder.1st] in the declaration of binder1st after:

+

In 20.3.6.1 [lib.binder.1st] in the declaration of binder1st after:

typename Operation::result_type
 operator()(const typename Operation::second_argument_type& x) const;

@@ -3088,7 +3086,7 @@ See c++std-lib-9127. We may need to reopen this issue.

typename Operation::result_type
 operator()(typename Operation::second_argument_type& x) const;

-

In 20.3.6.3 [lib.binder.2nd] in the declaration of binder2nd after:

+

In 20.3.6.3 [lib.binder.2nd] in the declaration of binder2nd after:

typename Operation::result_type
 operator()(const typename Operation::first_argument_type& x) const;

@@ -3109,12 +3107,12 @@ Strap poll: NAD - 0. Accept proposed resolution - 10. Leave open - 1.]


-

110. istreambuf_iterator::equal not const

Section: 24.5.3 [lib.istreambuf.iterator], 24.5.3.5 [lib.istreambuf.iterator::equal]  Status: TC  Submitter: Nathan Myers  Date: 15 Oct 1998

+

110. istreambuf_iterator::equal not const

Section: 24.5.3 [lib.istreambuf.iterator], 24.5.3.5 [lib.istreambuf.iterator::equal]  Status: TC  Submitter: Nathan Myers  Date: 15 Oct 1998

Member istreambuf_iterator<>::equal is not declared -"const", yet 24.5.3.6 [lib.istreambuf.iterator::op==] says that operator==, +"const", yet 24.5.3.6 [lib.istreambuf.iterator::op==] says that operator==, which is const, calls it. This is contradictory.

Proposed resolution:

-

In 24.5.3 [lib.istreambuf.iterator] and also in 24.5.3.5 [lib.istreambuf.iterator::equal], +

In 24.5.3 [lib.istreambuf.iterator] and also in 24.5.3.5 [lib.istreambuf.iterator::equal], replace:

@@ -3127,13 +3125,13 @@ replace:

bool equal(const istreambuf_iterator& b) const;

-

112. Minor typo in ostreambuf_iterator constructor

Section: 24.5.4.1 [lib.ostreambuf.iter.cons]  Status: TC  Submitter: Matt Austern  Date: 20 Oct 1998

+

112. Minor typo in ostreambuf_iterator constructor

Section: 24.5.4.1 [lib.ostreambuf.iter.cons]  Status: TC  Submitter: Matt Austern  Date: 20 Oct 1998

The requires clause for ostreambuf_iterator's constructor from an ostream_type (24.5.4.1, paragraph 1) reads "s is not null". However, s is a reference, and references can't be null.

Proposed resolution:

-

In 24.5.4.1 [lib.ostreambuf.iter.cons]:

+

In 24.5.4.1 [lib.ostreambuf.iter.cons]:

Move the current paragraph 1, which reads "Requires: s is not null.", from the first constructor to the second constructor.

@@ -3145,7 +3143,7 @@ reading:

Requires: s.rdbuf() is not null.


-

114. Placement forms example in error twice

Section: 18.4.1.3 [lib.new.delete.placement]  Status: TC  Submitter: Steve Clamage  Date: 28 Oct 1998

+

114. Placement forms example in error twice

Section: 18.4.1.3 [lib.new.delete.placement]  Status: TC  Submitter: Steve Clamage  Date: 28 Oct 1998

Section 18.4.1.3 contains the following example:

[Example: This can be useful for constructing an object at a known address:
@@ -3163,14 +3161,14 @@ believes the () are correct.]

likely to fail.

Proposed resolution:

Replace the first line of code in the example in -18.4.1.3 [lib.new.delete.placement] with: +18.4.1.3 [lib.new.delete.placement] with:

void* place = operator new(sizeof(Something));

-

115. Typo in strstream constructors

Section: D.7.4.1 [depr.strstream.cons]  Status: TC  Submitter: Steve Clamage  Date: 2 Nov 1998

+

115. Typo in strstream constructors

Section: D.7.4.1 [depr.strstream.cons]  Status: TC  Submitter: Steve Clamage  Date: 2 Nov 1998

D.7.4.1 strstream constructors paragraph 2 says:

@@ -3187,11 +3185,11 @@ likely to fail.

should be "If mode&app==app", or "mode&app!=0", meaning that the append bit is set.

Proposed resolution:

-

In D.7.3.1 [depr.ostrstream.cons] paragraph 2 and D.7.4.1 [depr.strstream.cons] +

In D.7.3.1 [depr.ostrstream.cons] paragraph 2 and D.7.4.1 [depr.strstream.cons] paragraph 2, change the first condition to (mode&app)==0 and the second condition to (mode&app)!=0.


-

117. basic_ostream uses nonexistent num_put member functions

Section: 27.6.2.5.2 [lib.ostream.inserters.arithmetic]  Status: WP  Submitter: Matt Austern  Date: 20 Nov 1998

+

117. basic_ostream uses nonexistent num_put member functions

Section: 27.6.2.5.2 [lib.ostream.inserters.arithmetic]  Status: WP  Submitter: Matt Austern  Date: 20 Nov 1998

The effects clause for numeric inserters says that insertion of a value x, whose type is either bool, short, unsigned short, int, unsigned @@ -3220,7 +3218,7 @@ functions that are actually there. I prefer the latter.

-The classes num_get<> and num_put<> handle locale­dependent numeric +The classes num_get<> and num_put<> handle locale­dependent numeric formatting and parsing. These inserter functions use the imbued locale value to perform numeric formatting. When val is of type bool, long, unsigned long, double, long double, or const void*, the @@ -3228,8 +3226,7 @@ formatting conversion occurs as if it performed the following code fragment:

-
-bool failed = use_facet<
+
bool failed = use_facet<
    num_put<charT,ostreambuf_iterator<charT,traits> >
    >(getloc()).put(*this, *this, fill(), val). failed();
 
@@ -3239,8 +3236,7 @@ When val is of type short the formatting conversion occurs as if it performed the following code fragment:

-
-ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
+
ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
 bool failed = use_facet<
    num_put<charT,ostreambuf_iterator<charT,traits> >
    >(getloc()).put(*this, *this, fill(),
@@ -3254,8 +3250,7 @@ When val is of type int the formatting conversion occurs as if it performed
 the following code fragment:
 

-
-ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
+
ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
 bool failed = use_facet<
    num_put<charT,ostreambuf_iterator<charT,traits> >
    >(getloc()).put(*this, *this, fill(),
@@ -3269,8 +3264,7 @@ When val is of type unsigned short or unsigned int the formatting conversion
 occurs as if it performed the following code fragment:
 

-
-bool failed = use_facet<
+
bool failed = use_facet<
    num_put<charT,ostreambuf_iterator<charT,traits> >
    >(getloc()).put(*this, *this, fill(), static_cast<unsigned long>(val)).
 failed();
@@ -3281,8 +3275,7 @@ When val is of type float the formatting conversion occurs as if it
 performed the following code fragment:
 

-
-bool failed = use_facet<
+
bool failed = use_facet<
    num_put<charT,ostreambuf_iterator<charT,traits> >
    >(getloc()).put(*this, *this, fill(), static_cast<double>(val)).
 failed();
@@ -3302,7 +3295,7 @@ complicated, but gives more expected results for hex and octal output
 of signed short and signed int.  (On a system with 16-bit short, for
 example, printing short(-1) in hex format should yield 0xffff.)


-

118. basic_istream uses nonexistent num_get member functions

Section: 27.6.1.2.2 [lib.istream.formatted.arithmetic]  Status: WP  Submitter: Matt Austern  Date: 20 Nov 1998

+

118. basic_istream uses nonexistent num_get member functions

Section: 27.6.1.2.2 [lib.istream.formatted.arithmetic]  Status: WP  Submitter: Matt Austern  Date: 20 Nov 1998

Formatted input is defined for the types short, unsigned short, int, unsigned int, long, unsigned long, float, double, long double, bool, and void*. According to section 27.6.1.2.2, @@ -3313,7 +3306,7 @@ iostate err = 0; use_facet< numget >(loc).get(*this, 0, *this, err, val); setstate(err);

-

According to section 22.2.2.1.1 [lib.facet.num.get.members], however, +

According to section 22.2.2.1.1 [lib.facet.num.get.members], however, num_get<>::get() is only overloaded for the types bool, long, unsigned short, unsigned int, unsigned long, unsigned long, @@ -3322,7 +3315,7 @@ int, unsigned long, unsigned long, that 27.6.1.2.2 is using a nonexistent function for types short and int.

Proposed resolution:

-

In 27.6.1.2.2 [lib.istream.formatted.arithmetic] Arithmetic Extractors, remove the +

In 27.6.1.2.2 [lib.istream.formatted.arithmetic] Arithmetic Extractors, remove the two lines (1st and 3rd) which read:

operator>>(short& val);
@@ -3359,8 +3352,8 @@ operator>>(int& val);

[Post-Tokyo: PJP provided the above wording.]


-

119. Should virtual functions be allowed to strengthen the exception specification?

Section: 17.4.4.8 [lib.res.on.exception.handling]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

-

Section 17.4.4.8 [lib.res.on.exception.handling] states:

+

119. Should virtual functions be allowed to strengthen the exception specification?

Section: 17.4.4.8 [lib.res.on.exception.handling]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

+

Section 17.4.4.8 [lib.res.on.exception.handling] states:

"An implementation may strengthen the exception-specification for a function by removing listed exceptions."

@@ -3382,7 +3375,7 @@ public: // overridden virtual function ios_base::failure::~failure() };

Proposed resolution:

-

Change Section 17.4.4.8 [lib.res.on.exception.handling] from:

+

Change Section 17.4.4.8 [lib.res.on.exception.handling] from:

     "may strengthen the exception-specification for a function"

@@ -3392,7 +3385,7 @@ exception-specification for a function"

     "may strengthen the exception-specification for a non-virtual function".


-

120. Can an implementor add specializations?

Section: 17.4.3.1 [lib.reserved.names]  Status: WP  Submitter: Judy Ward  Date: 15 Dec 1998

+

120. Can an implementor add specializations?

Section: 17.4.3.1 [lib.reserved.names]  Status: WP  Submitter: Judy Ward  Date: 15 Dec 1998

The original issue asked whether a library implementor could specialize standard library templates for built-in types. (This was @@ -3437,7 +3430,7 @@ special: the "undefined behavior" that results from having two different explicit instantiations might be harmless.

Proposed resolution:

-

Append to 17.4.3.1 [lib.reserved.names] paragraph 1:

+

Append to 17.4.3.1 [lib.reserved.names] paragraph 1:

A program may explicitly instantiate any templates in the standard library only if the declaration depends on the name of a user-defined @@ -3453,7 +3446,7 @@ different explicit instantiations might be harmless.

In light of the resolution to core issue 259, no normative changes in the library clauses are necessary. Add the following non-normative - note to the end of 17.4.3.1 [lib.reserved.names] paragraph 1:

+ note to the end of 17.4.3.1 [lib.reserved.names] paragraph 1:

[Note: A program may explicitly instantiate standard library templates, even when an explicit instantiation does not depend on @@ -3492,7 +3485,7 @@ different explicit instantiations might be harmless.

linking. If there are such changes in the future, it may be appropriate to revisit this issue later.


-

122. streambuf/wstreambuf description should not say they are specializations

Section: 27.5.2 [lib.streambuf]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

+

122. streambuf/wstreambuf description should not say they are specializations

Section: 27.5.2 [lib.streambuf]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

Section 27.5.2 describes the streambuf classes this way:

@@ -3509,95 +3502,85 @@ specialized for the type wchar_t.

It doesn't seem this was intended, since Section 27.5 has them declared as typedefs.

Proposed resolution:

-

Remove 27.5.2 [lib.streambuf] paragraphs 2 and 3 (the above two +

Remove 27.5.2 [lib.streambuf] paragraphs 2 and 3 (the above two sentences).

Rationale:

The streambuf synopsis already has a declaration for the typedefs and that is sufficient.


-

123. Should valarray helper arrays fill functions be const?

Section: 26.3.5.4 [lib.slice.arr.fill], 26.3.7.4 [lib.gslice.array.fill], 26.3.8.4 [lib.mask.array.fill], 26.3.9.4 [lib.indirect.array.fill]  Status: WP  Submitter: Judy Ward  Date: 15 Dec 1998

+

123. Should valarray helper arrays fill functions be const?

Section: 26.3.5.4 [lib.slice.arr.fill], 26.3.7.4 [lib.gslice.array.fill], 26.3.8.4 [lib.mask.array.fill], 26.3.9.4 [lib.indirect.array.fill]  Status: WP  Submitter: Judy Ward  Date: 15 Dec 1998

One of the operator= in the valarray helper arrays is const and one is not. For example, look at slice_array. This operator= in Section -26.3.5.2 [lib.slice.arr.assign] is const:

+26.3.5.2 [lib.slice.arr.assign] is const:

    void operator=(const valarray<T>&) const;

-

but this one in Section 26.3.5.4 [lib.slice.arr.fill] is not:

+

but this one in Section 26.3.5.4 [lib.slice.arr.fill] is not:

    void operator=(const T&);

The description of the semantics for these two functions is similar.

Proposed resolution:

-

26.3.5 [lib.template.slice.array] Template class slice_array

+

26.3.5 [lib.template.slice.array] Template class slice_array

In the class template definition for slice_array, replace the member function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

with

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.5.4 [lib.slice.arr.fill] slice_array fill function

+

26.3.5.4 [lib.slice.arr.fill] slice_array fill function

Change the function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

to

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.7 [lib.template.gslice.array] Template class gslice_array

+

26.3.7 [lib.template.gslice.array] Template class gslice_array

In the class template definition for gslice_array, replace the member function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

with

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.7.4 [lib.gslice.array.fill] gslice_array fill function

+

26.3.7.4 [lib.gslice.array.fill] gslice_array fill function

Change the function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

to

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.8 [lib.template.mask.array] Template class mask_array

+

26.3.8 [lib.template.mask.array] Template class mask_array

In the class template definition for mask_array, replace the member function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

with

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.8.4 [lib.mask.array.fill] mask_array fill function

+

26.3.8.4 [lib.mask.array.fill] mask_array fill function

Change the function declaration

@@ -3605,35 +3588,30 @@ is not. For example, look at slice_array. This operator= in Section void operator=(const T&);

to

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.9 [lib.template.indirect.array] Template class indirect_array

+

26.3.9 [lib.template.indirect.array] Template class indirect_array

In the class template definition for indirect_array, replace the member function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

with

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
-

26.3.9.4 [lib.indirect.array.fill] indirect_array fill function

+

26.3.9.4 [lib.indirect.array.fill] indirect_array fill function

Change the function declaration

-
-      void operator=(const T&);
+    
      void operator=(const T&);
     

to

-
-      void operator=(const T&) const;
+    
      void operator=(const T&) const;
     
@@ -3642,32 +3620,32 @@ is not. For example, look at slice_array. This operator= in Section

Rationale:

There's no good reason for one version of operator= being const and -another one not. Because of issue 253, this now +another one not. Because of issue 253, this now matters: these functions are now callable in more circumstances. In many existing implementations, both versions are already const.


-

124. ctype_byname<charT>::do_scan_is & do_scan_not return type should be const charT*

Section: 22.2.1.2 [lib.locale.ctype.byname]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

-

In Section 22.2.1.2 [lib.locale.ctype.byname] +

124. ctype_byname<charT>::do_scan_is & do_scan_not return type should be const charT*

Section: 22.2.1.2 [lib.locale.ctype.byname]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

+

In Section 22.2.1.2 [lib.locale.ctype.byname] ctype_byname<charT>::do_scan_is() and do_scan_not() are declared to return a const char* not a const charT*.

Proposed resolution:

-

Change Section 22.2.1.2 [lib.locale.ctype.byname] do_scan_is() and +

Change Section 22.2.1.2 [lib.locale.ctype.byname] do_scan_is() and do_scan_not() to return a const charT*.


-

125. valarray<T>::operator!() return type is inconsistent

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 +

125. valarray<T>::operator!() return type is inconsistent

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.

Proposed resolution:

-

Change in Section 26.3.2 [lib.template.valarray] the declaration of +

Change in Section 26.3.2 [lib.template.valarray] the declaration of operator!() so that the return type is valarray<bool>.


-

126. typos in Effects clause of ctype::do_narrow()

Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

+

126. typos in Effects clause of ctype::do_narrow()

Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: TC  Submitter: Judy Ward  Date: 15 Dec 1998

Typos in 22.2.1.1.2 need to be fixed.

Proposed resolution:

-

In Section 22.2.1.1.2 [lib.locale.ctype.virtuals] change:

+

In Section 22.2.1.1.2 [lib.locale.ctype.virtuals] change:

   do_widen(do_narrow(c),0) == c
@@ -3683,7 +3661,7 @@ latter appears to be correct.

   (is(M,c) || !ctc.is(M, do_narrow(c,dfault)) )

-

127. auto_ptr<> conversion issues

Section: 20.4.5 [lib.auto.ptr]  Status: TC  Submitter: Greg Colvin  Date: 17 Feb 1999

+

127. auto_ptr<> conversion issues

Section: 20.4.5 [lib.auto.ptr]  Status: TC  Submitter: Greg Colvin  Date: 17 Feb 1999

There are two problems with the current auto_ptr wording in the standard:

@@ -3720,23 +3698,23 @@ object parameter may be bound to an rvalue [13.3.3.1.4/3]

Tokyo: The LWG removed the following from the proposed resolution:

-

In 20.4.5 [lib.auto.ptr], paragraph 2, and 20.4.5.3 [lib.auto.ptr.conv], +

In 20.4.5 [lib.auto.ptr], paragraph 2, and 20.4.5.3 [lib.auto.ptr.conv], paragraph 2, make the conversion to auto_ptr_ref const:

template<class Y> operator auto_ptr_ref<Y>() const throw();

Proposed resolution:

-

In 20.4.5 [lib.auto.ptr], paragraph 2, move +

In 20.4.5 [lib.auto.ptr], paragraph 2, move the auto_ptr_ref definition to namespace scope.

-

In 20.4.5 [lib.auto.ptr], paragraph 2, add +

In 20.4.5 [lib.auto.ptr], paragraph 2, add a public assignment operator to the auto_ptr definition:

auto_ptr& operator=(auto_ptr_ref<X> r) throw();
-

Also add the assignment operator to 20.4.5.3 [lib.auto.ptr.conv]:

+

Also add the assignment operator to 20.4.5.3 [lib.auto.ptr.conv]:

auto_ptr& operator=(auto_ptr_ref<X> r) throw()
@@ -3747,7 +3725,7 @@ a public assignment operator to the auto_ptr definition:


-

129. Need error indication from seekp() and seekg()

Section: 27.6.1.3 [lib.istream.unformatted], 27.6.2.4 [lib.ostream.seeks]  Status: TC  Submitter: Angelika Langer  Date: 22 Feb 1999

+

129. Need error indication from seekp() and seekg()

Section: 27.6.1.3 [lib.istream.unformatted], 27.6.2.4 [lib.ostream.seeks]  Status: TC  Submitter: Angelika Langer  Date: 22 Feb 1999

Currently, the standard does not specify how seekg() and seekp() indicate failure. They are not required to set failbit, and they can't return an error indication because they must return *this, i.e. the @@ -3760,8 +3738,8 @@ stream must perform a state-dependent code conversion, etc.

stream state in case of failure.

Proposed resolution:

Add to the Effects: clause of  seekg() in -27.6.1.3 [lib.istream.unformatted] and to the Effects: clause of seekp() in -27.6.2.4 [lib.ostream.seeks]:

+27.6.1.3 [lib.istream.unformatted] and to the Effects: clause of seekp() in +27.6.2.4 [lib.ostream.seeks]:

In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure). @@ -3770,7 +3748,7 @@ stream state in case of failure.

Rationale:

Setting failbit is the usual error reporting mechanism for streams


-

132. list::resize description uses random access iterators

Section: 23.2.2.2 [lib.list.capacity]  Status: TC  Submitter: Howard Hinnant  Date: 6 Mar 1999

+

132. list::resize description uses random access iterators

Section: 23.2.2.2 [lib.list.capacity]  Status: TC  Submitter: Howard Hinnant  Date: 6 Mar 1999

The description reads:

-1- Effects:

@@ -3801,22 +3779,22 @@ stream state in case of failure.

with David Abrahams. They had a discussion and believe there is no issue of exception safety with the proposed resolution.]


-

133. map missing get_allocator()

Section: 23.3.1 [lib.map]  Status: TC  Submitter: Howard Hinnant  Date: 6 Mar 1999

+

133. map missing get_allocator()

Section: 23.3.1 [lib.map]  Status: TC  Submitter: Howard Hinnant  Date: 6 Mar 1999

The title says it all.

Proposed resolution:

-

Insert in 23.3.1 [lib.map], paragraph 2, +

Insert in 23.3.1 [lib.map], paragraph 2, after operator= in the map declaration:

    allocator_type get_allocator() const;

-

134. vector constructors over specified

Section: 23.2.4.1 [lib.vector.cons]  Status: TC  Submitter: Howard Hinnant  Date: 6 Mar 1999

+

134. vector constructors over specified

Section: 23.2.4.1 [lib.vector.cons]  Status: TC  Submitter: Howard Hinnant  Date: 6 Mar 1999

The complexity description says: "It does at most 2N calls to the copy constructor of T and logN reallocations if they are just input iterators ...".

This appears to be overly restrictive, dictating the precise memory/performance tradeoff for the implementor.

Proposed resolution:

-

Change 23.2.4.1 [lib.vector.cons], paragraph 1 to:

+

Change 23.2.4.1 [lib.vector.cons], paragraph 1 to:

-1- Complexity: The constructor template <class InputIterator> vector(InputIterator first, InputIterator last) @@ -3831,7 +3809,7 @@ order logN reallocations if they are just input iterators. is greater than or equal to 2.


-

136. seekp, seekg setting wrong streams?

Section: 27.6.1.3 [lib.istream.unformatted]  Status: WP  Submitter: Howard Hinnant  Date: 6 Mar 1999

+

136. seekp, seekg setting wrong streams?

Section: 27.6.1.3 [lib.istream.unformatted]  Status: WP  Submitter: Howard Hinnant  Date: 6 Mar 1999

I may be misunderstanding the intent, but should not seekg set only the input stream and seekp set only the output stream? The description seems to say that each should set both input and output streams. If @@ -3873,7 +3851,7 @@ Effects: If fail() != true, executes rdbuf()->pubseekoff(off, dir, ios_base::

-4- Effects: If fail() != true, executes rdbuf()->pubseekoff(off, dir, ios_base::out). 
-

[Dublin: Dietmar Kühl thinks this is probably correct, but would +

[Dublin: Dietmar Kühl thinks this is probably correct, but would like the opinion of more iostream experts before taking action.]

[Tokyo: Reviewed by the LWG. PJP noted that although his docs are @@ -3892,8 +3870,8 @@ This requirement is a bit weird. There's no similar requirement for basic_streambuf<>::seekpos, or for basic_filebuf<>::seekoff or basic_filebuf<>::seekpos.]


-

137. Do use_facet and has_facet look in the global locale?

Section: 22.1.1 [lib.locale]  Status: TC  Submitter: Angelika Langer  Date: 17 Mar 1999

-

Section 22.1.1 [lib.locale] says:

+

137. Do use_facet and has_facet look in the global locale?

Section: 22.1.1 [lib.locale]  Status: TC  Submitter: Angelika Langer  Date: 17 Mar 1999

+

Section 22.1.1 [lib.locale] says:

-4- In the call to use_facet<Facet>(loc), the type argument chooses a facet, making available all members of the named type. If @@ -3903,7 +3881,7 @@ check if a locale implements a particular facet with the template function has_facet<Facet>().

This contradicts the specification given in section -22.1.2 [lib.locale.global.templates]: +22.1.2 [lib.locale.global.templates]:

template <class  Facet> const  Facet& use_facet(const locale&  loc);
@@ -3920,7 +3898,7 @@ from section 22.1.1.

Needed for consistency with the way locales are handled elsewhere in the standard.


-

139. Optional sequence operation table description unclear

Section: 23.1.1 [lib.sequence.reqmts]  Status: TC  Submitter: Andrew Koenig  Date: 30 Mar 1999

+

139. Optional sequence operation table description unclear

Section: 23.1.1 [lib.sequence.reqmts]  Status: TC  Submitter: Andrew Koenig  Date: 30 Mar 1999

The sentence introducing the Optional sequence operation table (23.1.1 paragraph 12) has two problems:

@@ -3943,11 +3921,11 @@ with:

amortized constant time.


-

141. basic_string::find_last_of, find_last_not_of say pos instead of xpos

Section: 21.3.6.4 [lib.string::find.last.of], 21.3.6.6 [lib.string::find.last.not.of]  Status: TC  Submitter: Arch Robison  Date: 28 Apr 1999

+

141. basic_string::find_last_of, find_last_not_of say pos instead of xpos

Section: 21.3.6.4 [lib.string::find.last.of], 21.3.6.6 [lib.string::find.last.not.of]  Status: TC  Submitter: Arch Robison  Date: 28 Apr 1999

Sections 21.3.6.4 paragraph 1 and 21.3.6.6 paragraph 1 surely have misprints where they say:

-— xpos <= pos and pos < size();

+— xpos <= pos and pos < size();

Surely the document meant to say ``xpos < size()'' in both places.

@@ -3956,13 +3934,13 @@ proposed resolution.]

Proposed resolution:

Change Sections 21.3.6.4 paragraph 1 and 21.3.6.6 paragraph 1, the line which says:

-— xpos <= pos and pos < size();
+— xpos <= pos and pos < size();

to:

-
xpos <= pos and xpos < size();

+xpos <= pos and xpos < size();


-

142. lexicographical_compare complexity wrong

Section: 25.3.8 [lib.alg.lex.comparison]  Status: TC  Submitter: Howard Hinnant  Date: 20 Jun 1999

+

142. lexicographical_compare complexity wrong

Section: 25.3.8 [lib.alg.lex.comparison]  Status: TC  Submitter: Howard Hinnant  Date: 20 Jun 1999

The lexicographical_compare complexity is specified as:

     "At most min((last1 - first1), (last2 - first2)) @@ -3975,7 +3953,7 @@ equality you have to check both < and >? Yes, IMO you are right! (and Matt states this complexity in his book)

Proposed resolution:

-

Change 25.3.8 [lib.alg.lex.comparison] complexity to:

+

Change 25.3.8 [lib.alg.lex.comparison] complexity to:

At most 2*min((last1 - first1), (last2 - first2)) applications of the corresponding comparison. @@ -3995,7 +3973,7 @@ right! (and Matt states this complexity in his book)

--end example]

-

144. Deque constructor complexity wrong

Section: 23.2.1.1 [lib.deque.cons]  Status: TC  Submitter: Herb Sutter  Date: 9 May 1999

+

144. Deque constructor complexity wrong

Section: 23.2.1.1 [lib.deque.cons]  Status: TC  Submitter: Herb Sutter  Date: 9 May 1999

In 23.2.1.1 paragraph 6, the deque ctor that takes an iterator range appears to have complexity requirements which are incorrect, and which contradict the complexity requirements for insert(). I suspect that the text in question, @@ -4026,7 +4004,7 @@ typo):

Complexity: Makes last - first calls to the copy constructor of T.


-

146. complex<T> Inserter and Extractor need sentries

Section: 26.2.6 [lib.complex.ops]  Status: TC  Submitter: Angelika Langer  Date: 12 May 1999

+

146. complex<T> Inserter and Extractor need sentries

Section: 26.2.6 [lib.complex.ops]  Status: TC  Submitter: Angelika Langer  Date: 12 May 1999

The extractor for complex numbers is specified as: 

@@ -4083,7 +4061,7 @@ consistency with the other inserters and extractors in the library. Regarding the issue of padding in the inserter, I don't know what the intent was. 

Proposed resolution:

-

After 26.2.6 [lib.complex.ops] paragraph 14 (operator>>), add a +

After 26.2.6 [lib.complex.ops] paragraph 14 (operator>>), add a Notes clause:

@@ -4100,7 +4078,7 @@ follows an "all-or-none" rule.

For inserters, the LWG believes there is no defect; the standard is correct as written.


-

147. Library Intro refers to global functions that aren't global

Section: 17.4.4.3 [lib.global.functions]  Status: TC  Submitter: Lois Goldthwaite  Date: 4 Jun 1999

+

147. Library Intro refers to global functions that aren't global

Section: 17.4.4.3 [lib.global.functions]  Status: TC  Submitter: Lois Goldthwaite  Date: 4 Jun 1999

The library had many global functions until 17.4.1.1 [lib.contents] paragraph 2 was added:

@@ -4163,22 +4141,22 @@ Because operator new and delete are global, the proposed resolution was changed from "non-member" to "global or non-member.


-

148. Functions in the example facet BoolNames should be const

Section: 22.2.8 [lib.facets.examples]  Status: TC  Submitter: Jeremy Siek  Date: 3 Jun 1999

-

In 22.2.8 [lib.facets.examples] paragraph 13, the do_truename() and +

148. Functions in the example facet BoolNames should be const

Section: 22.2.8 [lib.facets.examples]  Status: TC  Submitter: Jeremy Siek  Date: 3 Jun 1999

+

In 22.2.8 [lib.facets.examples] paragraph 13, the do_truename() and do_falsename() functions in the example facet BoolNames should be const. The functions they are overriding in numpunct_byname<char> are const.

Proposed resolution:

-

In 22.2.8 [lib.facets.examples] paragraph 13, insert "const" in +

In 22.2.8 [lib.facets.examples] paragraph 13, insert "const" in two places:

string do_truename() const { return "Oui Oui!"; }
string do_falsename() const { return "Mais Non!"; }


-

150. Find_first_of says integer instead of iterator

Section: 25.1.4 [lib.alg.find.first.of]  Status: TC  Submitter: Matt McClure  Date: 30 Jun 1999

+

150. Find_first_of says integer instead of iterator

Section: 25.1.4 [lib.alg.find.first.of]  Status: TC  Submitter: Matt McClure  Date: 30 Jun 1999

Proposed resolution:

-

Change 25.1.4 [lib.alg.find.first.of] paragraph 2 from:

+

Change 25.1.4 [lib.alg.find.first.of] paragraph 2 from:

Returns: The first iterator i in the range [first1, last1) such @@ -4192,7 +4170,7 @@ that for some integer j in the range [first2, last2) ...

that for some iterator j in the range [first2, last2) ...


-

151. Can't currently clear() empty container

Section: 23.1.1 [lib.sequence.reqmts]  Status: TC  Submitter: Ed Brey  Date: 21 Jun 1999

+

151. Can't currently clear() empty container

Section: 23.1.1 [lib.sequence.reqmts]  Status: TC  Submitter: Ed Brey  Date: 21 Jun 1999

For both sequences and associative containers, a.clear() has the semantics of erase(a.begin(),a.end()), which is undefined for an empty container since erase(q1,q2) requires that q1 be dereferenceable @@ -4228,13 +4206,13 @@ iterators or certain kinds of iterators is unnecessary. into a


-

152. Typo in scan_is() semantics

Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

152. Typo in scan_is() semantics

Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The semantics of scan_is() (paragraphs 4 and 6) is not exactly described because there is no function is() which only takes a character as argument. Also, in the effects clause (paragraph 3), the semantic is also kept vague.

Proposed resolution:

-

In 22.2.1.1.2 [lib.locale.ctype.virtuals] paragraphs 4 and 6, change the returns +

In 22.2.1.1.2 [lib.locale.ctype.virtuals] paragraphs 4 and 6, change the returns clause from:

"... such that is(*p) @@ -4243,7 +4221,7 @@ would..."

to:  "... such that is(m, *p) would...."


-

153. Typo in narrow() semantics

Section: 22.2.1.3.2 [lib.facet.ctype.char.members]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

153. Typo in narrow() semantics

Section: 22.2.1.3.2 [lib.facet.ctype.char.members]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The description of the array version of narrow() (in paragraph 11) is flawed: There is no member do_narrow() which takes only three arguments because in addition to the range a default @@ -4254,7 +4232,7 @@ two signatures followed by a Returns clause that only addresses one of them.

Proposed resolution:

-

Change the returns clause in 22.2.1.3.2 [lib.facet.ctype.char.members] +

Change the returns clause in 22.2.1.3.2 [lib.facet.ctype.char.members] paragraph 10 from:

    Returns: do_widen(low, high, to).

@@ -4262,7 +4240,7 @@ paragraph 10 from:

    Returns: do_widen(c) or do_widen(low, high, to), respectively.

-

Change 22.2.1.3.2 [lib.facet.ctype.char.members] paragraph 10 and 11 from:

+

Change 22.2.1.3.2 [lib.facet.ctype.char.members] paragraph 10 and 11 from:

        char        narrow(char c, char /*dfault*/) const;
         const char* narrow(const char* low, const char* high,
                            char /*dfault*/, char* to) const;
@@ -4284,48 +4262,48 @@ version..." comment above. Perhaps it was a circuitous way of saying "dfault" needed to be uncommented?]

[Post-Toronto: the issues list maintainer has merged in the -proposed resolution from issue 207, which addresses the +proposed resolution from issue 207, which addresses the same paragraphs.]


154. Missing double specifier for do_get() -

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The table in paragraph 7 for the length modifier does not list the length modifier l to be applied if the type is double. Thus, the standard asks the implementation to do undefined things when using scanf() (the missing length modifier for scanf() when scanning doubles is actually a problem I found quite often in production code, too).

Proposed resolution:

-

In 22.2.2.1.2 [lib.facet.num.get.virtuals], paragraph 7, add a row in the Length +

In 22.2.2.1.2 [lib.facet.num.get.virtuals], paragraph 7, add a row in the Length Modifier table to say that for double a length modifier l is to be used.

Rationale:

The standard makes an embarrassing beginner's mistake.


155. Typo in naming the class defining the class Init -

Section: 27.3 [lib.iostream.objects]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Section: 27.3 [lib.iostream.objects]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

There are conflicting statements about where the class -Init is defined. According to 27.3 [lib.iostream.objects] paragraph 2 -it is defined as basic_ios::Init, according to 27.4.2 [lib.ios.base] it is defined as ios_base::Init.

+Init is defined. According to 27.3 [lib.iostream.objects] paragraph 2 +it is defined as basic_ios::Init, according to 27.4.2 [lib.ios.base] it is defined as ios_base::Init.

Proposed resolution:

-

Change 27.3 [lib.iostream.objects] paragraph 2 from +

Change 27.3 [lib.iostream.objects] paragraph 2 from "basic_ios::Init" to "ios_base::Init".

Rationale:

Although not strictly wrong, the standard was misleading enough to warrant the change.


-

156. Typo in imbue() description

Section: 27.4.2.3 [lib.ios.base.locales]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

156. Typo in imbue() description

Section: 27.4.2.3 [lib.ios.base.locales]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

There is a small discrepancy between the declarations of -imbue(): in 27.4.2 [lib.ios.base] the argument is passed as -locale const& (correct), in 27.4.2.3 [lib.ios.base.locales] it +imbue(): in 27.4.2 [lib.ios.base] the argument is passed as +locale const& (correct), in 27.4.2.3 [lib.ios.base.locales] it is passed as locale const (wrong).

Proposed resolution:

-

In 27.4.2.3 [lib.ios.base.locales] change the imbue argument +

In 27.4.2.3 [lib.ios.base.locales] change the imbue argument from "locale const" to "locale const&".


158. Underspecified semantics for setbuf() -

Section: 27.5.2.4.2 [lib.streambuf.virt.buffer]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Section: 27.5.2.4.2 [lib.streambuf.virt.buffer]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The default behavior of setbuf() is described only for the situation that gptr() != 0 && gptr() != egptr(): namely to do nothing. What has to be done in other situations  @@ -4337,11 +4315,11 @@ buffer management of derived classes unless these classes do it themselves, the default behavior of setbuf() should always be to do nothing.

Proposed resolution:

-

Change 27.5.2.4.2 [lib.streambuf.virt.buffer], paragraph 3, Default behavior, +

Change 27.5.2.4.2 [lib.streambuf.virt.buffer], paragraph 3, Default behavior, to: "Default behavior: Does nothing. Returns this."


-

159. Strange use of underflow() -

Section: 27.5.2.4.3 [lib.streambuf.virt.get]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

159. Strange use of underflow() +

Section: 27.5.2.4.3 [lib.streambuf.virt.get]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The description of the meaning of the result of showmanyc() seems to be rather strange: It uses calls to underflow(). Using underflow() is strange because @@ -4349,19 +4327,19 @@ this function only reads the current character but does not extract it, uflow() would extract the current character. This should be fixed to use sbumpc() instead.

Proposed resolution:

-

Change 27.5.2.4.3 [lib.streambuf.virt.get] paragraph 1, +

Change 27.5.2.4.3 [lib.streambuf.virt.get] paragraph 1, showmanyc()returns clause, by replacing the word "supplied" with the words "extracted from the stream".


160. Typo: Use of non-existing function exception() -

Section: 27.6.1.1 [lib.istream]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Section: 27.6.1.1 [lib.istream]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The paragraph 4 refers to the function exception() which is not defined. Probably, the referred function is basic_ios<>::exceptions().

Proposed resolution:

-

In 27.6.1.1 [lib.istream], 27.6.1.3 [lib.istream.unformatted], paragraph 1, -27.6.2.1 [lib.ostream], paragraph 3, and 27.6.2.5.1 [lib.ostream.formatted.reqmts], +

In 27.6.1.1 [lib.istream], 27.6.1.3 [lib.istream.unformatted], paragraph 1, +27.6.2.1 [lib.ostream], paragraph 3, and 27.6.2.5.1 [lib.ostream.formatted.reqmts], paragraph 1, change "exception()" to "exceptions()".

@@ -4369,12 +4347,12 @@ paragraph 1, change "exception()" to is the correct spelling.]


161. Typo: istream_iterator vs. istreambuf_iterator -

Section: 27.6.1.2.2 [lib.istream.formatted.arithmetic]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Section: 27.6.1.2.2 [lib.istream.formatted.arithmetic]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The note in the second paragraph pretends that the first argument is an object of type istream_iterator. This is wrong: It is an object of type istreambuf_iterator.

Proposed resolution:

-

Change 27.6.1.2.2 [lib.istream.formatted.arithmetic] from:

+

Change 27.6.1.2.2 [lib.istream.formatted.arithmetic] from:

The first argument provides an object of the istream_iterator class...

@@ -4383,8 +4361,8 @@ an object of type istreambuf_iterator.

The first argument provides an object of the istreambuf_iterator class...


-

164. do_put() has apparently unused fill argument

Section: 22.2.5.3.2 [lib.locale.time.put.virtuals]  Status: TC  Submitter: Angelika Langer  Date: 23 Jul 1999

-

In 22.2.5.3.2 [lib.locale.time.put.virtuals] the do_put() function is specified +

164. do_put() has apparently unused fill argument

Section: 22.2.5.3.2 [lib.locale.time.put.virtuals]  Status: TC  Submitter: Angelika Langer  Date: 23 Jul 1999

+

In 22.2.5.3.2 [lib.locale.time.put.virtuals] the do_put() function is specified as taking a fill character as an argument, but the description of the function does not say whether the character is used at all and, if so, in which way. The same holds for any format control parameters that @@ -4394,7 +4372,7 @@ character in any way? In any case, the specification of time_put.do_put() looks inconsistent to me.

Is the signature of do_put() wrong, or is the effects clause incomplete?

Proposed resolution:

-

Add the following note after 22.2.5.3.2 [lib.locale.time.put.virtuals] +

Add the following note after 22.2.5.3.2 [lib.locale.time.put.virtuals] paragraph 2:

[Note: the fill argument may be used in the implementation-defined formats, or by derivations. A space character is a reasonable default @@ -4405,7 +4383,7 @@ paragraph 2:

users need some guidance on what to pass for the fill argument since the standard doesn't say how it's used.


-

165. xsputn(), pubsync() never called by basic_ostream members?

Section: 27.6.2.1 [lib.ostream]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

165. xsputn(), pubsync() never called by basic_ostream members?

Section: 27.6.2.1 [lib.ostream]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

Paragraph 2 explicitly states that none of the basic_ostream functions falling into one of the groups "formatted output functions" and "unformatted output functions" calls any stream buffer function @@ -4452,7 +4430,7 @@ called from what functions and eg to state specifically that flush() is allowed to call sync() while other functions are not.]


167. Improper use of traits_type::length() -

Section: 27.6.2.5.4 [lib.ostream.inserters.character]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Section: 27.6.2.5.4 [lib.ostream.inserters.character]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

Paragraph 4 states that the length is determined using traits::length(s). Unfortunately, this function is not defined for example if the character type is wchar_t and the @@ -4461,7 +4439,7 @@ the character type is char and the type of s is either signed char const* or unsigned char const*.

Proposed resolution:

-

Change 27.6.2.5.4 [lib.ostream.inserters.character] paragraph 4 from:

+

Change 27.6.2.5.4 [lib.ostream.inserters.character] paragraph 4 from:

Effects: Behaves like an formatted inserter (as described in lib.ostream.formatted.reqmts) of out. After a sentry object is @@ -4516,12 +4494,12 @@ traits class for some arbitrary charT type, and we somehow have to deal with a const char*. There's nothing better to do but fall back to char_traits<char>


-

168. Typo: formatted vs. unformatted

Section: 27.6.2.6 [lib.ostream.unformatted]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

168. Typo: formatted vs. unformatted

Section: 27.6.2.6 [lib.ostream.unformatted]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The first paragraph begins with a descriptions what has to be done in formatted output functions. Probably this is a typo and the paragraph really want to describe unformatted output functions...

Proposed resolution:

-

In 27.6.2.6 [lib.ostream.unformatted] paragraph 1, the first and last +

In 27.6.2.6 [lib.ostream.unformatted] paragraph 1, the first and last sentences, change the word "formatted" to "unformatted":

@@ -4530,18 +4508,18 @@ sentences, change the word "formatted" to function."


-

169. Bad efficiency of overflow() mandated

Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

169. Bad efficiency of overflow() mandated

Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

Paragraph 8, Notes, of this section seems to mandate an extremely inefficient way of buffer handling for basic_stringbuf, especially in view of the restriction that basic_ostream -member functions are not allowed to use xsputn() (see 27.6.2.1 [lib.ostream]): For each character to be inserted, a new buffer +member functions are not allowed to use xsputn() (see 27.6.2.1 [lib.ostream]): For each character to be inserted, a new buffer is to be created.

Of course, the resolution below requires some handling of simultaneous input and output since it is no longer possible to update egptr() whenever epptr() is changed. A possible solution is to handle this in underflow().

Proposed resolution:

-

In 27.7.1.3 [lib.stringbuf.virtuals] paragraph 8, Notes, insert the words +

In 27.7.1.3 [lib.stringbuf.virtuals] paragraph 8, Notes, insert the words "at least" as in the following:

To make a write position available, the function reallocates (or initially @@ -4551,23 +4529,23 @@ solution is to handle this in underflow().


170. Inconsistent definition of traits_type -

Section: 27.7.4 [lib.stringstream]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

-

The classes basic_stringstream (27.7.4 [lib.stringstream]), -basic_istringstream (27.7.2 [lib.istringstream]), and -basic_ostringstream (27.7.3 [lib.ostringstream]) are inconsistent +

Section: 27.7.4 [lib.stringstream]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

The classes basic_stringstream (27.7.4 [lib.stringstream]), +basic_istringstream (27.7.2 [lib.istringstream]), and +basic_ostringstream (27.7.3 [lib.ostringstream]) are inconsistent in their definition of the type traits_type: For istringstream, this type is defined, for the other two it is not. This should be consistent.

Proposed resolution:

Proposed resolution:

To the declarations of -basic_ostringstream (27.7.3 [lib.ostringstream]) and -basic_stringstream (27.7.4 [lib.stringstream]) add:

+basic_ostringstream (27.7.3 [lib.ostringstream]) and +basic_stringstream (27.7.4 [lib.stringstream]) add:

typedef traits traits_type;

-

171. Strange seekpos() semantics due to joint position

Section: 27.8.1.4 [lib.filebuf.virtuals]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

-

Overridden virtual functions, seekpos()

In 27.8.1.1 [lib.filebuf] paragraph 3, it is stated that a joint input and +

171. Strange seekpos() semantics due to joint position

Section: 27.8.1.4 [lib.filebuf.virtuals]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Jul 1999

+

Overridden virtual functions, seekpos()

In 27.8.1.1 [lib.filebuf] paragraph 3, it is stated that a joint input and output position is maintained by basic_filebuf. Still, the description of seekpos() seems to talk about different file positions. In particular, it is unclear (at least to me) what is @@ -4619,17 +4597,17 @@ paragraph 14 from:

[Post-Tokyo: Dietmar supplied the above wording.]


172. Inconsistent types for basic_istream::ignore() -

Section: 27.6.1.3 [lib.istream.unformatted]  Status: TC  Submitter: Greg Comeau, Dietmar Kühl  Date: 23 Jul 1999

-

In 27.6.1.1 [lib.istream] the function +

Section: 27.6.1.3 [lib.istream.unformatted]  Status: TC  Submitter: Greg Comeau, Dietmar Kühl  Date: 23 Jul 1999

+

In 27.6.1.1 [lib.istream] the function ignore() gets an object of type streamsize as first -argument. However, in 27.6.1.3 [lib.istream.unformatted] +argument. However, in 27.6.1.3 [lib.istream.unformatted] paragraph 23 the first argument is of type int.

As far as I can see this is not really a contradiction because everything is consistent if streamsize is typedef to be int. However, this is almost certainly not what was intended. The same thing happened to basic_filebuf::setbuf(), -as described in issue 173.

+as described in issue 173.

Darin Adler also submitted this issue, commenting: Either 27.6.1.1 should be modified @@ -4637,17 +4615,17 @@ to show a first parameter of type int, or 27.6.1.3 should be modified to show a first parameter of type streamsize and use numeric_limits<streamsize>::max.

Proposed resolution:

-

In 27.6.1.3 [lib.istream.unformatted] paragraph 23 and 24, change both uses +

In 27.6.1.3 [lib.istream.unformatted] paragraph 23 and 24, change both uses of int in the description of ignore() to streamsize.


173. Inconsistent types for basic_filebuf::setbuf() -

Section: 27.8.1.4 [lib.filebuf.virtuals]  Status: TC  Submitter: Greg Comeau, Dietmar Kühl  Date: 23 Jul 1999

+

Section: 27.8.1.4 [lib.filebuf.virtuals]  Status: TC  Submitter: Greg Comeau, Dietmar Kühl  Date: 23 Jul 1999

-In 27.8.1.1 [lib.filebuf] the function setbuf() gets an +In 27.8.1.1 [lib.filebuf] the function setbuf() gets an object of type streamsize as second argument. However, in -27.8.1.4 [lib.filebuf.virtuals] paragraph 9 the second argument is of type +27.8.1.4 [lib.filebuf.virtuals] paragraph 9 the second argument is of type int.

@@ -4656,25 +4634,25 @@ As far as I can see this is not really a contradiction because everything is consistent if streamsize is typedef to be int. However, this is almost certainly not what was intended. The same thing happened to basic_istream::ignore(), -as described in issue 172. +as described in issue 172.

Proposed resolution:

-

In 27.8.1.4 [lib.filebuf.virtuals] paragraph 9, change all uses of +

In 27.8.1.4 [lib.filebuf.virtuals] paragraph 9, change all uses of int in the description of setbuf() to streamsize.


174. Typo: OFF_T vs. POS_T -

Section: D.6 [depr.ios.members]  Status: TC  Submitter: Dietmar Kühl  Date: 23 Jul 1999

+

Section: D.6 [depr.ios.members]  Status: TC  Submitter: Dietmar Kühl  Date: 23 Jul 1999

According to paragraph 1 of this section, streampos is the type OFF_T, the same type as streamoff. However, in paragraph 6 the streampos gets the type POS_T

Proposed resolution:

-

Change D.6 [depr.ios.members] paragraph 1 from "typedef +

Change D.6 [depr.ios.members] paragraph 1 from "typedef OFF_T streampos;" to "typedef POS_T streampos;"


-

175. Ambiguity for basic_streambuf::pubseekpos() and a few other functions.

Section: D.6 [depr.ios.members]  Status: TC  Submitter: Dietmar Kühl  Date: 23 Jul 1999

+

175. Ambiguity for basic_streambuf::pubseekpos() and a few other functions.

Section: D.6 [depr.ios.members]  Status: TC  Submitter: Dietmar Kühl  Date: 23 Jul 1999

According to paragraph 8 of this section, the methods basic_streambuf::pubseekpos(), basic_ifstream::open(), and basic_ofstream::open @@ -4687,23 +4665,23 @@ three cases. However, this generates an ambiguity with the overloaded version because now the arguments are absolutely identical if the last argument is not specified.

Proposed resolution:

-

In D.6 [depr.ios.members] paragraph 8, remove the default arguments for +

In D.6 [depr.ios.members] paragraph 8, remove the default arguments for basic_streambuf::pubseekpos(), basic_ifstream::open(), and basic_ofstream::open().


-

176. exceptions() in ios_base...?

Section: D.6 [depr.ios.members]  Status: TC  Submitter: Dietmar Kühl  Date: 23 Jul 1999

+

176. exceptions() in ios_base...?

Section: D.6 [depr.ios.members]  Status: TC  Submitter: Dietmar Kühl  Date: 23 Jul 1999

The "overload" for the function exceptions() in paragraph 8 gives the impression that there is another function of this function defined in class ios_base. However, this is not the case. Thus, it is hard to tell how the semantics (paragraph 9) can be implemented: "Call the corresponding member function specified -in clause 27 [lib.input.output]."

+in clause 27 [lib.input.output]."

Proposed resolution:

-

In D.6 [depr.ios.members] paragraph 8, move the declaration of the +

In D.6 [depr.ios.members] paragraph 8, move the declaration of the function exceptions()into class basic_ios.


-

179. Comparison of const_iterators to iterators doesn't work

Section: 23.1 [lib.container.requirements]  Status: WP  Submitter: Judy Ward  Date: 2 Jul 1998

+

179. Comparison of const_iterators to iterators doesn't work

Section: 23.1 [lib.container.requirements]  Status: WP  Submitter: Judy Ward  Date: 2 Jul 1998

Currently the following will not compile on two well-known standard library implementations:

@@ -4755,8 +4733,7 @@ return i == ci; The fix is to make the comparison operators templated on two types.

-
-    template <class Iterator1, class Iterator2>
+    
    template <class Iterator1, class Iterator2>
     bool operator== (reverse_iterator<Iterator1> const& x,
                      reverse_iterator<Iterator2> const& y);
     
@@ -4777,11 +4754,10 @@ return i == ci;

Proposed resolution:

-

Insert this paragraph after 23.1 [lib.container.requirements] paragraph 7:

+

Insert this paragraph after 23.1 [lib.container.requirements] paragraph 7:

In the expressions

-
-    i == j
+  
    i == j
     i != j
     i < j
     i <= j
@@ -4809,10 +4785,10 @@ the nested types X::iterator and X::const_iterator,
 where X is a container.  There is no requirement that
 X::reverse_iterator and X::const_reverse_iterator
 can be mixed.  If mixing them is considered important, that's a
-separate issue.  (Issue 280.)
+separate issue.  (Issue 280.)
 


-

181. make_pair() unintended behavior

Section: 20.2.2 [lib.pairs]  Status: TC  Submitter: Andrew Koenig  Date: 3 Aug 1999

+

181. make_pair() unintended behavior

Section: 20.2.2 [lib.pairs]  Status: TC  Submitter: Andrew Koenig  Date: 3 Aug 1999

The claim has surfaced in Usenet that expressions such as

       make_pair("abc", 3)
@@ -4823,7 +4799,7 @@ parameter to const char (&)[4], which type is uncopyable.
I doubt anyone intended that behavior...

Proposed resolution:

-

In 20.2 [lib.utility], paragraph 1 change the following +

In 20.2 [lib.utility], paragraph 1 change the following declaration of make_pair():

template <class T1, class T2> pair<T1,T2> make_pair(const T1&, const T2&);
@@ -4832,7 +4808,7 @@ declaration of make_pair():

template <class T1, class T2> pair<T1,T2> make_pair(T1, T2);
-

In 20.2.2 [lib.pairs] paragraph 7 and the line before, change:

+

In 20.2.2 [lib.pairs] paragraph 7 and the line before, change:

template <class T1, class T2>
 pair<T1, T2> make_pair(const T1& x, const T2& y);
@@ -4850,7 +4826,7 @@ pair<T1, T2> make_pair(T1 x, T2 y);

Rationale:

Two potential fixes were suggested by Matt Austern and Dietmar -Kühl, respectively, 1) overloading with array arguments, and 2) use of +Kühl, respectively, 1) overloading with array arguments, and 2) use of a reference_traits class with a specialization for arrays. Andy Koenig suggested changing to pass by value. In discussion, it appeared that this was a much smaller change to the standard that the other two @@ -4858,18 +4834,18 @@ suggestions, and any efficiency concerns were more than offset by the advantages of the solution. Two implementors reported that the proposed resolution passed their test suites.


-

182. Ambiguous references to size_t

Section: 17 [lib.library]  Status: WP  Submitter: Al Stevens  Date: 15 Aug 1999

+

182. Ambiguous references to size_t

Section: 17 [lib.library]  Status: WP  Submitter: Al Stevens  Date: 15 Aug 1999

Many references to size_t throughout the document omit the std:: namespace qualification.

For -example, 17.4.3.4 [lib.replacement.functions] paragraph 2:

+example, 17.4.3.4 [lib.replacement.functions] paragraph 2:

-
— operator new(size_t)
-— operator new(size_t, const std::nothrow_t&)
-— operator new[](size_t)
-— operator new[](size_t, const std::nothrow_t&)
+
— operator new(size_t)
+— operator new(size_t, const std::nothrow_t&)
+— operator new[](size_t)
+— operator new[](size_t, const std::nothrow_t&)

Proposed resolution:

-

In 17.4.3.4 [lib.replacement.functions] paragraph 2: replace:

+

In 17.4.3.4 [lib.replacement.functions] paragraph 2: replace:

- operator new(size_t)
- operator new(size_t, const std::nothrow_t&)
@@ -4932,7 +4908,8 @@ X::length(p): "size_t" by "std::size_t".

    typedef ptrdiff_t difference_type;
by:
    typedef std::ptrdiff_t difference_type;

-

In [lib.locale.ctype] 22.2.1.1 put namespace std { ...} around the declaration of template <class charT> class ctype.
+

In [lib.locale.ctype] 22.2.1.1 put namespace std { ...} around the +declaration of template <class charT> class ctype.

In [lib.iterator.traits] 24.3.1, paragraph 2 put namespace std { ...} around the declaration of:

@@ -4943,7 +4920,7 @@ X::length(p): "size_t" by "std::size_t".

The LWG believes correcting names like size_t and ptrdiff_t to std::size_t and std::ptrdiff_t to be essentially editorial. There there can't be another size_t or -ptrdiff_t meant anyway because, according to 17.4.3.1.4 [lib.extern.types],

+ptrdiff_t meant anyway because, according to 17.4.3.1.4 [lib.extern.types],

For each type T from the Standard C library, the types ::T and std::T @@ -4957,7 +4934,7 @@ Editor's authority to make this change.

[Post-Tokyo: Nico Josuttis provided the above wording at the request of the LWG.]

-

[Toronto: This is tangentially related to issue 229, but only tangentially: the intent of this issue is to +

[Toronto: This is tangentially related to issue 229, but only tangentially: the intent of this issue is to address use of the name size_t in contexts outside of namespace std, such as in the description of ::operator new. The proposed changes should be reviewed to make sure they are @@ -4967,8 +4944,8 @@ correct.]

them to be correct.]


-

183. I/O stream manipulators don't work for wide character streams

Section: 27.6.3 [lib.std.manip]  Status: WP  Submitter: Andy Sawyer  Date: 7 Jul 1999

-

27.6.3 [lib.std.manip] paragraph 3 says (clause numbering added for +

183. I/O stream manipulators don't work for wide character streams

Section: 27.6.3 [lib.std.manip]  Status: WP  Submitter: Andy Sawyer  Date: 7 Jul 1999

+

27.6.3 [lib.std.manip] paragraph 3 says (clause numbering added for exposition):

Returns: An object s of unspecified type such that if [1] out is an (instance @@ -4996,21 +4973,31 @@ ostreams.

that the value of the expression is "the same specialization of basic_ostream as out"&

Proposed resolution:

-

Replace section 27.6.3 [lib.std.manip] except paragraph 1 with the +

Replace section 27.6.3 [lib.std.manip] except paragraph 1 with the following:

-

2- The type designated smanip in each of the following function descriptions is implementation-specified and may be different for each +

2- The type designated smanip in each of the following function +descriptions is implementation-specified and may be different for each function.

smanip resetiosflags(ios_base::fmtflags mask);

--3- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves -as if f(s, mask) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if +-3- Returns: An object s of unspecified type such that if out is an +instance of basic_ostream<charT,traits> then the expression +out<<s behaves +as if f(s, mask) were called, or if in is an instance of +basic_istream<charT,traits> then the expression in>>s +behaves as if f(s, mask) were called. The function f can be defined as:*

-[Footnote: The expression cin >> resetiosflags(ios_base::skipws) clears ios_base::skipws in the format flags stored in the -basic_istream<charT,traits> object cin (the same as cin >> noskipws), and the expression cout << resetiosflags(ios_base::showbase) clears -ios_base::showbase in the format flags stored in the basic_ostream<charT,traits> object cout (the same as cout << +[Footnote: The expression cin >> resetiosflags(ios_base::skipws) +clears ios_base::skipws in the format flags stored in the +basic_istream<charT,traits> object cin (the same as cin >> +noskipws), and the expression cout << +resetiosflags(ios_base::showbase) clears +ios_base::showbase in the format flags stored in the +basic_ostream<charT,traits> object cout (the same as cout +<< noshowbase). --- end footnote]

     ios_base& f(ios_base& str, ios_base::fmtflags mask)
@@ -5025,8 +5012,12 @@ The expression in>>s has type basic_istream<charT,traits>& and v
 smanip setiosflags(ios_base::fmtflags mask);

--4- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves -as if f(s, mask) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, +-4- Returns: An object s of unspecified type such that if out is an +instance of basic_ostream<charT,traits> then the expression +out<<s behaves +as if f(s, mask) were called, or if in is an instance of +basic_istream<charT,traits> then the expression in>>s +behaves as if f(s, mask) were called. The function f can be defined as:

     ios_base& f(ios_base& str, ios_base::fmtflags mask)
@@ -5041,8 +5032,12 @@ The expression in>>s has type basic_istream<charT,traits>& and v
smanip setbase(int base);

--5- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves -as if f(s, base) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, +-5- Returns: An object s of unspecified type such that if out is an +instance of basic_ostream<charT,traits> then the expression +out<<s behaves +as if f(s, base) were called, or if in is an instance of +basic_istream<charT,traits> then the expression in>>s +behaves as if f(s, base) were called. The function f can be defined as:

     ios_base& f(ios_base& str, int base)
@@ -5060,8 +5055,11 @@ The expression in>>s has type basic_istream<charT,traits>& and v
smanip setfill(char_type c);

--6- Returns: An object s of unspecified type such that if out is (or is derived from) basic_ostream<charT,traits> and c has type charT then the -expression out<<s behaves as if f(s, c) were called. The function f can be +-6- Returns: An object s of unspecified type such that if out is (or is +derived from) basic_ostream<charT,traits> and c has type charT +then the +expression out<<s behaves as if f(s, c) were called. The function +f can be defined as:

      template<class charT, class traits>
@@ -5076,8 +5074,12 @@ The expression out<<s has type basic_ostream<charT,traits>& and
smanip setprecision(int n);

--7- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves -as if f(s, n) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, n) +-7- Returns: An object s of unspecified type such that if out is an +instance of basic_ostream<charT,traits> then the expression +out<<s behaves +as if f(s, n) were called, or if in is an instance of +basic_istream<charT,traits> then the expression in>>s +behaves as if f(s, n) were called. The function f can be defined as:

      ios_base& f(ios_base& str, int n)
@@ -5092,8 +5094,12 @@ The expression in>>s has type basic_istream<charT,traits>& and v .
smanip setw(int n);

--8- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves -as if f(s, n) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, n) +-8- Returns: An object s of unspecified type such that if out is an +instance of basic_ostream<charT,traits> then the expression +out<<s behaves +as if f(s, n) were called, or if in is an instance of +basic_istream<charT,traits> then the expression in>>s +behaves as if f(s, n) were called. The function f can be defined as:

      ios_base& f(ios_base& str, int n)
@@ -5113,19 +5119,19 @@ in.

[Kona: Andy Sawyer and Beman Dawes will work to improve the wording of the proposed resolution.]

-

[Tokyo - The LWG noted that issue 216 involves +

[Tokyo - The LWG noted that issue 216 involves the same paragraphs.]

[Post-Tokyo: The issues list maintainer combined the proposed -resolution of this issue with the proposed resolution for issue 216 as they both involved the same paragraphs, and were so +resolution of this issue with the proposed resolution for issue 216 as they both involved the same paragraphs, and were so intertwined that dealing with them separately appear fraught with error. The full text was supplied by Bill Plauger; it was cross checked against changes supplied by Andy Sawyer. It should be further checked by the LWG.]


-

184. numeric_limits<bool> wording problems

Section: 18.2.1.5 [lib.numeric.special]  Status: WP  Submitter: Gabriel Dos Reis  Date: 21 Jul 1999

+

184. numeric_limits<bool> wording problems

Section: 18.2.1.5 [lib.numeric.special]  Status: WP  Submitter: Gabriel Dos Reis  Date: 21 Jul 1999

bools are defined by the standard to be of integer types, as per -3.9.1 [basic.fundamental] paragraph 7. However "integer types" +3.9.1 [basic.fundamental] paragraph 7. However "integer types" seems to have a special meaning for the author of 18.2. The net effect is an unclear and confusing specification for numeric_limits<bool> as evidenced below.

@@ -5163,7 +5169,7 @@ types with base representation other than 2.

Furthermore, numeric_limits<bool>::is_modulo and numeric_limits<bool>::is_signed have similar problems.

Proposed resolution:

-

Append to the end of 18.2.1.5 [lib.numeric.special]:

+

Append to the end of 18.2.1.5 [lib.numeric.special]:

The specialization for bool shall be provided as follows:

    namespace std {
@@ -5215,8 +5221,8 @@ resolution.]

[Post-Tokyo:  At the request of the LWG in Tokyo, Nico Josuttis provided the above wording.]


-

185. Questionable use of term "inline"

Section: 20.3 [lib.function.objects]  Status: WP  Submitter: UK Panel  Date: 26 Jul 1999

-

Paragraph 4 of 20.3 [lib.function.objects] says:

+

185. Questionable use of term "inline"

Section: 20.3 [lib.function.objects]  Status: WP  Submitter: UK Panel  Date: 26 Jul 1999

+

Paragraph 4 of 20.3 [lib.function.objects] says:

 [Example: To negate every element of a: transform(a.begin(), a.end(), a.begin(), negate<double>()); The corresponding functions will inline @@ -5241,17 +5247,17 @@ any "inlining" will take place in this case.

Thus the example "mandates" behavior that is explicitly not required elsewhere.

Proposed resolution:

-

In 20.3 [lib.function.objects] paragraph 1, remove the sentence:

+

In 20.3 [lib.function.objects] paragraph 1, remove the sentence:

They are important for the effective use of the library.

-

Remove 20.3 [lib.function.objects] paragraph 2, which reads:

+

Remove 20.3 [lib.function.objects] paragraph 2, which reads:

Using function objects together with function templates increases the expressive power of the library as well as making the resulting code much more efficient.

-

In 20.3 [lib.function.objects] paragraph 4, remove the sentence:

+

In 20.3 [lib.function.objects] paragraph 4, remove the sentence:

The corresponding functions will inline the addition and the negation.

@@ -5260,8 +5266,8 @@ not required elsewhere.

[Kona: The LWG agreed there was a defect.]

[Tokyo: The LWG crafted the proposed resolution.]


-

186. bitset::set() second parameter should be bool

Section: 23.3.5.2 [lib.bitset.members]  Status: WP  Submitter: Darin Adler  Date: 13 Aug 1999

-

In section 23.3.5.2 [lib.bitset.members], paragraph 13 defines the +

186. bitset::set() second parameter should be bool

Section: 23.3.5.2 [lib.bitset.members]  Status: WP  Submitter: Darin Adler  Date: 13 Aug 1999

+

In section 23.3.5.2 [lib.bitset.members], paragraph 13 defines the bitset::set operation to take a second parameter of type int. The function tests whether this value is non-zero to determine whether to set the bit to true or false. The type of this second parameter should @@ -5271,7 +5277,7 @@ possible to slice an integer that's larger than an int. This can't happen with bool, since conversion to bool has the semantic of translating 0 to false and any non-zero value to true.

Proposed resolution:

-

In 23.3.5 [lib.template.bitset] Para 1 Replace:

+

In 23.3.5 [lib.template.bitset] Para 1 Replace:

bitset<N>& set(size_t pos, int val = true ); 
@@ -5279,7 +5285,7 @@ translating 0 to false and any non-zero value to true.

bitset<N>& set(size_t pos, bool val = true );
-

In 23.3.5.2 [lib.bitset.members] Para 12(.5) Replace:

+

In 23.3.5.2 [lib.bitset.members] Para 12(.5) Replace:

bitset<N>& set(size_t pos, int val = 1 );
@@ -5298,7 +5304,7 @@ usually implemented as inline, and because it is already the case that users cannot rely on the type of a pointer to a nonvirtual member of a standard library class.


-

187. iter_swap underspecified

Section: 25.2.2 [lib.alg.swap]  Status: WP  Submitter: Andrew Koenig  Date: 14 Aug 1999

+

187. iter_swap underspecified

Section: 25.2.2 [lib.alg.swap]  Status: WP  Submitter: Andrew Koenig  Date: 14 Aug 1999

The description of iter_swap in 25.2.2 paragraph 7,says that it ``exchanges the values'' of the objects to which two iterators refer.

What it doesn't say is whether it does so using swap @@ -5354,7 +5360,7 @@ much more than exchanging the two iterators' values: it would change predecessor/successor relationships, possibly moving the iterator from one list to another. That would surely be inappropriate.


-

189. setprecision() not specified correctly

Section: 27.4.2.2 [lib.fmtflags.state]  Status: TC  Submitter: Andrew Koenig  Date: 25 Aug 1999

+

189. setprecision() not specified correctly

Section: 27.4.2.2 [lib.fmtflags.state]  Status: TC  Submitter: Andrew Koenig  Date: 25 Aug 1999

27.4.2.2 paragraph 9 claims that setprecision() sets the precision, and includes a parenthetical note saying that it is the number of digits after the decimal point.
@@ -5367,10 +5373,10 @@ point.
I would like the committee to look at the definition carefully and correct the statement in 27.4.2.2

Proposed resolution:

-

Remove from 27.4.2.2 [lib.fmtflags.state], paragraph 9, the text +

Remove from 27.4.2.2 [lib.fmtflags.state], paragraph 9, the text "(number of digits after the decimal point)".


-

193. Heap operations description incorrect

Section: 25.3.6 [lib.alg.heap.operations]  Status: TC  Submitter: Markus Mauhart  Date: 24 Sep 1999

+

193. Heap operations description incorrect

Section: 25.3.6 [lib.alg.heap.operations]  Status: TC  Submitter: Markus Mauhart  Date: 24 Sep 1999

25.3.6 [lib.alg.heap.operations] states two key properties of a heap [a,b), the first of them is

@@ -5382,11 +5388,14 @@ resolution.

A-"part of largest equivalence class" instead of "largest", cause 25.3 [lib.alg.sorting] asserts "strict weak ordering" for all its sub clauses.

-

B-Take 'an oldest' from that equivalence class, otherwise the heap functions could not be used for a - priority queue as explained in 23.2.3.2.2 [lib.priqueue.members] (where I assume that a "priority queue" respects priority AND time).

+

B-Take +'an oldest' from that equivalence class, otherwise the heap functions +could not be used for a priority queue as explained in 23.2.3.2.2 +[lib.priqueue.members] (where I assume that a "priority queue" respects +priority AND time).

Proposed resolution:

-

Change 25.3.6 [lib.alg.heap.operations] property (1) from:

+

Change 25.3.6 [lib.alg.heap.operations] property (1) from:

(1) *a is the largest element

@@ -5395,16 +5404,16 @@ resolution.

(1) There is no element greater than *a


-

195. Should basic_istream::sentry's constructor ever set eofbit?

Section: 27.6.1.1.2 [lib.istream::sentry]  Status: TC  Submitter: Matt Austern  Date: 13 Oct 1999

+

195. Should basic_istream::sentry's constructor ever set eofbit?

Section: 27.6.1.1.2 [lib.istream::sentry]  Status: TC  Submitter: Matt Austern  Date: 13 Oct 1999

Suppose that is.flags() & ios_base::skipws is nonzero. What should basic_istream<>::sentry's constructor do if it reaches eof while skipping whitespace? 27.6.1.1.2/5 suggests it should set failbit. Should it set eofbit as well? The standard doesn't seem to answer that question.

-

On the one hand, nothing in 27.6.1.1.2 [lib.istream::sentry] says that +

On the one hand, nothing in 27.6.1.1.2 [lib.istream::sentry] says that basic_istream<>::sentry should ever set eofbit. On the -other hand, 27.6.1.1 [lib.istream] paragraph 4 says that if +other hand, 27.6.1.1 [lib.istream] paragraph 4 says that if extraction from a streambuf "returns traits::eof(), then the input function, except as explicitly noted otherwise, completes its actions and does @@ -5443,7 +5452,7 @@ returns traits::eof(), the function calls


-

198. Validity of pointers and references unspecified after iterator destruction

Section: 24.1 [lib.iterator.requirements]  Status: WP  Submitter: Beman Dawes  Date: 3 Nov 1999

+

198. Validity of pointers and references unspecified after iterator destruction

Section: 24.1 [lib.iterator.requirements]  Status: WP  Submitter: Beman Dawes  Date: 3 Nov 1999

Is a pointer or reference obtained from an iterator still valid after destruction of the iterator? @@ -5453,8 +5462,7 @@ Is a pointer or reference obtained from an iterator still valid after the value of the iterator changes?

-
-#include <iostream>
+
#include <iostream>
 #include <vector>
 #include <iterator>
 
@@ -5491,14 +5499,14 @@ elements of containers.

The standard itself assumes that pointers and references obtained from an iterator are still valid after iterator destruction or -change. The definition of reverse_iterator::operator*(), 24.4.1.3.3 [lib.reverse.iter.op.star], which returns a reference, defines +change. The definition of reverse_iterator::operator*(), 24.4.1.3.3 [lib.reverse.iter.op.star], which returns a reference, defines effects:

Iterator tmp = current;
 return *--tmp;
-

The definition of reverse_iterator::operator->(), 24.4.1.3.4 [lib.reverse.iter.opref], which returns a pointer, defines effects:

+

The definition of reverse_iterator::operator->(), 24.4.1.3.4 [lib.reverse.iter.opref], which returns a pointer, defines effects:

return &(operator*());
@@ -5509,18 +5517,17 @@ explicitly. This will also reduce the chance of user code breaking unexpectedly when porting to a different standard library implementation.

Proposed resolution:

-

Add a new paragraph to 24.1 [lib.iterator.requirements]:

+

Add a new paragraph to 24.1 [lib.iterator.requirements]:

Destruction of an iterator may invalidate pointers and references previously obtained from that iterator.
-

Replace paragraph 1 of 24.4.1.3.3 [lib.reverse.iter.op.star] with:

+

Replace paragraph 1 of 24.4.1.3.3 [lib.reverse.iter.op.star] with:

Effects:

-
-  this->tmp = current;
+
  this->tmp = current;
   --this->tmp;
   return *this->tmp;
 
@@ -5529,7 +5536,7 @@ previously obtained from that iterator. [Note: This operation must use an auxiliary member variable, rather than a temporary variable, to avoid returning a reference that persists beyond the lifetime of its associated iterator. (See -24.1 [lib.iterator.requirements].) The name of this member variable is shown for +24.1 [lib.iterator.requirements].) The name of this member variable is shown for exposition only. --end note]

@@ -5545,7 +5552,7 @@ reformulated yet again to reflect this reality.]

assumes its underlying iterator has persistent pointers and references. Andy Koenig pointed out that it is possible to rewrite reverse_iterator so that it no longer makes such an assupmption. -However, this issue is related to issue 299. If we +However, this issue is related to issue 299. If we decide it is intentional that p[n] may return by value instead of reference when p is a Random Access Iterator, other changes in reverse_iterator will be necessary.]

@@ -5568,7 +5575,7 @@ Clause 23 should be reviewed to make sure that guarantees for predefined iterators are as strong as users expect.


-

199. What does allocate(0) return?

Section: 20.1.5 [lib.allocator.requirements]  Status: TC  Submitter: Matt Austern  Date: 19 Nov 1999

+

199. What does allocate(0) return?

Section: 20.1.5 [lib.allocator.requirements]  Status: TC  Submitter: Matt Austern  Date: 19 Nov 1999

Suppose that A is a class that conforms to the Allocator requirements of Table 32, and a is an @@ -5590,7 +5597,7 @@ representation. Since this already implies special case code, it would be over-specification to mandate the return value.


-

200. Forward iterator requirements don't allow constant iterators

Section: 24.1.3 [lib.forward.iterators]  Status: WP  Submitter: Matt Austern  Date: 19 Nov 1999

+

200. Forward iterator requirements don't allow constant iterators

Section: 24.1.3 [lib.forward.iterators]  Status: WP  Submitter: Matt Austern  Date: 19 Nov 1999

In table 74, the return type of the expression *a is given as T&, where T is the iterator's value type. @@ -5612,7 +5619,7 @@ otherwise const U&".

[Tokyo: The LWG believes this is the tip of a larger iceberg; there are multiple const problems with the STL portion of the library and that these should be addressed as a single package.  Note -that issue 180 has already been declared NAD Future for +that issue 180 has already been declared NAD Future for that very reason.]

[Redmond: the LWG thinks this is separable from other constness @@ -5622,7 +5629,7 @@ modified: the original version only discussed *a. It was pointed out that we also need to worry about *r++ and a->m.]


-

202. unique() effects unclear when predicate not an equivalence relation

Section: 25.2.8 [lib.alg.unique]  Status: WP  Submitter: Andrew Koenig  Date: 13 Jan 2000

+

202. unique() effects unclear when predicate not an equivalence relation

Section: 25.2.8 [lib.alg.unique]  Status: WP  Submitter: Andrew Koenig  Date: 13 Jan 2000

What should unique() do if you give it a predicate that is not an equivalence relation? There are at least two plausible answers: @@ -5689,7 +5696,7 @@ In fact, the SGI implementation of unique() does neither: It yields 1, 3, 7.

Proposed resolution:

-

Change 25.2.8 [lib.alg.unique] paragraph 1 to:

+

Change 25.2.8 [lib.alg.unique] paragraph 1 to:

For a nonempty range, eliminates all but the first element from every consecutive group of equivalent elements referred to by the iterator @@ -5713,14 +5720,14 @@ pointed out that "i-1" is incorrect, since "i" can refer to the first iterator in the range. Matt provided wording to address this problem.]

-

[Curaçao: The LWG changed "... the range (first, +

[Curaçao: The LWG changed "... the range (first, last)..." to "... the range [first+1, last)..." for clarity. They considered this change close enough to editorial to not require another round of review.]

Rationale:

The LWG also considered an alternative resolution: change -25.2.8 [lib.alg.unique] paragraph 1 to:

+25.2.8 [lib.alg.unique] paragraph 1 to:

For a nonempty range, eliminates all but the first element from every @@ -5743,7 +5750,7 @@ that the behavior of unique() for a non-equivalence relation is specified. Both resolutions are consistent with the behavior of existing implementations.


-

208. Unnecessary restriction on past-the-end iterators

Section: 24.1 [lib.iterator.requirements]  Status: TC  Submitter: Stephen Cleary  Date: 02 Feb 2000

+

208. Unnecessary restriction on past-the-end iterators

Section: 24.1 [lib.iterator.requirements]  Status: TC  Submitter: Stephen Cleary  Date: 02 Feb 2000

In 24.1 paragraph 5, it is stated ". . . Dereferenceable and past-the-end values are always non-singular."

This places an unnecessary restriction on past-the-end iterators for @@ -5755,7 +5762,7 @@ without a "footer" node.

This would have an impact on existing code that expects past-the-end iterators obtained from different (generic) containers being not equal.

Proposed resolution:

-

Change 24.1 [lib.iterator.requirements] paragraph 5, the last sentence, from:

+

Change 24.1 [lib.iterator.requirements] paragraph 5, the last sentence, from:

Dereferenceable and past-the-end values are always non-singular.

@@ -5769,8 +5776,8 @@ zero-length vectors, null pointers are perfectly reasonable past-the-end iterators. Null pointers are singular.


-

209. basic_string declarations inconsistent

Section: 21.3 [lib.basic.string]  Status: TC  Submitter: Igor Stauder  Date: 11 Feb 2000

-

In Section 21.3 [lib.basic.string] the basic_string member function +

209. basic_string declarations inconsistent

Section: 21.3 [lib.basic.string]  Status: TC  Submitter: Igor Stauder  Date: 11 Feb 2000

+

In Section 21.3 [lib.basic.string] the basic_string member function declarations use a consistent style except for the following functions:

void push_back(const charT);
@@ -5783,7 +5790,7 @@ not by reference - should be charT or const charT& )
- swap: redundant use of template parameters in argument basic_string<charT,traits,Allocator>&

Proposed resolution:

-

In Section 21.3 [lib.basic.string] change the basic_string member +

In Section 21.3 [lib.basic.string] change the basic_string member function declarations push_back, assign, and swap to:

void push_back(charT c); 
@@ -5798,8 +5805,8 @@ above.  The LWG felt that this was sufficient reason to merit the
 change.
 


-

210. distance first and last confused

Section: 25 [lib.algorithms]  Status: TC  Submitter: Lisa Lippincott  Date: 15 Feb 2000

-

In paragraph 9 of section 25 [lib.algorithms], it is written:

+

210. distance first and last confused

Section: 25 [lib.algorithms]  Status: TC  Submitter: Lisa Lippincott  Date: 15 Feb 2000

+

In paragraph 9 of section 25 [lib.algorithms], it is written:

In the description of the algorithms operators + and - are used for some of the iterator categories for which they do not have to @@ -5809,14 +5816,14 @@ change.      return distance(a, b);

Proposed resolution:

-

On the last line of paragraph 9 of section 25 [lib.algorithms] change +

On the last line of paragraph 9 of section 25 [lib.algorithms] change "a-b" to "b-a".

Rationale:

There are two ways to fix the defect; change the description to b-a or change the return to distance(b,a). The LWG preferred the former for consistency.


-

211. operator>>(istream&, string&) doesn't set failbit

Section: 21.3.7.9 [lib.string.io]  Status: TC  Submitter: Scott Snyder  Date: 4 Feb 2000

+

211. operator>>(istream&, string&) doesn't set failbit

Section: 21.3.7.9 [lib.string.io]  Status: TC  Submitter: Scott Snyder  Date: 4 Feb 2000

The description of the stream extraction operator for std::string (section 21.3.7.9 [lib.string.io]) does not contain a requirement that failbit be set in the case that the operator fails to extract any characters from the input @@ -5830,12 +5837,12 @@ while (is >> str) ... ;

(which tests failbit) is not required to terminate at EOF.

Furthermore, this is inconsistent with other extraction operators, -which do include this requirement. (See sections 27.6.1.2 [lib.istream.formatted] and 27.6.1.3 [lib.istream.unformatted]), where this +which do include this requirement. (See sections 27.6.1.2 [lib.istream.formatted] and 27.6.1.3 [lib.istream.unformatted]), where this requirement is present, either explicitly or implicitly, for the extraction operators. It is also present explicitly in the description -of getline (istream&, string&, charT) in section 21.3.7.9 [lib.string.io] paragraph 8.)

+of getline (istream&, string&, charT) in section 21.3.7.9 [lib.string.io] paragraph 8.)

Proposed resolution:

-

Insert new paragraph after paragraph 2 in section 21.3.7.9 [lib.string.io]:

+

Insert new paragraph after paragraph 2 in section 21.3.7.9 [lib.string.io]:

If the function extracts no characters, it calls @@ -5843,13 +5850,13 @@ is.setstate(ios::failbit) which may throw ios_base::failure (27.4.4.3).


-

212. Empty range behavior unclear for several algorithms

Section: 25.3.7 [lib.alg.min.max]  Status: TC  Submitter: Nico Josuttis  Date: 26 Feb 2000

+

212. Empty range behavior unclear for several algorithms

Section: 25.3.7 [lib.alg.min.max]  Status: TC  Submitter: Nico Josuttis  Date: 26 Feb 2000

The standard doesn't specify what min_element() and max_element() shall return if the range is empty (first equals last). The usual implementations return last. This problem seems also apply to partition(), stable_partition(), next_permutation(), and prev_permutation().

Proposed resolution:

-

In 25.3.7 [lib.alg.min.max] - Minimum and maximum, paragraphs 7 and +

In 25.3.7 [lib.alg.min.max] - Minimum and maximum, paragraphs 7 and 9, append: Returns last if first==last.

Rationale:

The LWG looked in some detail at all of the above mentioned @@ -5857,7 +5864,7 @@ algorithms, but believes that except for min_element() and max_element() it is already clear that last is returned if first == last.


-

214. set::find() missing const overload

Section: 23.3.3 [lib.set], 23.3.4 [lib.multiset]  Status: WP  Submitter: Judy Ward  Date: 28 Feb 2000

+

214. set::find() missing const overload

Section: 23.3.3 [lib.set], 23.3.4 [lib.multiset]  Status: WP  Submitter: Judy Ward  Date: 28 Feb 2000

The specification for the associative container requirements in Table 69 state that the find member function should "return iterator; const_iterator for constant a". The map and multimap @@ -5868,7 +5875,7 @@ and multiset do not, all they have is:

Proposed resolution:

Change the prototypes for find(), lower_bound(), upper_bound(), and -equal_range() in section 23.3.3 [lib.set] and section 23.3.4 [lib.multiset] to each have two overloads:

+equal_range() in section 23.3.3 [lib.set] and section 23.3.4 [lib.multiset] to each have two overloads:

iterator find(const key_type & x);
 const_iterator find(const key_type & x) const;
@@ -5884,7 +5891,7 @@ pair<const_iterator, const_iterator> equal_range(const key_type & x) c extending the proposed resolution to lower_bound, upper_bound, and equal_range.]


-

217. Facets example (Classifying Japanese characters) contains errors

Section: 22.2.8 [lib.facets.examples]  Status: TC  Submitter: Martin Sebor  Date: 29 Feb 2000

+

217. Facets example (Classifying Japanese characters) contains errors

Section: 22.2.8 [lib.facets.examples]  Status: TC  Submitter: Martin Sebor  Date: 29 Feb 2000

The example in 22.2.8, paragraph 11 contains the following errors:

1) The member function `My::JCtype::is_kanji()' is non-const; the function must be const in order for it to be callable on a const object (a reference to @@ -5927,7 +5934,7 @@ declared above.

return 0; }

-

220. ~ios_base() usage valid?

Section: 27.4.2.7 [lib.ios.base.cons]  Status: TC  Submitter: Jonathan Schilling, Howard Hinnant  Date: 13 Mar 2000

+

220. ~ios_base() usage valid?

Section: 27.4.2.7 [lib.ios.base.cons]  Status: TC  Submitter: Jonathan Schilling, Howard Hinnant  Date: 13 Mar 2000

The pre-conditions for the ios_base destructor are described in 27.4.2.7 paragraph 2:

@@ -5963,12 +5970,13 @@ behavior.

to

-

Effects: Each ios_base member has an indeterminate value after - construction. These members must be initialized by calling basic_ios::init. If an ios_base object is destroyed before these initializations - have taken place, the behavior is undefined.

+

Effects: Each ios_base member has an indeterminate +value after construction. These members must be initialized by calling +basic_ios::init. If an ios_base object is destroyed before these +initializations have taken place, the behavior is undefined.


-

221. num_get<>::do_get stage 2 processing broken

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: WP  Submitter: Matt Austern  Date: 14 Mar 2000

+

221. num_get<>::do_get stage 2 processing broken

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: WP  Submitter: Matt Austern  Date: 14 Mar 2000

Stage 2 processing of numeric conversion is broken.

Table 55 in 22.2.2.1.2 says that when basefield is 0 the integral @@ -6001,7 +6009,7 @@ This technique has the consequence that alternate representations of digits will not be recognized. This design decision was made deliberately, with full knowledge of that limitation.


-

222. Are throw clauses necessary if a throw is already implied by the effects clause?

Section: 17.3.1.3 [lib.structure.specifications]  Status: TC  Submitter: Judy Ward  Date: 17 Mar 2000

+

222. Are throw clauses necessary if a throw is already implied by the effects clause?

Section: 17.3.1.3 [lib.structure.specifications]  Status: TC  Submitter: Judy Ward  Date: 17 Mar 2000

Section 21.3.6.8 describes the basic_string::compare function this way:

21.3.6.8 - basic_string::compare [lib.string::compare]
@@ -6017,7 +6025,7 @@ int compare(size_type pos1, size_type n1,
 

and the constructor that's implicitly called by the above is defined to throw an out-of-range exception if pos > str.size(). See -section 21.3.1 [lib.string.cons] paragraph 4.

+section 21.3.1 [lib.string.cons] paragraph 4.

On the other hand, the compare function descriptions themselves don't have "Throws: " clauses and according to 17.3.1.3, paragraph 3, elements @@ -6026,7 +6034,7 @@ that do not apply to a function are omitted.

"Effects" clauses correct, or are the "Throws" clauses missing?

Proposed resolution:

-

In 17.3.1.3 [lib.structure.specifications] paragraph 3, the footnote 148 attached to +

In 17.3.1.3 [lib.structure.specifications] paragraph 3, the footnote 148 attached to the sentence "Descriptions of function semantics contain the following elements (as appropriate):", insert the word "further" so that the foot note reads:

@@ -6042,10 +6050,10 @@ throw. The inconsistent wording is in a footnote, and thus non-normative. The proposed resolution from the LWG clarifies the footnote.


-

223. reverse algorithm should use iter_swap rather than swap

Section: 25.2.9 [lib.alg.reverse]  Status: TC  Submitter: Dave Abrahams  Date: 21 Mar 2000

+

223. reverse algorithm should use iter_swap rather than swap

Section: 25.2.9 [lib.alg.reverse]  Status: TC  Submitter: Dave Abrahams  Date: 21 Mar 2000

Shouldn't the effects say "applies iter_swap to all pairs..."?

Proposed resolution:

-

In 25.2.9 [lib.alg.reverse], replace:

+

In 25.2.9 [lib.alg.reverse], replace:

Effects: For each non-negative integer i <= (last - first)/2, applies swap to all pairs of iterators first + i, (last - i) - 1. @@ -6056,7 +6064,7 @@ footnote.

applies iter_swap to all pairs of iterators first + i, (last - i) - 1.

-

224. clear() complexity for associative containers refers to undefined N

Section: 23.1.2 [lib.associative.reqmts]  Status: TC  Submitter: Ed Brey  Date: 23 Mar 2000

+

224. clear() complexity for associative containers refers to undefined N

Section: 23.1.2 [lib.associative.reqmts]  Status: TC  Submitter: Ed Brey  Date: 23 Mar 2000

In the associative container requirements table in 23.1.2 paragraph 7, a.clear() has complexity "log(size()) + N". However, the meaning of N is not defined.

@@ -6070,7 +6078,7 @@ error: there's no difference between O(N) and O(N + log(N)). The text in the standard is probably an incorrect cut-and-paste from the range version of erase.


-

225. std:: algorithms use of other unqualified algorithms

Section: 17.4.4.3 [lib.global.functions]  Status: WP  Submitter: Dave Abrahams  Date: 01 Apr 2000

+

225. std:: algorithms use of other unqualified algorithms

Section: 17.4.4.3 [lib.global.functions]  Status: WP  Submitter: Dave Abrahams  Date: 01 Apr 2000

Are algorithms in std:: allowed to use other algorithms without qualification, so functions in user namespaces might be found through Koenig lookup?

For example, a popular standard library implementation includes this @@ -6131,12 +6139,12 @@ leading "::" qualification is not required because any namespace qualification is sufficient to suppress Koenig lookup.]

Proposed resolution:

Add a paragraph and a note at the end of -17.4.4.3 [lib.global.functions]:

+17.4.4.3 [lib.global.functions]:

Unless otherwise specified, no global or non-member function in the standard library shall use a function from another namespace which is -found through argument-dependent name lookup (3.4.2 [basic.lookup.koenig]).

+found through argument-dependent name lookup (3.4.2 [basic.lookup.koenig]).

[Note: the phrase "unless otherwise specified" is intended to allow Koenig lookup in cases like that of ostream_iterators:
@@ -6155,9 +6163,9 @@ allow Koenig lookup in cases like that of ostream_iterators:
is as yet unsure if the proposed resolution is the best solution. Furthermore, the LWG believes that the same problem of unqualified library names applies to wording in the standard itself, -and has opened issue 229 accordingly. Any resolution of -issue 225 should be coordinated with the resolution of -issue 229.]

+and has opened issue 229 accordingly. Any resolution of +issue 225 should be coordinated with the resolution of +issue 229.]

[Toronto: The LWG is not sure if this is a defect in the standard. Most LWG members believe that an implementation of @@ -6167,7 +6175,7 @@ those specified in the standard. The standard's description of unique does not say that overloading adjacent_find should have any effect.]

-

[Curaçao: An LWG-subgroup spent an afternoon working on issues +

[Curaçao: An LWG-subgroup spent an afternoon working on issues 225, 226, and 229. Their conclusion was that the issues should be separated into an LWG portion (Howard's paper, N1387=02-0045), and a EWG portion (Dave will write a proposal). The LWG and EWG had @@ -6182,10 +6190,10 @@ resolution for this issue is in accordance with Howard's paper.]

other namespace. However, this is at worst a clarification. It is surely right that algorithsm shouldn't pick up random names, that user-defined names should have no effect unless otherwise specified. - Issue 226 deals with the question of when it is + Issue 226 deals with the question of when it is appropriate for the standard to explicitly specify otherwise.


-

226. User supplied specializations or overloads of namespace std function templates

Section: 17.4.3.1 [lib.reserved.names]  Status: WP  Submitter: Dave Abrahams  Date: 01 Apr 2000

+

226. User supplied specializations or overloads of namespace std function templates

Section: 17.4.3.1 [lib.reserved.names]  Status: WP  Submitter: Dave Abrahams  Date: 01 Apr 2000

The issues are: 

1. How can a 3rd party library implementor (lib1) write a version of a standard algorithm which is specialized to work with his own class template? 

@@ -6228,7 +6236,7 @@ eventually be used with lib2. This may seem innocuous at first when applied to names like swap, but consider more ambiguous names like unique_copy() instead. It is easy to imagine the user wanting to define these names differently in his own namespace. A definition with semantics incompatible with the standard -library could cause serious problems (see issue 225).

+library could cause serious problems (see issue 225).

Why, you may ask, can't we just partially specialize std::swap()? It's because the language doesn't allow for partial specialization of function templates. If you write:

@@ -6329,7 +6337,7 @@ unqualified call of swap. (And which other functions? Any?) A small group (Nathan, Howard, Jeremy, Dave, Matt, Walter, Marc) will try to put together a proposal before the next meeting.]

-

[Curaçao: An LWG-subgroup spent an afternoon working on issues +

[Curaçao: An LWG-subgroup spent an afternoon working on issues 225, 226, and 229. Their conclusion was that the issues should be separated into an LWG portion (Howard's paper, N1387=02-0045), and a EWG portion (Dave will write a proposal). The LWG and EWG had @@ -6351,10 +6359,10 @@ resolution is the one proposed by Howard.]

(such as iter_swap, swap_ranges, reverse, rotate, and sort) conform to that concept. The Swappable concept will make it clear that these algorithms use unqualified lookup for the calls - to swap. Also, in 26.3.3.3 [lib.valarray.transcend] paragraph 1, + to swap. Also, in 26.3.3.3 [lib.valarray.transcend] paragraph 1, state that the valarray transcendentals use unqualified lookup.


-

227. std::swap() should require CopyConstructible or DefaultConstructible arguments

Section: 25.2.2 [lib.alg.swap]  Status: TC  Submitter: Dave Abrahams  Date: 09 Apr 2000

+

227. std::swap() should require CopyConstructible or DefaultConstructible arguments

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);
@@ -6395,9 +6403,9 @@ resolution is the one proposed by Howard.]

Requires: Type T is CopyConstructible (20.1.3) and Assignable (23.1)


-

228. Incorrect specification of "..._byname" facets

Section: 22.2 [lib.locale.categories]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Apr 2000

-

The sections 22.2.1.2 [lib.locale.ctype.byname], 22.2.1.4 [lib.locale.ctype.byname.special], -22.2.1.6 [lib.locale.codecvt.byname], 22.2.3.2 [lib.locale.numpunct.byname], 22.2.4.2 [lib.locale.collate.byname], 22.2.5.4 [lib.locale.time.put.byname], 22.2.6.4 [lib.locale.moneypunct.byname], and 22.2.7.2 [lib.locale.messages.byname] overspecify the +

228. Incorrect specification of "..._byname" facets

Section: 22.2 [lib.locale.categories]  Status: WP  Submitter: Dietmar Kühl  Date: 20 Apr 2000

+

The sections 22.2.1.2 [lib.locale.ctype.byname], 22.2.1.4 [lib.locale.ctype.byname.special], +22.2.1.6 [lib.locale.codecvt.byname], 22.2.3.2 [lib.locale.numpunct.byname], 22.2.4.2 [lib.locale.collate.byname], 22.2.5.4 [lib.locale.time.put.byname], 22.2.6.4 [lib.locale.moneypunct.byname], and 22.2.7.2 [lib.locale.messages.byname] overspecify the definitions of the "..._byname" classes by listing a bunch of virtual functions. At the same time, no semantics of these functions are defined. Real implementations do not define these @@ -6516,18 +6524,18 @@ specialization it is not virtual.

~messages_byname(); // virtual }; }
-

Remove section 22.2.1.4 [lib.locale.ctype.byname.special] completely (because in +

Remove section 22.2.1.4 [lib.locale.ctype.byname.special] completely (because in this case only those members are defined to be virtual which are defined to be virtual in 'ctype<cT>'.)

-

[Post-Tokyo: Dietmar Kühl submitted this issue at the request of -the LWG to solve the underlying problems raised by issue 138.]

+

[Post-Tokyo: Dietmar Kühl submitted this issue at the request of +the LWG to solve the underlying problems raised by issue 138.]

[Copenhagen: proposed resolution was revised slightly, to remove three last virtual functions from messages_byname.]


-

229. Unqualified references of other library entities

Section: 17.4.1.1 [lib.contents]  Status: WP  Submitter: Steve Clamage  Date: 19 Apr 2000

+

229. Unqualified references of other library entities

Section: 17.4.1.1 [lib.contents]  Status: WP  Submitter: Steve Clamage  Date: 19 Apr 2000

Throughout the library chapters, the descriptions of library entities refer to other library entities without necessarily qualifying the names.

@@ -6541,7 +6549,7 @@ override any ::std::swap function when Koenig lookup applies.

"::std::" throughout, too many lines in the standard would have to be adjusted to make that change in a Technical Corrigendum.

-

Issue 182, which addresses qualification of +

Issue 182, which addresses qualification of size_t, is a special case of this.

Proposed resolution:

@@ -6555,7 +6563,7 @@ adjusted to make that change in a Technical Corrigendum.

[Post-Tokyo: Steve Clamage submitted this issue at the request of the LWG to solve a problem in the standard itself similar to the -problem within implementations of library identified by issue 225. Any resolution of issue 225 should be +problem within implementations of library identified by issue 225. Any resolution of issue 225 should be coordinated with the resolution of this issue.]

[post-Toronto: Howard is undecided about whether it is @@ -6569,7 +6577,7 @@ concerned that valarray appears to require argument-dependent lookup, but that the wording may not be clear enough to fall under "unless explicitly described otherwise".]

-

[Curaçao: An LWG-subgroup spent an afternoon working on issues +

[Curaçao: An LWG-subgroup spent an afternoon working on issues 225, 226, and 229. Their conclusion was that the issues should be separated into an LWG portion (Howard's paper, N1387=02-0045), and a EWG portion (Dave will write a proposal). The LWG and EWG had @@ -6578,8 +6586,8 @@ issues 225 and 226. In light of that resolution, the proposed resolution for the current issue makes sense.]


-

230. Assignable specified without also specifying CopyConstructible

Section: 17 [lib.library]  Status: WP  Submitter: Beman Dawes  Date: 26 Apr 2000

-

Issue 227 identified an instance (std::swap) where +

230. Assignable specified without also specifying CopyConstructible

Section: 17 [lib.library]  Status: WP  Submitter: Beman Dawes  Date: 26 Apr 2000

+

Issue 227 identified an instance (std::swap) where Assignable was specified without also specifying CopyConstructible. The LWG asked that the standard be searched to determine if the same defect existed elsewhere.

@@ -6587,19 +6595,19 @@ determine if the same defect existed elsewhere.

There are a number of places (see proposed resolution below) where Assignable is specified without also specifying CopyConstructible. There are also several cases where both are -specified. For example, 26.4.1 [lib.accumulate].

+specified. For example, 26.4.1 [lib.accumulate].

Proposed resolution:

-

In 23.1 [lib.container.requirements] table 65 for value_type: +

In 23.1 [lib.container.requirements] table 65 for value_type: change "T is Assignable" to "T is CopyConstructible and Assignable"

-

In 23.1.2 [lib.associative.reqmts] table 69 X::key_type; change +

In 23.1.2 [lib.associative.reqmts] table 69 X::key_type; change "Key is Assignable" to "Key is CopyConstructible and Assignable"

-

In 24.1.2 [lib.output.iterators] paragraph 1, change: +

In 24.1.2 [lib.output.iterators] paragraph 1, change:

A class or a built-in type X satisfies the requirements of an @@ -6618,12 +6626,12 @@ Table 73:

[Post-Tokyo: Beman Dawes submitted this issue at the request of -the LWG. He asks that the 25.2.4 [lib.alg.replace] and 25.2.5 [lib.alg.fill] changes be studied carefully, as it is not clear that +the LWG. He asks that the 25.2.4 [lib.alg.replace] and 25.2.5 [lib.alg.fill] changes be studied carefully, as it is not clear that CopyConstructible is really a requirement and may be overspecification.]

[Portions of the resolution for issue 230 have been superceded by -the resolution of issue 276.]

+the resolution of issue 276.]

Rationale:

The original proposed resolution also included changes to input @@ -6633,7 +6641,7 @@ Assignable type was also required to be Copy Constructible, but decided against this because fill and replace really don't require the Copy Constructible property.


-

231. Precision in iostream?

Section: 22.2.2.2.2 [lib.facet.num.put.virtuals]  Status: WP  Submitter: James Kanze, Stephen Clamage  Date:  25 Apr 2000

+

231. Precision in iostream?

Section: 22.2.2.2.2 [lib.facet.num.put.virtuals]  Status: WP  Submitter: James Kanze, Stephen Clamage  Date:  25 Apr 2000

What is the following program supposed to output?

#include <iostream>
 
@@ -6674,7 +6682,7 @@ etc. Plus, of course, if precision == 0 and flags & floatfield ==
 of the anomalies of printf:-).

Proposed resolution:

-Replace 22.2.2.2.2 [lib.facet.num.put.virtuals], paragraph 11, with the following +Replace 22.2.2.2.2 [lib.facet.num.put.virtuals], paragraph 11, with the following sentence:

@@ -6697,11 +6705,11 @@ turned into 1. There's no need to call it out as a special case.

The output of the above program will be "1e+00".

-

[Post-Curaçao: Howard provided improved wording covering the case +

[Post-Curaçao: Howard provided improved wording covering the case where precision is 0 and mode is %g.]


-

232. "depends" poorly defined in 17.4.3.1

Section: 17.4.3.1 [lib.reserved.names]  Status: WP  Submitter: Peter Dimov  Date: 18 Apr 2000

+

232. "depends" poorly defined in 17.4.3.1

Section: 17.4.3.1 [lib.reserved.names]  Status: WP  Submitter: Peter Dimov  Date: 18 Apr 2000

17.4.3.1/1 uses the term "depends" to limit the set of allowed specializations of standard templates to those that "depend on a user-defined name of external linkage."

@@ -6733,24 +6741,24 @@ possible way for a user to come up with a specialization for bitset, for example, that might not have already been specialized by the implementor?

-

[Toronto: this may be related to issue 120.]

+

[Toronto: this may be related to issue 120.]

[post-Toronto: Judy provided the above proposed resolution and rationale.]


-

234. Typos in allocator definition

Section: 20.4.1.1 [lib.allocator.members]  Status: WP  Submitter: Dietmar Kühl  Date: 24 Apr 2000

+

234. Typos in allocator definition

Section: 20.4.1.1 [lib.allocator.members]  Status: WP  Submitter: Dietmar Kühl  Date: 24 Apr 2000

In paragraphs 12 and 13 the effects of construct() and destruct() are described as returns but the functions actually return void.

Proposed resolution:

Substitute "Returns" by "Effect".


-

235. No specification of default ctor for reverse_iterator

Section: 24.4.1.1 [lib.reverse.iterator]  Status: WP  Submitter: Dietmar Kühl  Date: 24 Apr 2000

+

235. No specification of default ctor for reverse_iterator

Section: 24.4.1.1 [lib.reverse.iterator]  Status: WP  Submitter: Dietmar Kühl  Date: 24 Apr 2000

The declaration of reverse_iterator lists a default constructor. However, no specification is given what this constructor should do.

Proposed resolution:

-

In section 24.4.1.3.1 [lib.reverse.iter.cons] add the following +

In section 24.4.1.3.1 [lib.reverse.iter.cons] add the following paragraph:

reverse_iterator()

@@ -6763,7 +6771,7 @@ should do.

[pre-Copenhagen: Dietmar provide wording for proposed resolution.]


-

237. Undefined expression in complexity specification

Section: 23.2.2.1 [lib.list.cons]  Status: WP  Submitter: Dietmar Kühl  Date: 24 Apr 2000

+

237. Undefined expression in complexity specification

Section: 23.2.2.1 [lib.list.cons]  Status: WP  Submitter: Dietmar Kühl  Date: 24 Apr 2000

The complexity specification in paragraph 6 says that the complexity is linear in first - last. Even if operator-() is defined on iterators this term is in general undefined because it @@ -6774,13 +6782,12 @@ would have to be last - first.

to become

Linear in distance(first, last).

-

238. Contradictory results of stringbuf initialization.

Section: 27.7.1.1 [lib.stringbuf.cons]  Status: WP  Submitter: Dietmar Kühl  Date: 11 May 2000

+

238. Contradictory results of stringbuf initialization.

Section: 27.7.1.1 [lib.stringbuf.cons]  Status: WP  Submitter: Dietmar Kühl  Date: 11 May 2000

In 27.7.1.1 paragraph 4 the results of calling the constructor of 'basic_stringbuf' are said to be str() == str. This is fine that far but consider this code:

-
-  std::basic_stringbuf<char> sbuf("hello, world", std::ios_base::openmode(0));
+
  std::basic_stringbuf<char> sbuf("hello, world", std::ios_base::openmode(0));
   std::cout << "'" << sbuf.str() << "'\n";
 
@@ -6800,7 +6807,7 @@ defined to be basic_string<cT>().

we fixed it, it would say just the same thing as text that's already in the standard.


-

239. Complexity of unique() and/or unique_copy incorrect

Section: 25.2.8 [lib.alg.unique]  Status: WP  Submitter: Angelika Langer  Date: May 15 2000

+

239. Complexity of unique() and/or unique_copy incorrect

Section: 25.2.8 [lib.alg.unique]  Status: WP  Submitter: Angelika Langer  Date: May 15 2000

The complexity of unique and unique_copy are inconsistent with each other and inconsistent with the implementations.  The standard specifies:

@@ -6827,18 +6834,17 @@ applying the predicate last-first times, especially since it is not specified to which pair in the sequence the predicate is applied twice.

Proposed resolution:

-

Change both complexity sections in 25.2.8 [lib.alg.unique] to:

+

Change both complexity sections in 25.2.8 [lib.alg.unique] to:

Complexity: For nonempty ranges, exactly last - first - 1 applications of the corresponding predicate.

-

240. Complexity of adjacent_find() is meaningless

Section: 25.1.5 [lib.alg.adjacent.find]  Status: WP  Submitter: Angelika Langer  Date: May 15 2000

+

240. Complexity of adjacent_find() is meaningless

Section: 25.1.5 [lib.alg.adjacent.find]  Status: WP  Submitter: Angelika Langer  Date: May 15 2000

The complexity section of adjacent_find is defective:

-
-template <class ForwardIterator>
+
template <class ForwardIterator>
 ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last
                               BinaryPredicate pred);
 
@@ -6869,7 +6875,7 @@ not required of predicates because they can have non-const data members. For this reason, a specification using a binder could only be an "as-if" specification.

Proposed resolution:

-

Change the complexity section in 25.1.5 [lib.alg.adjacent.find] to:

+

Change the complexity section in 25.1.5 [lib.alg.adjacent.find] to:

For a nonempty range, exactly min((i - first) + 1, (last - first) - 1) applications of the @@ -6881,7 +6887,7 @@ return value. bound. The LWG preferred an exact count.]


-

241. Does unique_copy() require CopyConstructible and Assignable?

Section: 25.2.8 [lib.alg.unique]  Status: WP  Submitter: Angelika Langer  Date: May 15 2000

+

241. Does unique_copy() require CopyConstructible and Assignable?

Section: 25.2.8 [lib.alg.unique]  Status: WP  Submitter: Angelika Langer  Date: May 15 2000

Some popular implementations of unique_copy() create temporary copies of values in the input sequence, at least if the input iterator @@ -6892,7 +6898,7 @@ the value type is CopyConstructible and Assignable.

specify any additional requirements that they impose on any of the types used by the algorithm. An example of an algorithm that creates temporary copies and correctly specifies the additional requirements -is accumulate(), 26.4.1 [lib.accumulate].

+is accumulate(), 26.4.1 [lib.accumulate].

Since the specifications of unique() and unique_copy() do not require CopyConstructible and Assignable of the InputIterator's value @@ -6928,19 +6934,19 @@ requiring assignability, although current implementations do impose that requirement. Howard provided new wording.]

[ -Curaçao: The LWG changed the PR editorially to specify +Curaçao: The LWG changed the PR editorially to specify "neither...nor...meet..." as clearer than "both...and...do not meet...". Change believed to be so 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.

-

The standard defines a side effect in 1.9 [intro.execution] as:

+

The standard defines a side effect in 1.9 [intro.execution] as:

-7- Accessing an object designated by a volatile lvalue (basic.lval), modifying an object, calling a library I/O function, or calling a function that does any of those operations are all side effects, which are changes @@ -7113,7 +7119,7 @@ added footnotes pointing out that the use of closed ranges was intentional.]


-

243. get and getline when sentry reports failure

Section: 27.6.1.3 [lib.istream.unformatted]  Status: WP  Submitter: Martin Sebor  Date: May 15 2000

+

243. get and getline when sentry reports failure

Section: 27.6.1.3 [lib.istream.unformatted]  Status: WP  Submitter: Martin Sebor  Date: May 15 2000

basic_istream<>::get(), and basic_istream<>::getline(), are unclear with respect to the behavior and side-effects of the named functions in case of an error.

@@ -7160,7 +7166,7 @@ had language that made this an unambiguous requirement; those words were moved to a place where their context made them less clear. See Jerry Schwarz's message c++std-lib-7618.


-

248. time_get fails to set eofbit

Section: 22.2.5 [lib.category.time]  Status: WP  Submitter: Martin Sebor  Date: 22 June 2000

+

248. time_get fails to set eofbit

Section: 22.2.5 [lib.category.time]  Status: WP  Submitter: Martin Sebor  Date: 22 June 2000

There is no requirement that any of time_get member functions set ios::eofbit when they reach the end iterator while parsing their input. Since members of both the num_get and money_get facets are required to @@ -7178,12 +7184,11 @@ member functions, the member sets ios_base::eofbit in err. because it was more consistent with the way eof is described for other input facets.


-

250. splicing invalidates iterators

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: Brian Parker   Date: 14 Jul 2000

+

250. splicing invalidates iterators

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: Brian Parker   Date: 14 Jul 2000

Section 23.2.2.4 [lib.list.ops] states that

-
-  void splice(iterator position, list<T, Allocator>& x);
+
  void splice(iterator position, list<T, Allocator>& x);
 

invalidates all iterators and references to list x. @@ -7196,14 +7201,14 @@ after splice.

Proposed resolution:

-

Add a footnote to 23.2.2.4 [lib.list.ops], paragraph 1:

+

Add a footnote to 23.2.2.4 [lib.list.ops], paragraph 1:

-[Footnote: As specified in 20.1.5 [lib.allocator.requirements], paragraphs +[Footnote: As specified in 20.1.5 [lib.allocator.requirements], paragraphs 4-5, the semantics described in this clause applies only to the case where allocators compare equal. --end footnote]
-

In 23.2.2.4 [lib.list.ops], replace paragraph 4 with:

+

In 23.2.2.4 [lib.list.ops], replace paragraph 4 with:

Effects: Inserts the contents of x before position and x becomes empty. Pointers and references to the moved elements of x now refer to @@ -7212,7 +7217,7 @@ moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
-

In 23.2.2.4 [lib.list.ops], replace paragraph 7 with:

+

In 23.2.2.4 [lib.list.ops], replace paragraph 7 with:

Effects: Inserts an element pointed to by i from list x before position and removes the element from x. The result is unchanged if @@ -7222,7 +7227,7 @@ to refer to this same element but as a member of *this. Iterators to *i behave as iterators into *this, not into x.
-

In 23.2.2.4 [lib.list.ops], replace paragraph 12 with:

+

In 23.2.2.4 [lib.list.ops], replace paragraph 12 with:

Requires: [first, last) is a valid range in x. The result is undefined if position is an iterator in the range [first, last). @@ -7237,10 +7242,10 @@ 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

+

251. basic_stringbuf missing allocator_type

Section: 27.7.1 [lib.stringbuf]  Status: WP  Submitter: Martin Sebor  Date: 28 Jul 2000

The synopsis for the template class basic_stringbuf doesn't list a typedef for the template parameter Allocator. This makes it impossible to determine the type of @@ -7251,11 +7256,10 @@ template classes in the library that do provide a typedef for the

Add to the synopses of the class templates basic_stringbuf (27.7.1), basic_istringstream (27.7.2), basic_ostringstream (27.7.3), and basic_stringstream (27.7.4) the typedef:

-
-  typedef Allocator allocator_type;
+
  typedef Allocator allocator_type;
 

-

252. missing casts/C-style casts used in iostreams

Section: 27.7 [lib.string.streams]  Status: WP  Submitter: Martin Sebor  Date: 28 Jul 2000

+

252. missing casts/C-style casts used in iostreams

Section: 27.7 [lib.string.streams]  Status: WP  Submitter: Martin Sebor  Date: 28 Jul 2000

27.7.2.2, p1 uses a C-style cast rather than the more appropriate const_cast<> in the Returns clause for basic_istringstream<>::rdbuf(). The same C-style cast is being used in 27.7.3.2, p1, D.7.2.2, p1, and @@ -7290,15 +7294,14 @@ issue is stylistic rather than a matter of correctness.

with

  -2- Returns: const_cast<strstreambuf*>(&sb).

-

253. valarray helper functions are almost entirely useless

Section: 26.3.2.1 [lib.valarray.cons], 26.3.2.2 [lib.valarray.assign]  Status: WP  Submitter: Robert Klarer  Date: 31 Jul 2000

+

253. valarray helper functions are almost entirely useless

Section: 26.3.2.1 [lib.valarray.cons], 26.3.2.2 [lib.valarray.assign]  Status: WP  Submitter: Robert Klarer  Date: 31 Jul 2000

This discussion is adapted from message c++std-lib-7056 posted November 11, 1999. I don't think that anyone can reasonably claim that the problem described below is NAD.

These valarray constructors can never be called:

-
-   template <class T>
+
   template <class T>
          valarray<T>::valarray(const slice_array<T> &);
    template <class T>
          valarray<T>::valarray(const gslice_array<T> &);
@@ -7311,8 +7314,7 @@ that the problem described below is NAD.

Similarly, these valarray assignment operators cannot be called:

-
-     template <class T>
+
     template <class T>
      valarray<T> valarray<T>::operator=(const slice_array<T> &);
      template <class T>
      valarray<T> valarray<T>::operator=(const gslice_array<T> &);
@@ -7324,8 +7326,7 @@ called:

Please consider the following example:

-
-   #include <valarray>
+
   #include <valarray>
    using namespace std;
 
    int main()
@@ -7342,8 +7343,7 @@ std::slice_array<double>.  This slice_array rvalue is then used to
 construct va2.  The constructor that is used to construct va2 is
 declared like this:

-
-     template <class T>
+
     template <class T>
      valarray<T>::valarray(const slice_array<T> &);
 
@@ -7369,66 +7369,66 @@ classes are almost entirely useless.

slice_array:

gslice_array:

mask_array:

indirect_array:

[Proposed resolution was modified in Santa Cruz: explicitly make copy constructor and copy assignment operators public, instead of @@ -7445,7 +7445,7 @@ believed we should make the assignment operators public, in addition to the copy constructors, for reasons of symmetry and user expectation.


-

256. typo in 27.4.4.2, p17: copy_event does not exist

Section: 27.4.4.2 [lib.basic.ios.members]  Status: WP  Submitter: Martin Sebor  Date: 21 Aug 2000

+

256. typo in 27.4.4.2, p17: copy_event does not exist

Section: 27.4.4.2 [lib.basic.ios.members]  Status: WP  Submitter: Martin Sebor  Date: 21 Aug 2000

27.4.4.2, p17 says

@@ -7464,7 +7464,7 @@ copyfmt_event.

Proposed resolution:

Replace copy_event with copyfmt_event in the named paragraph.


-

259. basic_string::operator[] and const correctness

Section: 21.3.4 [lib.string.access]  Status: WP  Submitter: Chris Newton   Date: 27 Aug 2000

+

259. basic_string::operator[] and const correctness

Section: 21.3.4 [lib.string.access]  Status: WP  Submitter: Chris Newton   Date: 27 Aug 2000

Paraphrased from a message that Chris Newton posted to comp.std.c++:

@@ -7488,7 +7488,7 @@ In section 21.3.4, paragraph 1, change


260. Inconsistent return type of istream_iterator::operator++(int) -

Section: 24.5.1.2 [lib.istream.iterator.ops]  Status: WP  Submitter: Martin Sebor  Date: 27 Aug 2000

+

Section: 24.5.1.2 [lib.istream.iterator.ops]  Status: WP  Submitter: Martin Sebor  Date: 27 Aug 2000

The synopsis of istream_iterator::operator++(int) in 24.5.1 shows it as returning the iterator by value. 24.5.1.2, p5 shows the same operator as returning the iterator by reference. That's incorrect @@ -7496,23 +7496,20 @@ given the Effects clause below (since a temporary is returned). The `&' is probably just a typo.

Proposed resolution:

Change the declaration in 24.5.1.2, p5 from

-
- istream_iterator<T,charT,traits,Distance>& operator++(int);
+ 
 istream_iterator<T,charT,traits,Distance>& operator++(int);
  

to

-
- istream_iterator<T,charT,traits,Distance> operator++(int);
+ 
 istream_iterator<T,charT,traits,Distance> operator++(int);
  

(that is, remove the `&').


261. Missing description of istream_iterator::operator!= -

Section: 24.5.1.2 [lib.istream.iterator.ops]  Status: WP  Submitter: Martin Sebor  Date: 27 Aug 2000

+

Section: 24.5.1.2 [lib.istream.iterator.ops]  Status: WP  Submitter: Martin Sebor  Date: 27 Aug 2000

24.5.1, p3 lists the synopsis for

-
-   template <class T, class charT, class traits, class Distance>
+
   template <class T, class charT, class traits, class Distance>
         bool operator!=(const istream_iterator<T,charT,traits,Distance>& x,
                         const istream_iterator<T,charT,traits,Distance>& y);
 
@@ -7526,15 +7523,14 @@ or Returns clause) in 24.5.1.2. Add paragraph 7 to the end of section 24.5.1.2 with the following text:

-
-   template <class T, class charT, class traits, class Distance>
+
   template <class T, class charT, class traits, class Distance>
         bool operator!=(const istream_iterator<T,charT,traits,Distance>& x,
                         const istream_iterator<T,charT,traits,Distance>& y);
 

-7- Returns: !(x == y).


-

262. Bitmask operator ~ specified incorrectly

Section: 17.3.2.1.2 [lib.bitmask.types]  Status: WP  Submitter: Beman Dawes  Date: 03 Sep 2000

+

262. Bitmask operator ~ specified incorrectly

Section: 17.3.2.1.2 [lib.bitmask.types]  Status: WP  Submitter: Beman Dawes  Date: 03 Sep 2000

The ~ operation should be applied after the cast to int_type.

@@ -7543,8 +7539,7 @@ The ~ operation should be applied after the cast to int_type. Change 17.3.2.1.2 [lib.bitmask.types] operator~ from:

-
-   bitmask operator~ ( bitmask X )
+
   bitmask operator~ ( bitmask X )
      { return static_cast< bitmask>(static_cast<int_type>(~ X)); }
 
@@ -7552,12 +7547,11 @@ Change 17.3.2.1.2 [lib.bitmask.types] operator~ from: to:

-
-   bitmask operator~ ( bitmask X )
+
   bitmask operator~ ( bitmask X )
      { return static_cast< bitmask>(~static_cast<int_type>(X)); }
 

-

263. Severe restriction on basic_string reference counting

Section: 21.3 [lib.basic.string]  Status: WP  Submitter: Kevlin Henney  Date: 04 Sep 2000

+

263. Severe restriction on basic_string reference counting

Section: 21.3 [lib.basic.string]  Status: WP  Submitter: Kevlin Henney  Date: 04 Sep 2000

The note in paragraph 6 suggests that the invalidation rules for references, pointers, and iterators in paragraph 5 permit a reference- @@ -7571,8 +7565,7 @@ implementation unviable. In the following example none of the conditions for iterator invalidation are satisfied:

-
-    // first example: "*******************" should be printed twice
+
    // first example: "*******************" should be printed twice
     string original = "some arbitrary text", copy = original;
     const string & alias = original;
 
@@ -7589,8 +7582,7 @@ conditions for iterator invalidation are satisfied:
 Similarly, in the following example:
 

-
-    // second example: "some arbitrary text" should be printed out
+
    // second example: "some arbitrary text" should be printed out
     string original = "some arbitrary text", copy = original;
     const string & alias = original;
 
@@ -7629,14 +7621,14 @@ Change the following sentence in 21.3 paragraph 5 from
     or rend().
 

-

264. Associative container insert(i, j) complexity requirements are not feasible.

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: John Potter  Date: 07 Sep 2000

+

264. Associative container insert(i, j) complexity requirements are not feasible.

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: John Potter  Date: 07 Sep 2000

Table 69 requires linear time if [i, j) is sorted. Sorted is necessary but not sufficient. Consider inserting a sorted range of even integers into a set<int> containing the odd integers in the same range.

-

Related issue: 102

+

Related issue: 102

Proposed resolution:

In Table 69, in section 23.1.2, change the complexity clause for @@ -7668,7 +7660,7 @@ inserted is sorted, it's more trouble than it's worth to say that it's linear in some special cases.


-

265. std::pair::pair() effects overly restrictive

Section: 20.2.2 [lib.pairs]  Status: WP  Submitter: Martin Sebor  Date: 11 Sep 2000

+

265. std::pair::pair() effects overly restrictive

Section: 20.2.2 [lib.pairs]  Status: WP  Submitter: Martin Sebor  Date: 11 Sep 2000

I don't see any requirements on the types of the elements of the std::pair container in 20.2.2. From the descriptions of the member @@ -7705,7 +7697,7 @@ default constructor was written the obvious way. This has been clarified by core issue 178, and there is no longer any doubt that the straightforward implementation is correct.


-

266. bad_exception::~bad_exception() missing Effects clause

Section: 18.6.2.1 [lib.bad.exception]  Status: WP  Submitter: Martin Sebor  Date: 24 Sep 2000

+

266. bad_exception::~bad_exception() missing Effects clause

Section: 18.6.2.1 [lib.bad.exception]  Status: WP  Submitter: Martin Sebor  Date: 24 Sep 2000

The synopsis for std::bad_exception lists the function ~bad_exception() but there is no description of what the function does (the Effects @@ -7714,10 +7706,10 @@ clause is missing).

Proposed resolution:

Remove the destructor from the class synopses of -bad_alloc (18.4.2.1 [lib.bad.alloc]), -bad_cast (18.5.2 [lib.bad.cast]), -bad_typeid (18.5.3 [lib.bad.typeid]), -and bad_exception (18.6.2.1 [lib.bad.exception]). +bad_alloc (18.4.2.1 [lib.bad.alloc]), +bad_cast (18.5.2 [lib.bad.cast]), +bad_typeid (18.5.3 [lib.bad.typeid]), +and bad_exception (18.6.2.1 [lib.bad.exception]).

Rationale:

@@ -7728,7 +7720,7 @@ removing them is more consistent with how exception classes are described in clause 19.


-

268. Typo in locale synopsis

Section: 22.1.1 [lib.locale]  Status: WP  Submitter: Martin Sebor  Date: 5 Oct 2000

+

268. Typo in locale synopsis

Section: 22.1.1 [lib.locale]  Status: WP  Submitter: Martin Sebor  Date: 5 Oct 2000

The synopsis of the class std::locale in 22.1.1 contains two typos: the semicolons after the declarations of the default ctor locale::locale() and the copy ctor locale::locale(const locale&) @@ -7736,21 +7728,19 @@ are missing.

Proposed resolution:

Add the missing semicolons, i.e., change

-
-    //  construct/copy/destroy:
+
    //  construct/copy/destroy:
         locale() throw()
         locale(const locale& other) throw()
 

in the synopsis in 22.1.1 to

-
-    //  construct/copy/destroy:
+
    //  construct/copy/destroy:
         locale() throw();
         locale(const locale& other) throw();
 

-

270. Binary search requirements overly strict

Section: 25.3.3 [lib.alg.binary.search]  Status: WP  Submitter: Matt Austern  Date: 18 Oct 2000

+

270. Binary search requirements overly strict

Section: 25.3.3 [lib.alg.binary.search]  Status: WP  Submitter: Matt Austern  Date: 18 Oct 2000

Each of the four binary search algorithms (lower_bound, upper_bound, equal_range, binary_search) has a form that allows the user to pass a @@ -7765,8 +7755,7 @@ large record with an integer key. We might reasonably want to look up a record by key, in which case we would want to write something like this:

-
-    struct key_comp {
+
    struct key_comp {
       bool operator()(const X& x, int n) const {
         return x.key() < n;
       }
@@ -7959,8 +7948,7 @@ The proposed resolution is based on that alternative formulation.
 
 

to:

-
-   -2- Returns: 
+
   -2- Returns: 
          make_pair(lower_bound(first, last, value),
                    upper_bound(first, last, value))
        or
@@ -8002,7 +7990,7 @@ that the upper bound is no earlier than the lower bound, that
 the pair returned by equal_range is a valid range, and that the first
 part of that pair is the lower bound.


-

271. basic_iostream missing typedefs

Section: 27.6.1.5 [lib.iostreamclass]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

+

271. basic_iostream missing typedefs

Section: 27.6.1.5 [lib.iostreamclass]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

Class template basic_iostream has no typedefs. The typedefs it inherits from its base classes can't be used, since (for example) @@ -8011,10 +7999,9 @@ basic_iostream<T>::traits_type is ambiguous.

Proposed resolution:

Add the following to basic_iostream's class synopsis in -27.6.1.5 [lib.iostreamclass], immediately after public:

+27.6.1.5 [lib.iostreamclass], immediately after public:

-
-  // types:
+
  // types:
   typedef charT                     char_type;
   typedef typename traits::int_type int_type;
   typedef typename traits::pos_type pos_type;
@@ -8022,7 +8009,7 @@ basic_iostream<T>::traits_type is ambiguous.
   typedef traits                    traits_type;
 

-

272. Missing parentheses around subexpression

Section: 27.4.4.3 [lib.iostate.flags]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

+

272. Missing parentheses around subexpression

Section: 27.4.4.3 [lib.iostate.flags]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

27.4.4.3, p4 says about the postcondition of the function: If rdbuf()!=0 then state == rdstate(); otherwise @@ -8039,7 +8026,7 @@ anything but non-zero. Add parentheses like so: rdstate()==(state|ios_base::badbit).


-

273. Missing ios_base qualification on members of a dependent class

Section: 27 [lib.input.output]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

+

273. Missing ios_base qualification on members of a dependent class

Section: 27 [lib.input.output]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

27.5.2.4.2, p4, and 27.8.1.6, p2, 27.8.1.7, p3, 27.8.1.9, p2, 27.8.1.10, p3 refer to in and/or out w/o ios_base:: qualification. That's incorrect since the names are members of a dependent base @@ -8048,7 +8035,7 @@ class (14.6.2 [temp.dep]) and thus not visible.

Qualify the names with the name of the class of which they are members, i.e., ios_base.


-

274. a missing/impossible allocator requirement

Section: 20.1.5 [lib.allocator.requirements]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

+

274. a missing/impossible allocator requirement

Section: 20.1.5 [lib.allocator.requirements]  Status: WP  Submitter: Martin Sebor  Date: 02 Nov 2000

I see that table 31 in 20.1.5, p3 allows T in std::allocator<T> to be of any type. But the synopsis in 20.4.1 calls for allocator<>::address() to @@ -8099,11 +8086,11 @@ The original text for proposed resolution 2 was modified so that it also forbids volatile types and reference types.

-

[Curaçao: LWG double checked and believes volatile is correctly +

[Curaçao: LWG double checked and believes volatile is correctly excluded from the PR.]


-

275. Wrong type in num_get::get() overloads

Section: 22.2.2.1.1 [lib.facet.num.get.members]  Status: WP  Submitter: Matt Austern  Date: 02 Nov 2000

+

275. Wrong type in num_get::get() overloads

Section: 22.2.2.1.1 [lib.facet.num.get.members]  Status: WP  Submitter: Matt Austern  Date: 02 Nov 2000

In 22.2.2.1.1, we have a list of overloads for num_get<>::get(). There are eight overloads, all of which are identical except for the @@ -8142,21 +8129,19 @@ These two lists are not identical. They should be, since the arguments it was given.

Proposed resolution:

-

In 22.2.2.1.1 [lib.facet.num.get.members], change

-
-  iter_type get(iter_type in, iter_type end, ios_base& str,
+

In 22.2.2.1.1 [lib.facet.num.get.members], change

+
  iter_type get(iter_type in, iter_type end, ios_base& str,
                 ios_base::iostate& err, short& val) const;
 

to

-
-  iter_type get(iter_type in, iter_type end, ios_base& str,
+
  iter_type get(iter_type in, iter_type end, ios_base& str,
                 ios_base::iostate& err, float& val) const;
 

-

276. Assignable requirement for container value type overly strict

Section: 23.1 [lib.container.requirements]  Status: WP  Submitter: Peter Dimov  Date: 07 Nov 2000

+

276. Assignable requirement for container value type overly strict

Section: 23.1 [lib.container.requirements]  Status: WP  Submitter: Peter Dimov  Date: 07 Nov 2000

23.1/3 states that the objects stored in a container must be -Assignable. 23.3.1 [lib.map], paragraph 2, +Assignable. 23.3.1 [lib.map], paragraph 2, states that map satisfies all requirements for a container, while in the same time defining value_type as pair<const Key, T> - a type that is not Assignable. @@ -8180,14 +8165,14 @@ general.

For example, the proposed resolution of active library issue -103 is to make set::iterator a constant iterator; this +103 is to make set::iterator a constant iterator; this means that no set operations can exploit the fact that the stored objects are Assignable.

This is related to, but slightly broader than, closed issue -140. +140.

Proposed resolution:

23.1/3: Strike the trailing part of the sentence:

@@ -8247,8 +8232,7 @@ following methods are instantiated: [Footnote: Implementors are permitted but not required to take advantage of T's Assignable properties for these methods. -- end foonote]

-
-     list<T,Allocator>& operator=(const list<T,Allocator>&  x );
+
     list<T,Allocator>& operator=(const list<T,Allocator>&  x );
      template <class InputIterator>
        void assign(InputIterator first, InputIterator last);
      void assign(size_type n, const T& t);
@@ -8284,7 +8268,7 @@ to forbid such implementations.

Note that the type stored in a standard container must still satisfy the requirements of the container's allocator; this rules out, for -example, such types as "const int". See issue 274 +example, such types as "const int". See issue 274 for more details.

@@ -8296,12 +8280,11 @@ implement vector::push_back in terms of vector::insert.


-

278. What does iterator validity mean?

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: P.J. Plauger  Date: 27 Nov 2000

+

278. What does iterator validity mean?

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: P.J. Plauger  Date: 27 Nov 2000

Section 23.2.2.4 [lib.list.ops] states that

-
-  void splice(iterator position, list<T, Allocator>& x);
+
  void splice(iterator position, list<T, Allocator>& x);
 

invalidates all iterators and references to list x. @@ -8316,7 +8299,7 @@ validity.

-If we accept the proposed resolution to issue 250, +If we accept the proposed resolution to issue 250, then we'd better clarify that a "valid" iterator need no longer designate an element within the same container as it once did. We then have to clarify what we mean by invalidating a past-the-end @@ -8325,7 +8308,7 @@ such an iterator has a different kind of validity. Perhaps we should introduce separate terms for the two kinds of "validity."

Proposed resolution:

-

Add the following text to the end of section 24.1 [lib.iterator.requirements], +

Add the following text to the end of section 24.1 [lib.iterator.requirements], after paragraph 5:

An invalid iterator is an iterator that may be @@ -8351,10 +8334,10 @@ the wording. Dave provided new wording.]

all iterators pointing into the vector. That doesn't necessarily mean they all become singular.


-

281. std::min() and max() requirements overly restrictive

Section: 25.3.7 [lib.alg.min.max]  Status: WP  Submitter: Martin Sebor  Date: 02 Dec 2000

+

281. std::min() and max() requirements overly restrictive

Section: 25.3.7 [lib.alg.min.max]  Status: WP  Submitter: Martin Sebor  Date: 02 Dec 2000

The requirements in 25.3.7, p1 and 4 call for T to satisfy the -requirements of LessThanComparable (20.1.2 [lib.lessthancomparable]) -and CopyConstructible (20.1.3 [lib.copyconstructible]). +requirements of LessThanComparable (20.1.2 [lib.lessthancomparable]) +and CopyConstructible (20.1.3 [lib.copyconstructible]). Since the functions take and return their arguments and result by const reference, I believe the CopyConstructible requirement is unnecessary. @@ -8363,14 +8346,14 @@ is unnecessary.

Remove the CopyConstructible requirement. Specifically, replace 25.3.7, p1 with

-1- Requires: Type T is LessThanComparable -(20.1.2 [lib.lessthancomparable]). +(20.1.2 [lib.lessthancomparable]).

and replace 25.3.7, p4 with

-4- Requires: Type T is LessThanComparable -(20.1.2 [lib.lessthancomparable]). +(20.1.2 [lib.lessthancomparable]).


-

282. What types does numpunct grouping refer to?

Section: 22.2.2.2.2 [lib.facet.num.put.virtuals]  Status: WP  Submitter: Howard Hinnant  Date: 5 Dec 2000

+

282. What types does numpunct grouping refer to?

Section: 22.2.2.2.2 [lib.facet.num.put.virtuals]  Status: WP  Submitter: Howard Hinnant  Date: 5 Dec 2000

Paragraph 16 mistakenly singles out integral types for inserting thousands_sep() characters. This conflicts with the syntax for floating @@ -8382,7 +8365,7 @@ point numbers described under 22.2.3.1/2.

For integral types, punct.thousands_sep() characters are inserted into the sequence as determined by the value returned by punct.do_grouping() -using the method described in 22.2.3.1.2 [lib.facet.numpunct.virtuals]. +using the method described in 22.2.3.1.2 [lib.facet.numpunct.virtuals].

To:

@@ -8390,7 +8373,7 @@ using the method described in 22.2.3.1.2 [lib.facet.numpunct.virtuals]. +using the method described in 22.2.3.1.2 [lib.facet.numpunct.virtuals].

[ @@ -8410,11 +8393,11 @@ floating-point input even though this is unambiguously required by the standard. ]

-

[Post-Curaçao: the above proposed resolution is the consensus of +

[Post-Curaçao: the above proposed resolution is the consensus of Howard, Bill, Pete, Benjamin, Nathan, Dietmar, Boris, and Martin.]


-

283. std::replace() requirement incorrect/insufficient

Section: 25.2.4 [lib.alg.replace]  Status: WP  Submitter: Martin Sebor  Date: 15 Dec 2000

+

283. std::replace() requirement incorrect/insufficient

Section: 25.2.4 [lib.alg.replace]  Status: WP  Submitter: Martin Sebor  Date: 15 Dec 2000

(revision of the further discussion) There are a number of problems with the requires clauses for the @@ -8561,22 +8544,21 @@ imposing a greater restriction that what the standard currently says (which is convertible to bool).


-

284. unportable example in 20.3.7, p6

Section: 20.3.7 [lib.function.pointer.adaptors]  Status: WP  Submitter: Martin Sebor  Date: 26 Dec 2000

-

The example in 20.3.7 [lib.function.pointer.adaptors], p6 shows how to use the C +

284. unportable example in 20.3.7, p6

Section: 20.3.7 [lib.function.pointer.adaptors]  Status: WP  Submitter: Martin Sebor  Date: 26 Dec 2000

+

The example in 20.3.7 [lib.function.pointer.adaptors], p6 shows how to use the C library function strcmp() with the function pointer adapter ptr_fun(). But since it's unspecified whether the C library functions have extern "C" or extern -"C++" linkage [17.4.2.2 [lib.using.linkage]], and since +"C++" linkage [17.4.2.2 [lib.using.linkage]], and since function pointers with different the language linkage specifications -(7.5 [dcl.link]) are incompatible, whether this example is +(7.5 [dcl.link]) are incompatible, whether this example is well-formed is unspecified.

Proposed resolution:

-

Change 20.3.7 [lib.function.pointer.adaptors] paragraph 6 from:

+

Change 20.3.7 [lib.function.pointer.adaptors] paragraph 6 from:

[Example:

-
-    replace_if(v.begin(), v.end(), not1(bind2nd(ptr_fun(strcmp), "C")), "C++");
+  
    replace_if(v.begin(), v.end(), not1(bind2nd(ptr_fun(strcmp), "C")), "C++");
   

replaces each C with C++ in sequence v.

@@ -8585,8 +8567,7 @@ well-formed is unspecified.

to:

[Example:

-
-    int compare(const char*, const char*);
+  
    int compare(const char*, const char*);
     replace_if(v.begin(), v.end(),
                not1(bind2nd(ptr_fun(compare), "abc")), "def");
   
@@ -8606,9 +8587,9 @@ aren't normative), and changed the sentence after the footnote so that it corresponds to the new code fragment.]


-

285. minor editorial errors in fstream ctors

Section: 27.8.1.6 [lib.ifstream.cons]  Status: WP  Submitter: Martin Sebor  Date: 31 Dec 2000

-

27.8.1.6 [lib.ifstream.cons], p2, 27.8.1.9 [lib.ofstream.cons], p2, and -27.8.1.12 [lib.fstream.cons], p2 say about the effects of each constructor: +

285. minor editorial errors in fstream ctors

Section: 27.8.1.6 [lib.ifstream.cons]  Status: WP  Submitter: Martin Sebor  Date: 31 Dec 2000

+

27.8.1.6 [lib.ifstream.cons], p2, 27.8.1.9 [lib.ofstream.cons], p2, and +27.8.1.12 [lib.fstream.cons], p2 say about the effects of each constructor:

... If that function returns a null pointer, calls @@ -8616,7 +8597,7 @@ it corresponds to the new code fragment.]

The parenthetical note doesn't apply since the ctors cannot throw an -exception due to the requirement in 27.4.4.1 [lib.basic.ios.cons], p3 +exception due to the requirement in 27.4.4.1 [lib.basic.ios.cons], p3 that exceptions() be initialized to ios_base::goodbit.

Proposed resolution:

@@ -8625,7 +8606,7 @@ Strike the parenthetical note from the Effects clause in each of the paragraphs mentioned above.


-

286. <cstdlib> requirements missing size_t typedef

Section: 25.4 [lib.alg.c.library]  Status: WP  Submitter: Judy Ward  Date: 30 Dec 2000

+

286. <cstdlib> requirements missing size_t typedef

Section: 25.4 [lib.alg.c.library]  Status: WP  Submitter: Judy Ward  Date: 30 Dec 2000

The <cstdlib> header file contains prototypes for bsearch and qsort (C++ Standard section 25.4 paragraphs 3 and 4) and other @@ -8641,7 +8622,7 @@ the type size_t <cstdlib> to Table 97 (section C.2).

Rationale:

Since size_t is in <stdlib.h>, it must also be in <cstdlib>.


-

288. <cerrno> requirements missing macro EILSEQ

Section: 19.3 [lib.errno]  Status: WP  Submitter: Judy Ward  Date: 30 Dec 2000

+

288. <cerrno> requirements missing macro EILSEQ

Section: 19.3 [lib.errno]  Status: WP  Submitter: Judy Ward  Date: 30 Dec 2000

ISO/IEC 9899:1990/Amendment1:1994 Section 4.3 States: "The list of macros defined in <errno.h> is adjusted to include a new @@ -8659,7 +8640,7 @@ Update Table 26 (section 19.3) "Header <cerrno> synopsis" and Table 95 (section C.2) "Standard Macros" to include EILSEQ.


-

291. Underspecification of set algorithms

Section: 25.3.5 [lib.alg.set.operations]  Status: WP  Submitter: Matt Austern  Date: 03 Jan 2001

+

291. Underspecification of set algorithms

Section: 25.3.5 [lib.alg.set.operations]  Status: WP  Submitter: Matt Austern  Date: 03 Jan 2001

The standard library contains four algorithms that compute set operations on sorted ranges: set_union, set_intersection, @@ -8710,7 +8691,7 @@ same way.

Proposed resolution:

-

Add the following to the end of 25.3.5.2 [lib.set.union] paragraph 5:

+

Add the following to the end of 25.3.5.2 [lib.set.union] paragraph 5:

If [first1, last1) contains m elements that are equivalent to each other and [first2, last2) contains n elements that are @@ -8720,7 +8701,7 @@ from [first1, last1), and the last max(n-m, 0) of them from [first2, last2), in that order.
-

Add the following to the end of 25.3.5.3 [lib.set.intersection] paragraph 5:

+

Add the following to the end of 25.3.5.3 [lib.set.intersection] paragraph 5:

If [first1, last1) contains m elements that are equivalent to each other and [first2, last2) contains n elements that are @@ -8728,7 +8709,7 @@ equivalent to them, the first min(m, n) of those elements from [first1, last1) are copied to the output range.
-

Add a new paragraph, Notes, after 25.3.5.4 [lib.set.difference] +

Add a new paragraph, Notes, after 25.3.5.4 [lib.set.difference] paragraph 4:

If [first1, last1) contains m elements that are equivalent to each @@ -8737,7 +8718,7 @@ equivalent to them, the last max(m-n, 0) elements from [first1, last1) are copied to the output range.
-

Add a new paragraph, Notes, after 25.3.5.5 [lib.set.symmetric.difference] +

Add a new paragraph, Notes, after 25.3.5.5 [lib.set.symmetric.difference] paragraph 4:

If [first1, last1) contains m elements that are equivalent to @@ -8760,7 +8741,7 @@ m of these elements from [first2, last2) if m < n. already in the Standard. For more complicated cases, they describe the behavior of existing implementations.


-

292. effects of a.copyfmt (a)

Section: 27.4.4.2 [lib.basic.ios.members]  Status: WP  Submitter: Martin Sebor  Date: 05 Jan 2001

+

292. effects of a.copyfmt (a)

Section: 27.4.4.2 [lib.basic.ios.members]  Status: WP  Submitter: Martin Sebor  Date: 05 Jan 2001

The Effects clause of the member function copyfmt() in 27.4.4.2, p15 doesn't consider the case where the left-hand side argument is identical to the argument on the right-hand side, that is @@ -8788,7 +8769,7 @@ assigns to the member objects of *this the corresponding member objects of rhs, except that...


-

295. Is abs defined in <cmath>?

Section: 26.5 [lib.c.math]  Status: WP  Submitter: Jens Maurer  Date: 12 Jan 2001

+

295. Is abs defined in <cmath>?

Section: 26.5 [lib.c.math]  Status: WP  Submitter: Jens Maurer  Date: 12 Jan 2001

Table 80 lists the contents of the <cmath> header. It does not list abs(). However, 26.5, paragraph 6, which lists added @@ -8798,7 +8779,7 @@ of abs() should be defined in <cmath>.

Proposed resolution:

Add abs to Table 80. Also, remove the parenthetical list -of functions "(abs(), div(), rand(), srand())" from 26.5 [lib.c.math], +of functions "(abs(), div(), rand(), srand())" from 26.5 [lib.c.math], paragraph 1.

@@ -8809,9 +8790,9 @@ rid of that vestigial list of functions in paragraph 1.]

All this DR does is fix a typo; it's uncontroversial. A separate question is whether we're doing the right thing in putting some overloads in <cmath> that we aren't also -putting in <cstdlib>. That's issue 323.

+putting in <cstdlib>. That's issue 323.


-

297. const_mem_fun_t<>::argument_type should be const T*

Section: 20.3.8 [lib.member.pointer.adaptors]  Status: WP  Submitter: Martin Sebor  Date: 6 Jan 2001

+

297. const_mem_fun_t<>::argument_type should be const T*

Section: 20.3.8 [lib.member.pointer.adaptors]  Status: WP  Submitter: Martin Sebor  Date: 6 Jan 2001

The class templates const_mem_fun_t in 20.3.8, p8 and const_mem_fun1_t in 20.3.8, p9 derive from unary_function<T*, S>, and @@ -8881,7 +8862,7 @@ binary_function<const T*, A, S> {

This is simply a contradiction: the argument_type typedef, and the argument type itself, are not the same.


-

298. ::operator delete[] requirement incorrect/insufficient

Section: 18.4.1.2 [lib.new.delete.array]  Status: WP  Submitter: John A. Pedretti  Date: 10 Jan 2001

+

298. ::operator delete[] requirement incorrect/insufficient

Section: 18.4.1.2 [lib.new.delete.array]  Status: WP  Submitter: John A. Pedretti  Date: 10 Jan 2001

The default behavior of operator delete[] described in 18.4.1.2, p12 - namely that for non-null value of ptr, the operator reclaims storage @@ -8904,7 +8885,7 @@ For a null value of ptr , does nothing. Any other value of ptr shall be a value returned earlier by a call to the default operator new[](std::size_t). [Footnote: The value must not have been invalidated by an intervening -call to operator delete[](void*) (17.4.3.7 [lib.res.on.arguments]). +call to operator delete[](void*) (17.4.3.7 [lib.res.on.arguments]). --- end footnote] For such a non-null value of ptr , reclaims storage allocated by the earlier call to the default operator new[]. @@ -8921,7 +8902,7 @@ or operator delete(ptr, std::nothrow) respectively.

and expunge paragraph 13.


-

300. list::merge() specification incomplete

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: John Pedretti  Date: 23 Jan 2001

+

300. list::merge() specification incomplete

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: John Pedretti  Date: 23 Jan 2001

The "Effects" clause for list::merge() (23.2.2.4, p23) appears to be incomplete: it doesn't cover the case where the argument @@ -8930,7 +8911,7 @@ note in p24 (below) is that x be empty after the merge which is surely unintended in this case.

Proposed resolution:

-

In 23.2.2.4 [lib.list.ops], replace paragraps 23-25 with:

+

In 23.2.2.4 [lib.list.ops], replace paragraps 23-25 with:

23 Effects: if (&x == this) does nothing; otherwise, merges the two @@ -8959,16 +8940,16 @@ effects.

[Copenhagen: The original proposed resolution did not fix all of -the problems in 23.2.2.4 [lib.list.ops], p22-25. Three different +the problems in 23.2.2.4 [lib.list.ops], p22-25. Three different paragraphs (23, 24, 25) describe the effects of merge. Changing p23, without changing the other two, appears to introduce contradictions. Additionally, "merges the argument list into the list" is excessively vague.]

-

[Post-Curaçao: Robert Klarer provided new wording.]

+

[Post-Curaçao: Robert Klarer provided new wording.]


-

301. basic_string template ctor effects clause omits allocator argument

Section: 21.3.1 [lib.string.cons]  Status: WP  Submitter: Martin Sebor  Date: 27 Jan 2001

+

301. basic_string template ctor effects clause omits allocator argument

Section: 21.3.1 [lib.string.cons]  Status: WP  Submitter: Martin Sebor  Date: 27 Jan 2001

The effects clause for the basic_string template ctor in 21.3.1, p15 leaves out the third argument of type Allocator. I believe this to be @@ -8995,7 +8976,7 @@ a mistake. static_cast<value_type>(end), a)


-

303. Bitset input operator underspecified

Section: 23.3.5.3 [lib.bitset.operators]  Status: WP  Submitter: Matt Austern  Date: 5 Feb 2001

+

303. Bitset input operator underspecified

Section: 23.3.5.3 [lib.bitset.operators]  Status: WP  Submitter: Matt Austern  Date: 5 Feb 2001

In 23.3.5.3, we are told that bitset's input operator "Extracts up to N (single-byte) characters from @@ -9100,7 +9081,7 @@ input. Using widen does mean that alternative digit representations will not be recognized, but this was a known consequence of the design choice.


-

305. Default behavior of codecvt<wchar_t, char, mbstate_t>::length()

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: WP  Submitter: Howard Hinnant  Date: 24 Jan 2001

+

305. Default behavior of codecvt<wchar_t, char, mbstate_t>::length()

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: WP  Submitter: Howard Hinnant  Date: 24 Jan 2001

22.2.1.5/3 introduces codecvt in part with:

@@ -9208,11 +9189,11 @@ single external character), but this would rule out important encodings that are in common use: it would rule out JIS, for example, and it would rule out a fixed-width encoding of UCS-4.

-

[Curaçao: fixed rationale typo at the request of Ichiro Koshida; +

[Curaçao: fixed rationale typo at the request of Ichiro Koshida; "shift-JIS" changed to "JIS".]


-

306. offsetof macro and non-POD types

Section: 18.1 [lib.support.types]  Status: WP  Submitter: Steve Clamage  Date: 21 Feb 2001

+

306. offsetof macro and non-POD types

Section: 18.1 [lib.support.types]  Status: WP  Submitter: Steve Clamage  Date: 21 Feb 2001

Spliced together from reflector messages c++std-lib-8294 and -8295:

18.1, paragraph 5, reads: "The macro offsetof @@ -9223,7 +9204,7 @@ that is a static data member or a function member is undefined."

For the POD requirement, it doesn't say "no diagnostic -required" or "undefined behavior". I read 1.4 [intro.compliance], paragraph 1, to mean that a diagnostic is required. +required" or "undefined behavior". I read 1.4 [intro.compliance], paragraph 1, to mean that a diagnostic is required. It's not clear whether this requirement was intended. While it's possible to provide such a diagnostic, the extra complication doesn't seem to add any value. @@ -9238,13 +9219,13 @@ members thought that diagnostics should be required whenever possible.]


-

307. Lack of reference typedefs in container adaptors

Section: 23.2.3 [lib.container.adaptors]  Status: WP  Submitter: Howard Hinnant  Date: 13 Mar 2001

+

307. Lack of reference typedefs in container adaptors

Section: 23.2.3 [lib.container.adaptors]  Status: WP  Submitter: Howard Hinnant  Date: 13 Mar 2001

From reflector message c++std-lib-8330. See also lib-8317.

-The standard is currently inconsistent in 23.2.3.2 [lib.priority.queue] -paragraph 1 and 23.2.3.3 [lib.stack] paragraph 1. +The standard is currently inconsistent in 23.2.3.2 [lib.priority.queue] +paragraph 1 and 23.2.3.3 [lib.stack] paragraph 1. 23.2.3.3/1, for example, says:

@@ -9270,7 +9251,7 @@ container's reference type.

I propose 3. This does not preclude option 2 if we choose to do it -later (see issue 96); the issues are independent. Option +later (see issue 96); the issues are independent. Option 3 offers a small step towards support for proxied containers. This small step fixes a current contradiction, is easy for vendors to implement, is already implemented in at least one popular lib, and @@ -9285,8 +9266,7 @@ priority_queue and stack. Change return types of "value_type&" to

Change 23.2.3.1/1 from:

-
-  namespace std {
+
  namespace std {
     template <class T, class Container = deque<T> >
     class queue {
     public:
@@ -9312,8 +9292,7 @@ priority_queue and stack.  Change return types of "value_type&" to
 
 

to:

-
-  namespace std {
+
  namespace std {
     template <class T, class Container = deque<T> >
     class queue {
     public:
@@ -9342,8 +9321,7 @@ priority_queue and stack.  Change return types of "value_type&" to
 
 

Change 23.2.3.2/1 from:

-
-  namespace std {
+
  namespace std {
     template <class T, class Container = vector<T>,
               class Compare = less<typename Container::value_type> >
     class priority_queue {
@@ -9375,8 +9353,7 @@ priority_queue and stack.  Change return types of "value_type&" to
 
 

to:

-
-  namespace std {
+
  namespace std {
     template <class T, class Container = vector<T>,
               class Compare = less<typename Container::value_type> >
     class priority_queue {
@@ -9410,8 +9387,7 @@ priority_queue and stack.  Change return types of "value_type&" to
 
 

And change 23.2.3.3/1 from:

-
-  namespace std {
+
  namespace std {
     template <class T, class Container = deque<T> >
     class stack {
     public:
@@ -9455,8 +9431,7 @@ priority_queue and stack.  Change return types of "value_type&" to
 
 

to:

-
-  namespace std {
+
  namespace std {
     template <class T, class Container = deque<T> >
     class stack {
     public:
@@ -9505,14 +9480,14 @@ and it was deliberately not adopted.  Nevertheless, the LWG believes
 (straw poll: 10-2) that it is a genuine defect.]


-

308. Table 82 mentions unrelated headers

Section: 27 [lib.input.output]  Status: WP  Submitter: Martin Sebor  Date: 15 Mar 2001

+

308. Table 82 mentions unrelated headers

Section: 27 [lib.input.output]  Status: WP  Submitter: Martin Sebor  Date: 15 Mar 2001

Table 82 in section 27 mentions the header <cstdlib> for String -streams (27.7 [lib.string.streams]) and the headers <cstdio> and -<cwchar> for File streams (27.8 [lib.file.streams]). It's not clear +streams (27.7 [lib.string.streams]) and the headers <cstdio> and +<cwchar> for File streams (27.8 [lib.file.streams]). It's not clear why these headers are mentioned in this context since they do not define any of the library entities described by the -subclauses. According to 17.4.1.1 [lib.contents], only such headers +subclauses. According to 17.4.1.1 [lib.contents], only such headers are to be listed in the summary.

Proposed resolution:

@@ -9522,10 +9497,10 @@ Table 82.

[Copenhagen: changed the proposed resolution slightly. The original proposed resolution also said to remove <cstdio> from Table 82. However, <cstdio> is mentioned several times within -section 27.8 [lib.file.streams], including 27.8.2 [lib.c.files].]

+section 27.8 [lib.file.streams], including 27.8.2 [lib.c.files].]


-

310. Is errno a macro?

Section: 17.4.1.2 [lib.headers], 19.3 [lib.errno]  Status: WP  Submitter: Steve Clamage  Date: 21 Mar 2001

+

310. Is errno a macro?

Section: 17.4.1.2 [lib.headers], 19.3 [lib.errno]  Status: WP  Submitter: Steve Clamage  Date: 21 Mar 2001

Exactly how should errno be declared in a conforming C++ header?

@@ -9609,15 +9584,14 @@ not a name is a macro; it must explicitly specify exactly which names are required to be macros. The only one that really works is for it to be a macro.

-

[Curaçao: additional rationale added.]

+

[Curaçao: additional rationale added.]


-

311. Incorrect wording in basic_ostream class synopsis

Section: 27.6.2.1 [lib.ostream]  Status: WP  Submitter: Andy Sawyer  Date: 21 Mar 2001

+

311. Incorrect wording in basic_ostream class synopsis

Section: 27.6.2.1 [lib.ostream]  Status: WP  Submitter: Andy Sawyer  Date: 21 Mar 2001

-

In 27.6.2.1 [lib.ostream], the synopsis of class basic_ostream says:

+

In 27.6.2.1 [lib.ostream], the synopsis of class basic_ostream says:

-
-  // partial specializationss
+
  // partial specializationss
   template<class traits>
     basic_ostream<char,traits>& operator<<( basic_ostream<char,traits>&,
                                             const char * );
@@ -9630,29 +9604,29 @@ to be a macro.

Proposed resolution:

-

In the synopsis in 27.6.2.1 [lib.ostream], remove the +

In the synopsis in 27.6.2.1 [lib.ostream], remove the // partial specializationss comment. Also remove the same comment (correctly spelled, but still incorrect) from the synopsis in -27.6.2.5.4 [lib.ostream.inserters.character]. +27.6.2.5.4 [lib.ostream.inserters.character].

[ -Pre-Redmond: added 27.6.2.5.4 [lib.ostream.inserters.character] because of Martin's +Pre-Redmond: added 27.6.2.5.4 [lib.ostream.inserters.character] because of Martin's comment in c++std-lib-8939. ]


-

312. Table 27 is missing headers

Section: 20 [lib.utilities]  Status: WP  Submitter: Martin Sebor  Date: 29 Mar 2001

+

312. Table 27 is missing headers

Section: 20 [lib.utilities]  Status: WP  Submitter: Martin Sebor  Date: 29 Mar 2001

Table 27 in section 20 lists the header <memory> (only) for Memory (lib.memory) but neglects to mention the headers -<cstdlib> and <cstring> that are discussed in 20.4.6 [lib.c.malloc].

+<cstdlib> and <cstring> that are discussed in 20.4.6 [lib.c.malloc].

Proposed resolution:

Add <cstdlib> and <cstring> to Table 27, in the same row as <memory>.


-

315. Bad "range" in list::unique complexity

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: Andy Sawyer  Date: 1 May 2001

+

315. Bad "range" in list::unique complexity

Section: 23.2.2.4 [lib.list.ops]  Status: WP  Submitter: Andy Sawyer  Date: 1 May 2001

-23.2.2.4 [lib.list.ops], Para 21 describes the complexity of +23.2.2.4 [lib.list.ops], Para 21 describes the complexity of list::unique as: "If the range (last - first) is not empty, exactly (last - first) -1 applications of the corresponding predicate, otherwise no applications of the predicate)". @@ -9666,7 +9640,7 @@ otherwise no applications of the predicate)". Change the "range" from (last - first) to [first, last).


-

316. Vague text in Table 69

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: Martin Sebor  Date: 4 May 2001

+

316. Vague text in Table 69

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: Martin Sebor  Date: 4 May 2001

Table 69 says this about a_uniq.insert(t):

@@ -9686,7 +9660,7 @@ indicates whether the insertion takes place.

takes place...

-

317. Instantiation vs. specialization of facets

Section: 22 [lib.localization]  Status: WP  Submitter: Martin Sebor  Date: 4 May 2001

+

317. Instantiation vs. specialization of facets

Section: 22 [lib.localization]  Status: WP  Submitter: Martin Sebor  Date: 4 May 2001

The localization section of the standard refers to specializations of the facet templates as instantiations even though the required facets @@ -9735,12 +9709,11 @@ describe templates was clarified during the standardization process, but the wording in clause 22 was never updated to reflect that change.


-

318. Misleading comment in definition of numpunct_byname

Section: 22.2.3.2 [lib.locale.numpunct.byname]  Status: WP  Submitter: Martin Sebor  Date: 12 May 2001

+

318. Misleading comment in definition of numpunct_byname

Section: 22.2.3.2 [lib.locale.numpunct.byname]  Status: WP  Submitter: Martin Sebor  Date: 12 May 2001

The definition of the numpunct_byname template contains the following comment:

-
-    namespace std {
+
    namespace std {
         template <class charT>
         class numpunct_byname : public numpunct<charT> {
     // this class is specialized for char and wchar_t.
@@ -9752,14 +9725,14 @@ conceivable that an implementation will not explicitly specialize the
 template at all, but simply provide the primary template.

Proposed resolution:

Remove the comment from the text in 22.2.3.2 and from the proposed -resolution of library issue 228.

+resolution of library issue 228.


-

319. Storage allocation wording confuses "Required behavior", "Requires"

Section: 18.4.1.1 [lib.new.delete.single], 18.4.1.2 [lib.new.delete.array]  Status: WP  Submitter: Beman Dawes  Date: 15 May 2001

-

The standard specifies 17.3.1.3 [lib.structure.specifications] that "Required +

319. Storage allocation wording confuses "Required behavior", "Requires"

Section: 18.4.1.1 [lib.new.delete.single], 18.4.1.2 [lib.new.delete.array]  Status: WP  Submitter: Beman Dawes  Date: 15 May 2001

+

The standard specifies 17.3.1.3 [lib.structure.specifications] that "Required behavior" elements describe "the semantics of a function definition provided by either the implementation or a C++ program."

-

The standard specifies 17.3.1.3 [lib.structure.specifications] that "Requires" +

The standard specifies 17.3.1.3 [lib.structure.specifications] that "Requires" elements describe "the preconditions for calling the function."

In the sections noted below, the current wording specifies @@ -9768,7 +9741,7 @@ should be specified as "Requires".

Proposed resolution:

-

In 18.4.1.1 [lib.new.delete.single] Para 12 Change:

+

In 18.4.1.1 [lib.new.delete.single] Para 12 Change:

Required behavior: accept a value of ptr that is null or that was returned by an earlier call ...

@@ -9779,7 +9752,7 @@ should be specified as "Requires".

earlier call ...

-

In 18.4.1.2 [lib.new.delete.array] Para 11 Change:

+

In 18.4.1.2 [lib.new.delete.array] Para 11 Change:

Required behavior: accept a value of ptr that is null or that was returned by an earlier call ...

@@ -9791,7 +9764,7 @@ should be specified as "Requires".


-

320. list::assign overspecified

Section: 23.2.2.1 [lib.list.cons]  Status: WP  Submitter: Howard Hinnant  Date: 17 May 2001

+

320. list::assign overspecified

Section: 23.2.2.1 [lib.list.cons]  Status: WP  Submitter: Howard Hinnant  Date: 17 May 2001

Section 23.2.2.1, paragraphs 6-8 specify that list assign (both forms) have the "effects" of a call to erase followed by a call to insert. @@ -9822,8 +9795,7 @@ Metrowerks and SGI recycle nodes, Dinkumware and Rogue Wave don't.

Effects:

-
-   erase(begin(), end());
+
   erase(begin(), end());
    insert(begin(), first, last);
 
@@ -9834,10 +9806,9 @@ Metrowerks and SGI recycle nodes, Dinkumware and Rogue Wave don't.

Effects: Replaces the contents of the list with the range [first, last).

-

In 23.1.1 [lib.sequence.reqmts], in Table 67 (sequence requirements), +

In 23.1.1 [lib.sequence.reqmts], in Table 67 (sequence requirements), add two new rows:

-
-      a.assign(i,j)     void      pre: i,j are not iterators into a.
+
      a.assign(i,j)     void      pre: i,j are not iterators into a.
                                   Replaces elements in a with a copy
                                   of [i, j).
 
@@ -9850,8 +9821,7 @@ add two new rows:

Effects:

-
-   erase(begin(), end());
+
   erase(begin(), end());
    insert(begin(), n, t);
 
@@ -9871,13 +9841,13 @@ overspecification; it would effectively mandate that assignment use a temporary. Howard provided wording. ]

-

[Curaçao: Made editorial improvement in wording; changed +

[Curaçao: Made editorial improvement in wording; changed "Replaces elements in a with copies of elements in [i, j)." with "Replaces the elements of a with a copy of [i, j)." Changes not deemed serious enough to requre rereview.]


-

321. Typo in num_get

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: WP  Submitter: Kevin Djang  Date: 17 May 2001

+

321. Typo in num_get

Section: 22.2.2.1.2 [lib.facet.num.get.virtuals]  Status: WP  Submitter: Kevin Djang  Date: 17 May 2001

Section 22.2.2.1.2 at p7 states that "A length specifier is added to the conversion function, if needed, as indicated in Table 56." @@ -9892,7 +9862,7 @@ to be "A length modifier is added ..."

Rationale:

C uses the term "length modifier". We should be consistent.


-

322. iterator and const_iterator should have the same value type

Section: 23.1 [lib.container.requirements]  Status: WP  Submitter: Matt Austern  Date: 17 May 2001

+

322. iterator and const_iterator should have the same value type

Section: 23.1 [lib.container.requirements]  Status: WP  Submitter: Matt Austern  Date: 17 May 2001

It's widely assumed that, if X is a container, iterator_traits<X::iterator>::value_type and @@ -9904,7 +9874,7 @@ iterator_traits<X::const_iterator>::value_type should be "const X::value_type".

-

Related issue: 279.

+

Related issue: 279.

Proposed resolution:

In Table 65 ("Container Requirements"), change the return type for X::iterator to "iterator type whose value type is T". Change the @@ -9924,7 +9894,7 @@ the way that const pointers are handled: the standard already requires that iterator_traits<const int*>::value_type is int.


-

324. Do output iterators have value types?

Section: 24.1.2 [lib.output.iterators]  Status: WP  Submitter: Dave Abrahams  Date: 7 June 2001

+

324. Do output iterators have value types?

Section: 24.1.2 [lib.output.iterators]  Status: WP  Submitter: Dave Abrahams  Date: 7 June 2001

Table 73 suggests that output iterators have value types. It requires the expression "*a = t". Additionally, although Table 73 @@ -10003,32 +9973,28 @@ output iterator.

Table 73, change

-
-*a = t
+
*a = t
 

to

-
-*r = o
+
*r = o
 

and change

-
-*r++ = t
+
*r++ = t
 

to

-
-*r++ = o
+
*r++ = o
 
@@ -10046,7 +10012,7 @@ and any language suggesting otherwise is simply a mistake.

A future revision of the standard may wish to revisit this design decision.


-

325. Misleading text in moneypunct<>::do_grouping

Section: 22.2.6.3.2 [lib.locale.moneypunct.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 02 Jul 2001

+

325. Misleading text in moneypunct<>::do_grouping

Section: 22.2.6.3.2 [lib.locale.moneypunct.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 02 Jul 2001

The Returns clause in 22.2.6.3.2, p3 says about moneypunct<charT>::do_grouping()

@@ -10098,7 +10064,7 @@ locale. It is just a reminder that the values are interpreted as small integers, not ASCII characters.


-

327. Typo in time_get facet in table 52

Section: 22.1.1.1.1 [lib.locale.category]  Status: WP  Submitter: Tiki Wan  Date: 06 Jul 2001

+

327. Typo in time_get facet in table 52

Section: 22.1.1.1.1 [lib.locale.category]  Status: WP  Submitter: Tiki Wan  Date: 06 Jul 2001

The wchar_t versions of time_get and time_get_byname are listed incorrectly in table 52, required instantiations. In both cases the second template @@ -10107,14 +10073,12 @@ InputIterator, since these are input facets.

Proposed resolution:

In table 52, required instantiations, in -22.1.1.1.1 [lib.locale.category], change

-
-    time_get<wchar_t, OutputIterator>
+22.1.1.1.1  [lib.locale.category], change

+
    time_get<wchar_t, OutputIterator>
     time_get_byname<wchar_t, OutputIterator>
 

to

-
-    time_get<wchar_t, InputIterator>
+
    time_get<wchar_t, InputIterator>
     time_get_byname<wchar_t, InputIterator>
 
@@ -10122,7 +10086,7 @@ In table 52, required instantiations, in a typo, wchart instead of wchar_t.]


-

328. Bad sprintf format modifier in money_put<>::do_put()

Section: 22.2.6.2.2 [lib.locale.money.put.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 07 Jul 2001

+

328. Bad sprintf format modifier in money_put<>::do_put()

Section: 22.2.6.2.2 [lib.locale.money.put.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 07 Jul 2001

The sprintf format string , "%.01f" (that's the digit one), in the description of the do_put() member functions of the money_put facet in 22.2.6.2.2, p1 is incorrect. First, the f format specifier is wrong @@ -10135,11 +10099,11 @@ modifier.

Rationale:

Fixes an obvious typo


-

329. vector capacity, reserve and reallocation

Section: 23.2.4.2 [lib.vector.capacity], 23.2.4.3 [lib.vector.modifiers]  Status: WP  Submitter: Anthony Williams  Date: 13 Jul 2001

+

329. vector capacity, reserve and reallocation

Section: 23.2.4.2 [lib.vector.capacity], 23.2.4.3 [lib.vector.modifiers]  Status: WP  Submitter: Anthony Williams  Date: 13 Jul 2001

There is an apparent contradiction about which circumstances can cause -a reallocation of a vector in Section 23.2.4.2 [lib.vector.capacity] and -section 23.2.4.3 [lib.vector.modifiers]. +a reallocation of a vector in Section 23.2.4.2 [lib.vector.capacity] and +section 23.2.4.3 [lib.vector.modifiers].

23.2.4.2p5 says:

@@ -10153,8 +10117,7 @@ greater than the size specified in the most recent call to reserve().

Which implies if I do

-
-  std::vector<int> vec;
+
  std::vector<int> vec;
   vec.reserve(23);
   vec.reserve(0);
   vec.insert(vec.end(),1);
@@ -10192,7 +10155,7 @@ than the old capacity, I think the intent is clear.
 

Proposed resolution:

-

Change the wording of 23.2.4.2 [lib.vector.capacity] paragraph 5 to:

+

Change the wording of 23.2.4.2 [lib.vector.capacity] paragraph 5 to:

Notes: Reallocation invalidates all the references, pointers, and @@ -10216,16 +10179,15 @@ the argument to the first, the intent was for the second invocation to have no effect. Wording implying that such cases have an effect on reallocation guarantees was inadvertant.


-

331. bad declaration of destructor for ios_base::failure

Section: 27.4.2.1.1 [lib.ios::failure]  Status: WP  Submitter: PremAnand M. Rao  Date: 23 Aug 2001

+

331. bad declaration of destructor for ios_base::failure

Section: 27.4.2.1.1 [lib.ios::failure]  Status: WP  Submitter: PremAnand M. Rao  Date: 23 Aug 2001

-With the change in 17.4.4.8 [lib.res.on.exception.handling] to state +With the change in 17.4.4.8 [lib.res.on.exception.handling] to state "An implementation may strengthen the exception-specification for a non-virtual function by removing listed exceptions." -(issue 119) +(issue 119) and the following declaration of ~failure() in ios_base::failure

-
-    namespace std {
+
    namespace std {
        class ios_base::failure : public exception {
        public:
            ...
@@ -10234,10 +10196,9 @@ and the following declaration of ~failure() in ios_base::failure
        };
      }
 
-

the class failure cannot be implemented since in 18.6.1 [lib.exception] the destructor of class exception has an empty +

the class failure cannot be implemented since in 18.6.1 [lib.exception] the destructor of class exception has an empty exception specification:

-
-    namespace std {
+
    namespace std {
        class exception {
        public:
          ...
@@ -10252,8 +10213,8 @@ exception specification:

The proposed resolution is consistent with the way that destructors of other classes derived from exception are handled.


-

333. does endl imply synchronization with the device?

Section: 27.6.2.7 [lib.ostream.manip]  Status: WP  Submitter: PremAnand M. Rao  Date: 27 Aug 2001

-

A footnote in 27.6.2.7 [lib.ostream.manip] states:

+

333. does endl imply synchronization with the device?

Section: 27.6.2.7 [lib.ostream.manip]  Status: WP  Submitter: PremAnand M. Rao  Date: 27 Aug 2001

+

A footnote in 27.6.2.7 [lib.ostream.manip] states:

[Footnote: The effect of executing cout << endl is to insert a newline character in the output sequence controlled by cout, then @@ -10278,7 +10239,7 @@ I could not find any other statement that explicitly defined the behavior one way or the other.

Proposed resolution:

-

Remove footnote 300 from section 27.6.2.7 [lib.ostream.manip].

+

Remove footnote 300 from section 27.6.2.7 [lib.ostream.manip].

Rationale:

We already have normative text saying what endl does: it inserts a newline character and calls flush. This footnote @@ -10286,7 +10247,7 @@ is at best redundant, at worst (as this issue says) misleading, because it appears to make promises about what flush does.


-

334. map::operator[] specification forces inefficient implementation

Section: 23.3.1.2 [lib.map.access]  Status: WP  Submitter: Andrea Griffini  Date: 02 Sep 2001

+

334. map::operator[] specification forces inefficient implementation

Section: 23.3.1.2 [lib.map.access]  Status: WP  Submitter: Andrea Griffini  Date: 02 Sep 2001

The current standard describes map::operator[] using a code example. That code example is however quite @@ -10298,8 +10259,7 @@ require all those temporary copies.

Currently map::operator[] behaviour is specified as:

-
-  Returns:
+
  Returns:
     (*((insert(make_pair(x, T()))).first)).second.
 
@@ -10326,8 +10286,7 @@ construction for each type).

A simple (half) solution would be replacing the description with:

-
-  Returns:
+
  Returns:
     (*((insert(value_type(x, T()))).first)).second.
 
@@ -10365,7 +10324,7 @@ non-conforming.

Proposed resolution:

-Replace 23.3.1.2 [lib.map.access] paragraph 1 with +Replace 23.3.1.2 [lib.map.access] paragraph 1 with

@@ -10384,7 +10343,7 @@ value_type(x, T()) into the map. wording. We may also wish to have a blanket statement somewhere in clause 17 saying that we do not intend the semantics of sample code fragments to be interpreted as specifing exactly how many copies are -made. See issue 98 for a similar problem.]

+made. See issue 98 for a similar problem.]

Rationale:

@@ -10396,13 +10355,12 @@ consistent with existing practice. we are no longer defining operator[] in terms of insert.


-

335. minor issue with char_traits, table 37

Section: 21.1.1 [lib.char.traits.require]  Status: WP  Submitter: Andy Sawyer  Date: 06 Sep 2001

+

335. minor issue with char_traits, table 37

Section: 21.1.1 [lib.char.traits.require]  Status: WP  Submitter: Andy Sawyer  Date: 06 Sep 2001

-Table 37, in 21.1.1 [lib.char.traits.require], descibes char_traits::assign +Table 37, in 21.1.1 [lib.char.traits.require], descibes char_traits::assign as:

-
-  X::assign(c,d)   assigns c = d.
+
  X::assign(c,d)   assigns c = d.
 

And para 1 says:

@@ -10419,8 +10377,7 @@ assign, at least), 'c' is intended to be a reference type.

I did a quick survey of the four implementations I happened to have lying around, and sure enough they all have signatures:

-
-    assign( charT&, const charT& );
+
    assign( charT&, const charT& );
 

(or the equivalent). It's also described this way in Nico's book. @@ -10434,14 +10391,13 @@ and char_traits<wchar_t> in 21.1.3.2...)

and change the description of assign in the table to:

-
-  X::assign(r,d)   assigns r = d
+
  X::assign(r,d)   assigns r = d
 

-

336. Clause 17 lack of references to deprecated headers

Section: 17 [lib.library]  Status: WP  Submitter: Detlef Vollmann  Date: 05 Sep 2001

+

336. Clause 17 lack of references to deprecated headers

Section: 17 [lib.library]  Status: WP  Submitter: Detlef Vollmann  Date: 05 Sep 2001

From c++std-edit-873:

-

17.4.1.2 [lib.headers], Table 11. In this table, the header +

17.4.1.2 [lib.headers], Table 11. In this table, the header <strstream> is missing.

This shows a general problem: The whole clause 17 refers quite @@ -10450,47 +10406,47 @@ library (though a deprecated one).

Proposed resolution:

-

To 17.4.1.2 [lib.headers] Table 11, C++ Library Headers, add +

To 17.4.1.2 [lib.headers] Table 11, C++ Library Headers, add "<strstream>".

In the following places, change "clauses 17 through 27" to "clauses 17 through 27 and Annex D":


-

337. replace_copy_if's template parameter should be InputIterator

Section: 25.2.4 [lib.alg.replace]  Status: WP  Submitter: Detlef Vollmann  Date: 07 Sep 2001

+

337. replace_copy_if's template parameter should be InputIterator

Section: 25.2.4 [lib.alg.replace]  Status: WP  Submitter: Detlef Vollmann  Date: 07 Sep 2001

From c++std-edit-876:

-In section 25.2.4 [lib.alg.replace] before p4: The name of the first +In section 25.2.4 [lib.alg.replace] before p4: The name of the first parameter of template replace_copy_if should be "InputIterator" -instead of "Iterator". According to 17.3.2.1 [lib.type.descriptions] p1 the +instead of "Iterator". According to 17.3.2.1 [lib.type.descriptions] p1 the parameter name conveys real normative meaning.

Proposed resolution:

Change Iterator to InputIterator.


-

338.  is whitespace allowed between `-' and a digit?

Section: 22.2 [lib.locale.categories]  Status: WP  Submitter: Martin Sebor  Date: 17 Sep 2001

+

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 +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 format for integer and floating point values, says that whitespace is optional between a plusminus and a sign.

@@ -10500,10 +10456,10 @@ The text needs to be clarified to either consistently allow or disallow whitespace between a plusminus and a sign. It might be worthwhile to consider the fact that the C library stdio facility does not permit whitespace embedded in numbers and neither does the C or -C++ core language (the syntax of integer-literals is given in 2.13.1 [lex.icon], that of floating-point-literals in 2.13.3 [lex.fcon] of the C++ standard). +C++ core language (the syntax of integer-literals is given in 2.13.1 [lex.icon], that of floating-point-literals in 2.13.3 [lex.fcon] of the C++ standard).

Proposed resolution:

-

Change the first part of 22.2.3.1 [lib.locale.numpunct] paragraph 2 from:

+

Change the first part of 22.2.3.1 [lib.locale.numpunct] paragraph 2 from:

The syntax for number formats is as follows, where digit @@ -10514,8 +10470,7 @@ value, whitespace is as determined by the facet numpunct<charT> members. Integer values have the format:

-
-  integer   ::= [sign] units
+
  integer   ::= [sign] units
   sign      ::= plusminus [whitespace]
   plusminus ::= '+' | '-'
   units     ::= digits [thousands-sep units]
@@ -10531,8 +10486,7 @@ value, and thousands-sep and decimal-point are the
 results of corresponding numpunct<charT> members.
 Integer values have the format:
 

-
-  integer   ::= [sign] units
+
  integer   ::= [sign] units
   sign      ::= plusminus
   plusminus ::= '+' | '-'
   units     ::= digits [thousands-sep units]
@@ -10540,16 +10494,16 @@ Integer values have the format:
 

Rationale:

-

It's not clear whether the format described in 22.2.3.1 [lib.locale.numpunct] paragraph 2 has any normative weight: nothing in the +

It's not clear whether the format described in 22.2.3.1 [lib.locale.numpunct] paragraph 2 has any normative weight: nothing in the standard says how, or whether, it's used. However, there's no reason for it to differ gratuitously from the very specific description of -numeric processing in 22.2.2.1.2 [lib.facet.num.get.virtuals]. The proposed +numeric processing in 22.2.2.1.2 [lib.facet.num.get.virtuals]. The proposed resolution removes all mention of "whitespace" from that format.


-

339. definition of bitmask type restricted to clause 27

Section: 22.2.1 [lib.category.ctype], 17.3.2.1.2 [lib.bitmask.types]  Status: WP  Submitter: Martin Sebor  Date: 17 September 2001

+

339. definition of bitmask type restricted to clause 27

Section: 22.2.1 [lib.category.ctype], 17.3.2.1.2 [lib.bitmask.types]  Status: WP  Submitter: Martin Sebor  Date: 17 September 2001

-The ctype_category::mask type is declared to be an enum in 22.2.1 [lib.category.ctype] with p1 then stating that it is a bitmask type, most -likely referring to the definition of bitmask type in 17.3.2.1.2 [lib.bitmask.types], p1. However, the said definition only applies to +The ctype_category::mask type is declared to be an enum in 22.2.1 [lib.category.ctype] with p1 then stating that it is a bitmask type, most +likely referring to the definition of bitmask type in 17.3.2.1.2 [lib.bitmask.types], p1. However, the said definition only applies to clause 27, making the reference in 22.2.1 somewhat dubious.

Proposed resolution:

@@ -10557,7 +10511,7 @@ clause 27, making the reference in 22.2.1 somewhat dubious.
Several types defined in clause 27 are bitmask types. Each bitmask type can be implemented as an enumerated type that overloads certain operators, - as an integer type, or as a bitset (23.3.5 [lib.template.bitset]). + as an integer type, or as a bitset (23.3.5 [lib.template.bitset]).

to read

@@ -10576,8 +10530,7 @@ following (note, in particluar, the cross-reference to 17.3.2.1.2 in

22.2.1 The ctype category [lib.category.ctype]

-
-namespace std {
+
namespace std {
     class ctype_base {
     public:
         typedef T mask;
@@ -10598,15 +10551,15 @@ namespace std {
 }
 
-

The type mask is a bitmask type (17.3.2.1.2 [lib.bitmask.types]).

+

The type mask is a bitmask type (17.3.2.1.2 [lib.bitmask.types]).

-

[Curaçao: The LWG notes that T above should be bold-italics to be +

[Curaçao: The LWG notes that T above should be bold-italics to be consistent with the rest of the standard.]


340. interpretation of has_facet<Facet>(loc) -

Section: 22.1.1.1.1 [lib.locale.category]  Status: WP  Submitter: Martin Sebor  Date: 18 Sep 2001

+

Section: 22.1.1.1.1 [lib.locale.category]  Status: WP  Submitter: Martin Sebor  Date: 18 Sep 2001

It's unclear whether 22.1.1.1.1, p3 says that has_facet<Facet>(loc) returns true for any Facet @@ -10653,7 +10606,7 @@ to hold only for specializations of Facet from Table 52 on }.

Proposed resolution:

-

In 22.1.1.1.1 [lib.locale.category], paragraph 3, change +

In 22.1.1.1.1 [lib.locale.category], paragraph 3, change "that is a member of a standard category" to "shown in Table 51".

Rationale:

The facets in Table 52 are an unbounded set. Locales should not be @@ -10663,26 +10616,25 @@ required to contain an infinite number of facets.

OutputIterator must be supported. Table 51 already contains a complete list of the ones we need.


-

341. Vector reallocation and swap

Section: 23.2.4.2 [lib.vector.capacity]  Status: WP  Submitter: Anthony Williams  Date: 27 Sep 2001

+

341. Vector reallocation and swap

Section: 23.2.4.2 [lib.vector.capacity]  Status: WP  Submitter: Anthony Williams  Date: 27 Sep 2001

It is a common idiom to reduce the capacity of a vector by swapping it with an empty one:

-
-  std::vector<SomeType> vec;
+
  std::vector<SomeType> vec;
   // fill vec with data
   std::vector<SomeType>().swap(vec);
   // vec is now empty, with minimal capacity
 
-

However, the wording of 23.2.4.2 [lib.vector.capacity]paragraph 5 prevents +

However, the wording of 23.2.4.2 [lib.vector.capacity]paragraph 5 prevents the capacity of a vector being reduced, following a call to reserve(). This invalidates the idiom, as swap() is thus prevented -from reducing the capacity. The proposed wording for issue 329 does not affect this. Consequently, the example above +from reducing the capacity. The proposed wording for issue 329 does not affect this. Consequently, the example above requires the temporary to be expanded to cater for the contents of vec, and the contents be copied across. This is a linear-time operation.

However, the container requirements state that swap must have constant -complexity (23.1 [lib.container.requirements] note to table 65).

+complexity (23.1 [lib.container.requirements] note to table 65).

This is an important issue, as reallocation affects the validity of references and iterators.

@@ -10704,10 +10656,9 @@ pointing to the same element. Consequently iterators and references that referred to one vector now refer to the other, and vice-versa.

Proposed resolution:

-

Add a new paragraph after 23.2.4.2 [lib.vector.capacity] paragraph 5:

+

Add a new paragraph after 23.2.4.2 [lib.vector.capacity] paragraph 5:

-
-  void swap(vector<T,Allocator>& x);
+
  void swap(vector<T,Allocator>& x);
 

Effects: Exchanges the contents and capacity() of *this with that of x.

@@ -10725,16 +10676,16 @@ do pointer twiddling, and that it should exchange all properties of the two vectors, including their reallocation guarantees.


-

345. type tm in <cwchar>

Section: 21.4 [lib.c.strings]  Status: WP  Submitter: Clark Nelson  Date: 19 Oct 2001

+

345. type tm in <cwchar>

Section: 21.4 [lib.c.strings]  Status: WP  Submitter: Clark Nelson  Date: 19 Oct 2001

C99, and presumably amendment 1 to C90, specify that <wchar.h> -declares struct tm as an incomplete type. However, table 48 in 21.4 [lib.c.strings] does not mention the type tm as being declared in +declares struct tm as an incomplete type. However, table 48 in 21.4 [lib.c.strings] does not mention the type tm as being declared in <cwchar>. Is this omission intentional or accidental?

Proposed resolution:

-

In section 21.4 [lib.c.strings], add "tm" to table 48.

+

In section 21.4 [lib.c.strings], add "tm" to table 48.


-

346. Some iterator member functions should be const

Section: 24.1 [lib.iterator.requirements]  Status: WP  Submitter: Jeremy Siek  Date: 20 Oct 2001

+

346. Some iterator member functions should be const

Section: 24.1 [lib.iterator.requirements]  Status: WP  Submitter: Jeremy Siek  Date: 20 Oct 2001

Iterator member functions and operators that do not change the state of the iterator should be defined as const member functions or as functions that take iterators either by const reference or by @@ -10746,43 +10697,39 @@ are suggested to make this explicit.

for non-const and a,b for const iterators. The following changes make this more explicit and also fix a couple problems.

Proposed resolution:

-

In 24.1 [lib.iterator.requirements] Change the first section of p9 from +

In 24.1 [lib.iterator.requirements] Change the first section of p9 from "In the following sections, a and b denote values of X..." to "In the following sections, a and b denote values of type const X...".

In Table 73, change

-
-    a->m   U&         ...
+
    a->m   U&         ...
 

to

-
-    a->m   const U&   ...
+
    a->m   const U&   ...
     r->m   U&         ...
 

In Table 73 expression column, change

-
-    *a = t
+
    *a = t
 

to

-
-    *r = t
+
    *r = t
 

[Redmond: The container requirements should be reviewed to see if the same problem appears there.]


-

347. locale::category and bitmask requirements

Section: 22.1.1.1.1 [lib.locale.category]  Status: WP  Submitter: P.J. Plauger, Nathan Myers  Date: 23 Oct 2001

+

347. locale::category and bitmask requirements

Section: 22.1.1.1.1 [lib.locale.category]  Status: WP  Submitter: P.J. Plauger, Nathan Myers  Date: 23 Oct 2001

-In 22.1.1.1.1 [lib.locale.category] paragraph 1, the category members +In 22.1.1.1.1 [lib.locale.category] paragraph 1, the category members are described as bitmask elements. In fact, the bitmask requirements -in 17.3.2.1.2 [lib.bitmask.types] don't seem quite right: none +in 17.3.2.1.2 [lib.bitmask.types] don't seem quite right: none and all are bitmask constants, not bitmask elements.

In particular, the requirements for none interact poorly @@ -10801,10 +10748,9 @@ re-expresses the status quo more clearly, without introducing any changes beyond resolving the DR.

Proposed resolution:

-

Replace the first two paragraphs of 22.1.1.1 [lib.locale.types] with:

+

Replace the first two paragraphs of 22.1.1.1 [lib.locale.types] with:

-
-    typedef int category;
+
    typedef int category;
 

Valid category values include the locale member bitmask @@ -10814,8 +10760,7 @@ represents a single locale category. In addition, locale member bitmask constant none is defined as zero and represents no category. And locale member bitmask constant all is defined such that the expression

-
-    (collate | ctype | monetary | numeric | time | messages | all) == all
+
    (collate | ctype | monetary | numeric | time | messages | all) == all
 

is true, and represents the union of all categories. Further @@ -10833,7 +10778,7 @@ in turn, identifies a set of locale facets, including at least those shown in Table 51:

-

[Curaçao: need input from locale experts.]

+

[Curaçao: need input from locale experts.]

Rationale:

@@ -10847,7 +10792,7 @@ shown in Table 51:

Option 2:
-Replace the first paragraph of 22.1.1.1 [lib.locale.types] with:

+Replace the first paragraph of 22.1.1.1 [lib.locale.types] with:

Valid category values include the enumerated values. In addition, the @@ -10868,10 +10813,9 @@ of the other enumerated values; implementations may add extra categories.]


-

349. Minor typographical error in ostream_iterator

Section: 24.5.2 [lib.ostream.iterator]  Status: WP  Submitter: Andy Sawyer  Date: 24 Oct 2001

+

349. Minor typographical error in ostream_iterator

Section: 24.5.2 [lib.ostream.iterator]  Status: WP  Submitter: Andy Sawyer  Date: 24 Oct 2001

24.5.2 [lib.ostream.iterator] states:

-
-    [...]
+
    [...]
 
     private:
     // basic_ostream<charT,traits>* out_stream; exposition only
@@ -10882,11 +10826,11 @@ of the other enumerated values; implementations may add extra categories.]
 should be of type 'const charT*'.

Proposed resolution:

-In 24.5.2 [lib.ostream.iterator], replace const char* delim with +In 24.5.2 [lib.ostream.iterator], replace const char* delim with const charT* delim.


-

352. missing fpos requirements

Section: 21.1.2 [lib.char.traits.typedefs]  Status: WP  Submitter: Martin Sebor  Date: 2 Dec 2001

+

352. missing fpos requirements

Section: 21.1.2 [lib.char.traits.typedefs]  Status: WP  Submitter: Martin Sebor  Date: 2 Dec 2001

(1) There are no requirements on the stateT template parameter of @@ -10929,7 +10873,7 @@ template fpos is used only in a very few places, all of which know the state type already. Unless motivation is provided, the second should be considered NAD.


-

354. Associative container lower/upper bound requirements

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: Hans Aberg  Date: 17 Dec 2001

+

354. Associative container lower/upper bound requirements

Section: 23.1.2 [lib.associative.reqmts]  Status: WP  Submitter: Hans Aberg  Date: 17 Dec 2001

Discussions in the thread "Associative container lower/upper bound requirements" on comp.std.c++ suggests that there is a defect in the @@ -10963,7 +10907,7 @@ the intention (and not possible with the "const" versions).

Proposed resolution:

-

Change Table 69 of section 23.1.2 [lib.associative.reqmts] indicated entries +

Change Table 69 of section 23.1.2 [lib.associative.reqmts] indicated entries to:

@@ -10978,10 +10922,10 @@ key greater than k, or a.end() if such an element is not found.

-

[Curaçao: LWG reviewed PR.]

+

[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 @@ -11022,7 +10966,7 @@ a.erase(--a.end()) { iterator tmp = a.end(); --tmp; a.erase(tmp); }

-

[Curaçao: LWG changed PR from "{ X::iterator tmp = +

[Curaçao: LWG changed PR from "{ X::iterator tmp = a.end(); return *--tmp; }" to "*a.rbegin()", and from "{ X::iterator tmp = a.end(); a.erase(--tmp); }" to "a.erase(rbegin())".]

@@ -11051,7 +10995,7 @@ LWG would like a new issue opened.]


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

+

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 @@ -11097,11 +11041,10 @@ Change the first sentence of 22.2.2.1.2, p9 from support for such conventions, we need to do so explicitly.


-

359. num_put<>::do_put (..., bool) undocumented

Section: 22.2.2.2.1 [lib.facet.num.put.members]  Status: WP  Submitter: Martin Sebor  Date: 12 Mar 2002

+

359. num_put<>::do_put (..., bool) undocumented

Section: 22.2.2.2.1 [lib.facet.num.put.members]  Status: WP  Submitter: Martin Sebor  Date: 12 Mar 2002

22.2.2.2.1, p1:

-
-    iter_type put (iter_type out, ios_base& str, char_type fill,
+    
    iter_type put (iter_type out, ios_base& str, char_type fill,
                    bool val) const;
     ...
 
@@ -11112,8 +11055,7 @@ Change the first sentence of 22.2.2.1.2, p9 from
 however, 22.2.2.2.2, p23:

-
-iter_type put (iter_type out, ios_base& str, char_type fill,
+
iter_type put (iter_type out, ios_base& str, char_type fill,
                bool val) const;
 
@@ -11121,8 +11063,7 @@ iter_type put (iter_type out, ios_base& str, char_type fill, Effects: If (str.flags() & ios_base::boolalpha) == 0 then do out = do_put(out, str, fill, (int)val) Otherwise do -
-             string_type s =
+
             string_type s =
                  val ? use_facet<ctype<charT> >(loc).truename()
                      : use_facet<ctype<charT> >(loc).falsename();
 
@@ -11146,11 +11087,11 @@ I think the least invasive change to fix it would be something like the following:

Proposed resolution:

-

In 22.2.2.2.2 [lib.facet.num.put.virtuals], just above paragraph 1, remove +

In 22.2.2.2.2 [lib.facet.num.put.virtuals], just above paragraph 1, remove the bool overload.

-In 22.2.2.2.2 [lib.facet.num.put.virtuals], p23, make the following changes +In 22.2.2.2.2 [lib.facet.num.put.virtuals], p23, make the following changes

@@ -11170,8 +11111,7 @@ In 22.2.2.2.2 [lib.facet. ios_base::boolalpha) == 0 then do_put (out, str, fill, (long)val) Otherwise the function obtains a string s as if by -
-             string_type s =
+
             string_type s =
                 val ? use_facet<ctype<charT> >(loc).truename()
                     : use_facet<ctype<charT> >(loc).falsename();
 
@@ -11186,7 +11126,7 @@ This fixes a couple of obvious typos, and also fixes what appears to be a requirement of gratuitous inefficiency.


-

360. locale mandates inefficient implementation

Section: 22.1.1 [lib.locale]  Status: WP  Submitter: Martin Sebor  Date: 12 Mar 2002

+

360. locale mandates inefficient implementation

Section: 22.1.1 [lib.locale]  Status: WP  Submitter: Martin Sebor  Date: 12 Mar 2002

22.1.1, p7 (copied below) allows iostream formatters and extractors to make assumptions about the values returned from facet members. @@ -11222,7 +11162,7 @@ prevents locale from being implemented efficiently.

This change is reasonable becuase it clarifies the intent of this part of the standard.


-

363. Missing exception specification in 27.4.2.1.1

Section: 27.4.2.1.1 [lib.ios::failure]  Status: WP  Submitter: Walter Brown and Marc Paterno  Date: 20 May 2002

+

363. Missing exception specification in 27.4.2.1.1

Section: 27.4.2.1.1 [lib.ios::failure]  Status: WP  Submitter: Walter Brown and Marc Paterno  Date: 20 May 2002

The destructor of ios_base::failure should have an empty throw specification, because the destructor of its base class, exception, is @@ -11230,15 +11170,14 @@ declared in this way.

Proposed resolution:

Change the destructor to

-
-  virtual ~failure() throw();
+
  virtual ~failure() throw();
 

Rationale:

Fixes an obvious glitch. This is almost editorial.


-

364. Inconsistent wording in 27.5.2.4.2

Section: 27.5.2.4.2 [lib.streambuf.virt.buffer]  Status: WP  Submitter: Walter Brown, Marc Paterno  Date: 10 May 2002

+

364. Inconsistent wording in 27.5.2.4.2

Section: 27.5.2.4.2 [lib.streambuf.virt.buffer]  Status: WP  Submitter: Walter Brown, Marc Paterno  Date: 10 May 2002

-27.5.2.4.2 [lib.streambuf.virt.buffer] paragraph 1 is inconsistent with the Effects +27.5.2.4.2 [lib.streambuf.virt.buffer] paragraph 1 is inconsistent with the Effects clause for seekoff.

Proposed resolution:

@@ -11268,7 +11207,7 @@ for each class derived from basic_streambuf in this clause the existing wording and what's in the proposed resolution, but the change may make the intent clearer.


-

365. Lack of const-qualification in clause 27

Section: 27 [lib.input.output]  Status: WP  Submitter: Walter Brown, Marc Paterno  Date: 10 May 2002

+

365. Lack of const-qualification in clause 27

Section: 27 [lib.input.output]  Status: WP  Submitter: Walter Brown, Marc Paterno  Date: 10 May 2002

Some stream and streambuf member functions are declared non-const, even thought they appear only to report information rather than to @@ -11279,22 +11218,20 @@ document N1360 for details and rationale.

The list of member functions under discussion: in_avail, showmanyc, tellg, tellp, is_open.

-

Related issue: 73

+

Related issue: 73

Proposed resolution:

In 27.8.1.5, 27.8.1.7, 27.8.1.8, 27.8.1.10, 27.8.1.11, and 27.8.1.13

Replace

-
-  bool is_open();
+
  bool is_open();
 

with

-
-  bool is_open() const;
+
  bool is_open() const;
 

Rationale:

Of the changes proposed in N1360, the only one that is safe is changing the filestreams' is_open to const. The LWG believed that -this was NAD the first time it considered this issue (issue 73), but now thinks otherwise. The corresponding streambuf +this was NAD the first time it considered this issue (issue 73), but now thinks otherwise. The corresponding streambuf member function, after all,is already const.

The other proposed changes are less safe, because some streambuf @@ -11309,12 +11246,11 @@ state exposed by the public interface is unchanged.

way by providing both overloads; this would be a conforming extension.


-

370. Minor error in basic_istream::get

Section: 27.6.1.3 [lib.istream.unformatted]  Status: WP  Submitter: Ray Lischner  Date: 15 Jul 2002

-

Defect report for description of basic_istream::get (section 27.6.1.3 [lib.istream.unformatted]), paragraph 15. The description for the get function +

370. Minor error in basic_istream::get

Section: 27.6.1.3 [lib.istream.unformatted]  Status: WP  Submitter: Ray Lischner  Date: 15 Jul 2002

+

Defect report for description of basic_istream::get (section 27.6.1.3 [lib.istream.unformatted]), paragraph 15. The description for the get function with the following signature:

-
-  basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>&
+
  basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>&
   sb);
 
@@ -11341,26 +11277,26 @@ 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] +In 27.6.1.2.1 [lib.istream.formatted.reqmts] and 27.6.2.5.1 [lib.ostream.formatted.reqmts] (exception()&badbit) != 0 is used in testing for rethrow, yet -exception() is the constructor to class std::exception in 18.6.1 [lib.exception] that has no return type. Should member function -exceptions() found in 27.4.4 [lib.ios] be used instead? +exception() is the constructor to class std::exception in 18.6.1 [lib.exception] that has no return type. Should member function +exceptions() found in 27.4.4 [lib.ios] be used instead?

Proposed resolution:

-In 27.6.1.2.1 [lib.istream.formatted.reqmts] and 27.6.2.5.1 [lib.ostream.formatted.reqmts], change +In 27.6.1.2.1 [lib.istream.formatted.reqmts] and 27.6.2.5.1 [lib.ostream.formatted.reqmts], change "(exception()&badbit) != 0" to "(exceptions()&badbit) != 0".

Rationale:

Fixes an obvious typo.


-

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 +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 "ios_base::".

@@ -11372,12 +11308,11 @@ paragraph 14 to "ios_base".

Rationale:

Fixes an obvious typo.


-

379. nonsensical ctype::do_widen() requirement

Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 6 Sep 2002

+

379. nonsensical ctype::do_widen() requirement

Section: 22.2.1.1.2 [lib.locale.ctype.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 6 Sep 2002

The last sentence in 22.2.1.1.2, p11 below doesn't seem to make sense.

-
-  charT do_widen (char c) const;
+
  charT do_widen (char c) const;
 
   -11- Effects: Applies the simplest reasonable transformation from
        a char value or sequence of char values to the corresponding
@@ -11390,8 +11325,7 @@ The last sentence in 22.2.1.1.2, p11 below doesn't seem to make sense.
 

Shouldn't the last sentence instead read

-
-       For any named ctype category with a ctype<char> facet ctc
+
       For any named ctype category with a ctype<char> facet ctc
        and valid ctype_base::mask value M
        (ctc.is(M, c) || !is(M, do_widen(c))) is true.
 
@@ -11402,11 +11336,10 @@ footnote 224.)

Proposed resolution:

-Replace the last sentence of 22.2.1.1.2 [lib.locale.ctype.virtuals], p11 with the +Replace the last sentence of 22.2.1.1.2 [lib.locale.ctype.virtuals], p11 with the following text:

-
-       For any named ctype category with a ctype<char> facet ctc
+
       For any named ctype category with a ctype<char> facet ctc
        and valid ctype_base::mask value M,
        (ctc.is(M, c) || !is(M, do_widen(c))) is true.
 
@@ -11416,9 +11349,9 @@ following text:

Rationale:

The LWG believes this is just a typo, and that this is the correct fix.


-

380. typos in codecvt tables 53 and 54

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 6 Sep 2002

+

380. typos in codecvt tables 53 and 54

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]  Status: WP  Submitter: Martin Sebor  Date: 6 Sep 2002

-Tables 53 and 54 in 22.2.1.5.2 [lib.locale.codecvt.virtuals] are both titled "convert +Tables 53 and 54 in 22.2.1.5.2 [lib.locale.codecvt.virtuals] are both titled "convert result values," when surely "do_in/do_out result values" must have been intended for Table 53 and "do_unshift result values" for Table 54. @@ -11443,7 +11376,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 @@ -11464,15 +11397,13 @@ cases, I propose the following: Add a new paragraph before 22.2.1.5.2, p5, and after the function declaration below

-
-    result do_unshift(stateT& state,
+
    result do_unshift(stateT& state,
     externT* to, externT* to_limit, externT*& to_next) const;
 

as follows:

-
-    Requires: (to <= to_end) well defined and true; state initialized,
+
    Requires: (to <= to_end) well defined and true; state initialized,
     if at the beginning of a sequence, or else equal to the result of
     converting the preceding characters in the sequence.
 
@@ -11480,14 +11411,12 @@ as follows: and change the text in Table 54, row 4, the error row, under the heading Meaning, from

-
-    state has invalid value
+
    state has invalid value
 

to

-
-    an unspecified error has occurred
+
    an unspecified error has occurred
 

Rationale:

The intent is that implementations should not be required to detect @@ -11497,7 +11426,7 @@ behavior. Implementations that do choose to detect invalid state values, or that choose to detect any other kind of error, may return error as an indication.


-

383. Bidirectional iterator assertion typo

Section: 24.1.4 [lib.bidirectional.iterators]  Status: WP  Submitter: ysapir (submitted via comp.std.c++)  Date: 17 Oct 2002

+

383. Bidirectional iterator assertion typo

Section: 24.1.4 [lib.bidirectional.iterators]  Status: WP  Submitter: ysapir (submitted via comp.std.c++)  Date: 17 Oct 2002

Following a discussion on the boost list regarding end iterators and the possibility of performing operator--() on them, it seems to me @@ -11509,8 +11438,8 @@ with that discussion. I have checked this newsgroup, as well as attempted a search of the Active/Defect/Closed Issues List on the site for the words "s is derefer" so I believe this has not been proposed before. Furthermore, -the "Lists by Index" mentions only DR 299 on section -24.1.4, and DR 299 is not related to this issue. +the "Lists by Index" mentions only DR 299 on section +24.1.4, and DR 299 is not related to this issue.

@@ -11518,8 +11447,7 @@ The standard makes the following assertion on bidirectional iterators, in section 24.1.4 [lib.bidirectional.iterators], Table 75:

-
-                         operational  assertion/note
+
                         operational  assertion/note
 expression  return type   semantics    pre/post-condition
 
 --r          X&                        pre: there exists s such
@@ -11555,10 +11483,9 @@ Change the guarantee to "postcondition: r is dereferenceable."
 

Rationale:

Fixes an obvious typo


-

389. Const overload of valarray::operator[] returns by value

Section: 26.3.2 [lib.template.valarray]  Status: WP  Submitter: Gabriel Dos Reis  Date: 8 Nov 2002

+

389. Const overload of valarray::operator[] returns by value

Section: 26.3.2 [lib.template.valarray]  Status: WP  Submitter: Gabriel Dos Reis  Date: 8 Nov 2002

Consider the following program:

-
-    #include <iostream>
+
    #include <iostream>
     #include <ostream>
     #include <vector>
     #include <valarray>
@@ -11596,14 +11523,12 @@ integration within programs written in C++.  There is no reason why
 subscripting an expression of type valarray<T> that is const-qualified
 should not return a const T&.

Proposed resolution:

-

In the class synopsis in 26.3.2 [lib.template.valarray], and in -26.3.2.3 [lib.valarray.access] just above paragraph 1, change

-
-  T operator[](size_t const);
+

In the class synopsis in 26.3.2 [lib.template.valarray], and in +26.3.2.3 [lib.valarray.access] just above paragraph 1, change

+
  T operator[](size_t const);
 

to

-
-  const T& operator[](size_t const);
+
  const T& operator[](size_t const);
 

[Kona: fixed a minor typo: put semicolon at the end of the line @@ -11616,28 +11541,28 @@ integrated with libraries in other languages, and return by value defeats that purpose. It is believed that this change will have no impact on allowable optimizations.


-

391. non-member functions specified as const

Section: 22.1.3.2 [lib.conversions]  Status: WP  Submitter: James Kanze  Date: 10 Dec 2002

+

391. non-member functions specified as const

Section: 22.1.3.2 [lib.conversions]  Status: WP  Submitter: James Kanze  Date: 10 Dec 2002

The specifications of toupper and tolower both specify the functions as const, althought they are not member functions, and are not specified as -const in the header file synopsis in section 22.1 [lib.locales]. +const in the header file synopsis in section 22.1 [lib.locales].

Proposed resolution:

-

In 22.1.3.2 [lib.conversions], remove const from the function +

In 22.1.3.2 [lib.conversions], remove const from the function declarations of std::toupper and std::tolower

Rationale:

Fixes an obvious typo


-

395. inconsistencies in the definitions of rand() and random_shuffle()

Section: 26.5 [lib.c.math]  Status: WP  Submitter: James Kanze  Date: 3 Jan 2003

+

395. inconsistencies in the definitions of rand() and random_shuffle()

Section: 26.5 [lib.c.math]  Status: WP  Submitter: James Kanze  Date: 3 Jan 2003

-In 26.5 [lib.c.math], the C++ standard refers to the C standard for the +In 26.5 [lib.c.math], the C++ standard refers to the C standard for the definition of rand(); in the C standard, it is written that "The implementation shall behave as if no library function calls the rand function."

-In 25.2.11 [lib.alg.random.shuffle], there is no specification as to +In 25.2.11 [lib.alg.random.shuffle], there is no specification as to how the two parameter version of the function generates its random value. I believe that all current implementations in fact call rand() (in contradiction with the requirement avove); if an implementation does @@ -11668,14 +11593,13 @@ implementation is permitted to use rand.] problem if the number of elements in the sequence is greater than RAND_MAX.


-

400. redundant type cast in lib.allocator.members

Section: 20.4.1.1 [lib.allocator.members]  Status: WP  Submitter: Markus Mauhart  Date: 27 Feb 2003

+

400. redundant type cast in lib.allocator.members

Section: 20.4.1.1 [lib.allocator.members]  Status: WP  Submitter: Markus Mauhart  Date: 27 Feb 2003

-20.4.1.1 [lib.allocator.members] allocator members, contains +20.4.1.1 [lib.allocator.members] allocator members, contains the following 3 lines:

-
-  12 Returns: new((void *) p) T( val)
+
  12 Returns: new((void *) p) T( val)
      void destroy(pointer p);
   13 Returns: ((T*) p)->~T()
 
@@ -11691,27 +11615,25 @@ Replace "((T*) p)" with "p".

Rationale:

Just a typo, this is really editorial.


-

402. wrong new expression in [some_]allocator::construct

Section: 20.1.5 [lib.allocator.requirements], 20.4.1.1 [lib.allocator.members],   Status: WP  Submitter: Markus Mauhart  Date: 27 Feb 2003

+

402. wrong new expression in [some_]allocator::construct

Section: 20.1.5 [lib.allocator.requirements], 20.4.1.1 [lib.allocator.members],   Status: WP  Submitter: Markus Mauhart  Date: 27 Feb 2003

This applies to the new expression that is contained in both par12 of -20.4.1.1 [lib.allocator.members] and in par2 (table 32) of 20.1.5 [lib.allocator.requirements]. +20.4.1.1 [lib.allocator.members] and in par2 (table 32) of 20.1.5 [lib.allocator.requirements]. I think this new expression is wrong, involving unintended side effects.

-

20.4.1.1 [lib.allocator.members] contains the following 3 lines:

+

20.4.1.1 [lib.allocator.members] contains the following 3 lines:

-
-  11 Returns: the largest value N for which the call allocate(N,0) might succeed.
+
  11 Returns: the largest value N for which the call allocate(N,0) might succeed.
      void construct(pointer p, const_reference val);
   12 Returns: new((void *) p) T( val)
 
-

20.1.5 [lib.allocator.requirements] in table 32 has the following line:

-
-  a.construct(p,t)   Effect: new((void*)p) T(t)
+

20.1.5 [lib.allocator.requirements] in table 32 has the following line:

+
  a.construct(p,t)   Effect: new((void*)p) T(t)
 

@@ -11719,8 +11641,7 @@ effects. especially from table 31:

-
-  alloc<T>             a     ;// an allocator for T
+
  alloc<T>             a     ;// an allocator for T
   alloc<T>::pointer    p     ;// random access iterator
                               // (may be different from T*)
   alloc<T>::reference  r = *p;// T&
@@ -11746,34 +11667,34 @@ probably must think about it.
 Replace "new" with "::new" in both cases.
 


-

403. basic_string::swap should not throw exceptions

Section: 21.3.5.8 [lib.string::swap]  Status: WP  Submitter: Beman Dawes  Date: 25 Mar 2003

+

403. basic_string::swap should not throw exceptions

Section: 21.3.5.8 [lib.string::swap]  Status: WP  Submitter: Beman Dawes  Date: 25 Mar 2003

-std::basic_string, 21.3 [lib.basic.string] paragraph 2 says that +std::basic_string, 21.3 [lib.basic.string] paragraph 2 says that basic_string "conforms to the requirements of a Sequence, as specified in (23.1.1)." The sequence requirements specified in (23.1.1) to not include any prohibition on swap members throwing exceptions.

-Section 23.1 [lib.container.requirements] paragraph 10 does limit conditions under +Section 23.1 [lib.container.requirements] paragraph 10 does limit conditions under which exceptions may be thrown, but applies only to "all container types defined in this clause" and so excludes basic_string::swap because it is defined elsewhere.

-Eric Niebler points out that 21.3 [lib.basic.string] paragraph 5 explicitly +Eric Niebler points out that 21.3 [lib.basic.string] paragraph 5 explicitly permits basic_string::swap to invalidates iterators, which is -disallowed by 23.1 [lib.container.requirements] paragraph 10. Thus the standard would +disallowed by 23.1 [lib.container.requirements] paragraph 10. Thus the standard would be contradictory if it were read or extended to read as having -basic_string meet 23.1 [lib.container.requirements] paragraph 10 requirements. +basic_string meet 23.1 [lib.container.requirements] paragraph 10 requirements.

Yet several LWG members have expressed the belief that the original intent was that basic_string::swap should not throw exceptions as -specified by 23.1 [lib.container.requirements] paragraph 10, and that the standard is +specified by 23.1 [lib.container.requirements] paragraph 10, and that the standard is unclear on this issue. The complexity of basic_string::swap is specified as "constant time", indicating the intent was to avoid copying (which could cause a bad_alloc or other exception). An @@ -11783,7 +11704,7 @@ exception-safe code.

Note: There remains long standing concern over whether or not it is -possible to reasonably meet the 23.1 [lib.container.requirements] paragraph 10 swap +possible to reasonably meet the 23.1 [lib.container.requirements] paragraph 10 swap requirements when allocators are unequal. The specification of basic_string::swap exception requirements is in no way intended to address, prejudice, or otherwise impact that concern. @@ -11795,14 +11716,14 @@ address, prejudice, or otherwise impact that concern.

Proposed resolution:

-In 21.3.5.8 [lib.string::swap], add a throws clause: +In 21.3.5.8 [lib.string::swap], add a throws clause:

Throws: Shall not throw exceptions.


-

404. May a replacement allocation function be declared inline?

Section: 17.4.3.4 [lib.replacement.functions], 18.4.1 [lib.new.delete]  Status: WP  Submitter: Matt Austern  Date: 24 Apr 2003

+

404. May a replacement allocation function be declared inline?

Section: 17.4.3.4 [lib.replacement.functions], 18.4.1 [lib.new.delete]  Status: WP  Submitter: Matt Austern  Date: 24 Apr 2003

The eight basic dynamic memory allocation functions (single-object and array versions of ::operator new and ::operator delete, in the @@ -11813,15 +11734,15 @@ in preference to the implementation's definition.

Three different parts of the standard mention requirements on -replacement functions: 17.4.3.4 [lib.replacement.functions], 18.4.1.1 [lib.new.delete.single] -and 18.4.1.2 [lib.new.delete.array], and 3.7.3 [basic.stc.dynamic]. +replacement functions: 17.4.3.4 [lib.replacement.functions], 18.4.1.1 [lib.new.delete.single] +and 18.4.1.2 [lib.new.delete.array], and 3.7.3 [basic.stc.dynamic].

None of these three places say whether a replacement function may - be declared inline. 18.4.1.1 [lib.new.delete.single] paragraph 2 specifies a + be declared inline. 18.4.1.1 [lib.new.delete.single] paragraph 2 specifies a signature for the replacement function, but that's not enough: the inline specifier is not part of a function's signature. - One might also reason from 7.1.2 [dcl.fct.spec] paragraph 2, which + One might also reason from 7.1.2 [dcl.fct.spec] paragraph 2, which requires that "an inline function shall be defined in every translation unit in which it is used," but this may not be quite specific enough either. We should either explicitly allow or @@ -11829,7 +11750,7 @@ and 18.4.1.2 [lib.new.delete.ar functions.

Proposed resolution:

-Add a new sentence to the end of 17.4.3.4 [lib.replacement.functions] paragraph 3: +Add a new sentence to the end of 17.4.3.4 [lib.replacement.functions] paragraph 3: "The program's definitions shall not be specified as inline. No diagnostic is required."

@@ -11845,9 +11766,28 @@ Providing this functionality would be difficult in some cases, and is believed to be of limited value.


-

407. Can singular iterators be destroyed?

Section: 24.1 [lib.iterator.requirements]  Status: WP  Submitter: Nathan Myers  Date: 3 June 2003

+

405. qsort and POD

Section: 25.4 [lib.alg.c.library]  Status: DR  Submitter: Ray Lischner  Date: 08 Apr 2003

+

+Section 25.4 [lib.alg.c.library] describes bsearch and qsort, from the C +standard library. Paragraph 4 does not list any restrictions on qsort, +but it should limit the base parameter to point to POD. Presumably, +qsort sorts the array by copying bytes, which requires POD. +

+

Proposed resolution:

+

+In 25.4 [lib.alg.c.library] paragraph 4, just after the declarations and +before the nonnormative note, add these words: "both of which have the +same behavior as the original declaration. The behavior is undefined +unless the objects in the array pointed to by base are of POD +type." +

+ +

[Something along these lines is clearly necessary. Matt + provided wording.]

+
+

407. Can singular iterators be destroyed?

Section: 24.1 [lib.iterator.requirements]  Status: WP  Submitter: Nathan Myers  Date: 3 June 2003

-Clause 24.1 [lib.iterator.requirements], paragraph 5, says that the only expression +Clause 24.1 [lib.iterator.requirements], paragraph 5, says that the only expression that is defined for a singular iterator is "an assignment of a non-singular value to an iterator that holds a singular value". This means that destroying a singular iterator (e.g. letting an automatic @@ -11861,9 +11801,78 @@ destroying an iterator that holds a singular value, or the assignment of a non-singular value to an iterator that holds a singular value."


-

411. Wrong names of set member functions

Section: 25.3.5 [lib.alg.set.operations]  Status: WP  Submitter: Daniel Frey  Date: 9 Jul 2003

+

410. Missing semantics for stack and queue comparison operators

Section: 23.2.3.1 [lib.queue], 23.2.3.3 [lib.stack]  Status: DR  Submitter: Hans Bos  Date: 7 Jun 2003

+

+Sections 23.2.3.1 [lib.queue] and 23.2.3.3 [lib.stack] list +comparison operators (==, !=, <, <=, >, =>) for queue and +stack. Only the semantics for queue::operator== (23.2.3.1 [lib.queue] par2) and queue::operator< (23.2.3.1 [lib.queue] +par3) are defined. +

+

Proposed resolution:

+ +

Add the following new paragraphs after 23.2.3.1 [lib.queue] + paragraph 3:

+ +
+ +
  operator!=
+
+

Returns: x.c != y.c

+ +
  operator>
+
+

Returns: x.c > y.c

+ +
  operator<=
+
+

Returns: x.c <= y.c

+ +
  operator>=
+
+

Returns: x.c >= y.c

+ +
+ +

Add the following paragraphs at the end of 23.2.3.3 [lib.stack]:

+ +
+ +
  operator==
+
+

Returns: x.c == y.c

+ +
  operator<
+
+

Returns: x.c < y.c

+ +
  operator!=
+
+

Returns: x.c != y.c

+ +
  operator>
+
+

Returns: x.c > y.c

+ +
  operator<=
+
+

Returns: x.c <= y.c

+ +
  operator>=
+
+

Returns: x.c >= y.c

+ +
+ + +

[Kona: Matt provided wording.]

+ +

Rationale:

+There isn't any real doubt about what these operators are +supposed to do, but we ought to spell it out. +
+

411. Wrong names of set member functions

Section: 25.3.5 [lib.alg.set.operations]  Status: WP  Submitter: Daniel Frey  Date: 9 Jul 2003

-25.3.5 [lib.alg.set.operations] paragraph 1 reads: +25.3.5 [lib.alg.set.operations] paragraph 1 reads: "The semantics of the set operations are generalized to multisets in a standard way by defining union() to contain the maximum number of occurrences of every element, intersection() to contain the minimum, and @@ -11877,13 +11886,34 @@ set_intersection(), not union() and intersection().

Proposed resolution:

Change that sentence to use the correct names.


-

414. Which iterators are invalidated by v.erase()?

Section: 23.2.4.3 [lib.vector.modifiers]  Status: WP  Submitter: Matt Austern  Date: 19 Aug 2003

+

412. Typo in 27.4.4.3

Section: 27.4.4.3 [lib.iostate.flags]  Status: DR  Submitter: Martin Sebor  Date: 10 Jul 2003

+

+The Effects clause in 27.4.4.3 [lib.iostate.flags] paragraph 5 says that the +function only throws if the respective bits are already set prior to +the function call. That's obviously not the intent. The typo ought to +be corrected and the text reworded as: "If (state & +exceptions()) == 0, returns. ..." +

+

Proposed resolution:

+

+In 27.4.4.3 [lib.iostate.flags] paragraph 5, replace "If (rdstate() & +exceptions()) == 0" with "If ((state | (rdbuf() ? goodbit : badbit)) +& exceptions()) == 0". +

+ +

[Kona: the original proposed resolution wasn't quite right. We + really do mean rdstate(); the ambiguity is that the wording in the + standard doesn't make it clear whether we mean rdstate() before + setting the new state, or rdsate() after setting it. We intend the + latter, of course. Post-Kona: Martin provided wording.]

+ +
+

414. Which iterators are invalidated by v.erase()?

Section: 23.2.4.3 [lib.vector.modifiers]  Status: WP  Submitter: Matt Austern  Date: 19 Aug 2003

Consider the following code fragment:

-
-int A[8] = { 1,3,5,7,9,8,4,2 };
+
int A[8] = { 1,3,5,7,9,8,4,2 };
 std::vector<int> v(A, A+8);
 
 std::vector<int>::iterator i1 = v.begin() + 3;
@@ -11927,7 +11957,7 @@ techniques.)
 

Proposed resolution:

-In 23.2.4.3 [lib.vector.modifiers] paragraph 3, change "Invalidates all the +In 23.2.4.3 [lib.vector.modifiers] paragraph 3, change "Invalidates all the iterators and references after the point of the erase" to "Invalidates iterators and references at or after the point of the erase". @@ -11939,7 +11969,35 @@ erase". and references in parallel, and it would seem counterintuitive to say that a reference to an erased value remains valid.


-

420. is std::FILE a complete type?

Section: 27.8.1 [lib.fstreams]  Status: WP  Submitter: Martin Sebor  Date: 18 Sep 2003

+

415. behavior of std::ws

Section: 27.6.1.4 [lib.istream.manip]  Status: DR  Submitter: Martin Sebor  Date: 18 Sep 2003

+

+According to 27.6.1.4, the ws() manipulator is not required to construct +the sentry object. The manipulator is also not a member function so the +text in 27.6.1, p1 through 4 that describes the exception policy for +istream member functions does not apply. That seems inconsistent with +the rest of extractors and all the other input functions (i.e., ws will +not cause a tied stream to be flushed before extraction, it doesn't check +the stream's exceptions or catch exceptions thrown during input, and it +doesn't affect the stream's gcount). +

+

Proposed resolution:

+

+Add to 27.6.1.4 [lib.istream.manip], immediately before the first sentence +of paragraph 1, the following text: +

+ +
+ Behaves as an unformatted input function (as described in + 27.6.1.3, paragraph 1), except that it does not count the number + of characters extracted and does not affect the value returned by + subsequent calls to is.gcount(). After constructing a sentry + object... +
+ +

[Post-Kona: Martin provided wording]

+ +
+

420. is std::FILE a complete type?

Section: 27.8.1 [lib.fstreams]  Status: WP  Submitter: Martin Sebor  Date: 18 Sep 2003

7.19.1, p2, of C99 requires that the FILE type only be declared in <stdio.h>. None of the (implementation-defined) members of the @@ -11952,14 +12010,96 @@ it really the intent that FILE be a complete type or is an implementation allowed to just declare it without providing a full definition?

Proposed resolution:

-

In the first sentence of 27.8.1 [lib.fstreams] paragraph 2, change +

In the first sentence of 27.8.1 [lib.fstreams] paragraph 2, change "defined" to "declared".

Rationale:

We don't want to impose any restrictions beyond what the C standard already says. We don't want to make anything implementation defined, because that imposes new requirements in implementations.


-

428. string::erase(iterator) validity

Section: 21.3.5.5 [lib.string::erase]  Status: WP  Submitter: Martin Sebor  Date: 18 Sep 2003

+

425. return value of std::get_temporary_buffer

Section: 20.4.3 [lib.temporary.buffer]  Status: DR  Submitter: Martin Sebor  Date: 18 Sep 2003

+

+The standard is not clear about the requirements on the value returned from +a call to get_temporary_buffer(0). In particular, it fails to specify whether +the call should return a distinct pointer each time it is called (like +operator new), or whether the value is unspecified (as if returned by +malloc). The standard also fails to mention what the required behavior +is when the argument is less than 0. +

+

Proposed resolution:

+

Change 20.4.3 [lib.temporary.buffer] paragraph 2 from "...or a pair of 0 +values if no storage can be obtained" to "...or a pair of 0 values if +no storage can be obtained or if n <= 0."

+

[Kona: Matt provided wording]

+
+

426. search_n(), fill_n(), and generate_n() with negative n

Section: 25.1.9 [lib.alg.search], 25.2.5 [lib.alg.fill], 25.2.6 [lib.alg.generate]  Status: DR  Submitter: Martin Sebor  Date: 18 Sep 2003

+

+The complexity requirements for these function templates are incorrect +(or don't even make sense) for negative n:

+ +

25.1.9, p7 (search_n): +
+Complexity: At most (last1 - first1) * count applications +of the corresponding predicate.

+ +

25.2.5, p3 (fill_n): +
+Complexity: Exactly last - first (or n) assignments.

+
+ +

25.2.6, p3 (generate_n): +
+Complexity: Exactly last - first (or n) assignments.

+ +

+In addition, the Requirements or the Effects clauses for the latter two +templates don't say anything about the behavior when n is negative. +

+

Proposed resolution:

+

Change 25.1.9, p7 to

+ +
+Complexity: At most (last1 - first1) * count applications +of the corresponding predicate if count is positive, +or 0 otherwise. +
+ +

Change 25.2.5, p2 to

+
+Effects: Assigns value through all the iterators in the range [first, +last), or [first, first + n) if n is positive, none otherwise. +
+ +

Change 25.2.5, p3 to:

+
+Complexity: Exactly last - first (or n if n is positive, +or 0 otherwise) assignments. +
+ +

+Change 25.2.6, p1 +to (notice the correction for the misspelled "through"): +

+
+Effects: Invokes the function object genand assigns the return +value of gen through all the iterators in the range [first, last), +or [first, first + n) if n is positive, or [first, first) +otherwise. +
+ +

Change 25.2.6, p3 to:

+
+Complexity: Exactly last - first (or n if n is positive, +or 0 otherwise) assignments. +
+

Rationale:

+

Informally, we want to say that whenever we see a negative number + we treat it the same as if it were zero. We believe the above + changes do that (although they may not be the minimal way of saying + so). The LWG considered and rejected the alternative of saying that + negative numbers are undefined behavior.

+
+

428. string::erase(iterator) validity

Section: 21.3.5.5 [lib.string::erase]  Status: WP  Submitter: Martin Sebor  Date: 18 Sep 2003

23.1.1, p3 along with Table 67 specify as a prerequisite for a.erase(q) that q must be a valid dereferenceable iterator into the sequence a. @@ -11975,7 +12115,7 @@ This may be interepreted as a relaxation of the general requirement, which is most likely not the intent.

Proposed resolution:

-

Remove 21.3.5.5 [lib.string::erase] paragraph 5.

+

Remove 21.3.5.5 [lib.string::erase] paragraph 5.

Rationale:

The LWG considered two options: changing the string requirements to match the general container requirements, or just removing the @@ -11983,7 +12123,328 @@ which is most likely not the intent. option, on the grounds that duplicating text always risks the possibility that it might be duplicated incorrectly.


-

436. are cv-qualified facet types valid facets?

Section: 22.1.1.1.2 [lib.locale.facet]  Status: WP  Submitter: Martin Sebor  Date: 15 Oct 2003

+

432. stringbuf::overflow() makes only one write position available

Section: 27.7.1.3 [lib.stringbuf.virtuals]  Status: DR  Submitter: Christian W Brock  Date: 24 Sep 2003

+

27.7.1.3 par 8 says:

+
+Notes: The function can make a write position available only if + ( mode & ios_base::out) != 0. To make a write position + available, the function reallocates (or initially allocates) an + array object with a sufficient number of elements to hold the + current array object (if any), plus one additional write position. + If ( mode & ios_base::in) != 0, the function alters the read end + pointer egptr() to point just past the new write position (as + does the write end pointer epptr()). +
+ +

+The sentences "plus one additional write position." and especially + "(as does the write end pointer epptr())" COULD by interpreted + (and is interpreted by at least my library vendor) as: +

+ +
+ post-condition: epptr() == pptr()+1 +
+ +

+This WOULD force sputc() to call the virtual overflow() each time. +

+ +

The proposed change also affects Defect Report 169.

+ +

Proposed resolution:

+

27.7.1.1/2 Change:

+ +
+2- Notes: The function allocates no array object. +
+ +

+to: +

+ +
+2- Postcondition: str() == "". +
+ +

+27.7.1.1/3 Change: +

+ +
+

+-3- Effects: Constructs an object of class basic_stringbuf, +initializing the base class with basic_streambuf() +(lib.streambuf.cons), and initializing mode with which . Then copies +the content of str into the basic_stringbuf underlying character +sequence and initializes the input and output sequences according to +which. If which & ios_base::out is true, initializes the output +sequence with the underlying sequence. If which & ios_base::in is +true, initializes the input sequence with the underlying sequence. +

+
+ +

to:

+ +
+

+-3- Effects: Constructs an object of class basic_stringbuf, +initializing the base class with basic_streambuf() +(lib.streambuf.cons), and initializing mode with which. Then copies +the content of str into the basic_stringbuf underlying character +sequence. If which & ios_base::out is true, initializes the output +sequence such that pbase() points to the first underlying character, +epptr() points one past the last underlying character, and if (which & +ios_base::ate) is true, pptr() is set equal to +epptr() else pptr() is set equal to pbase(). If which & ios_base::in +is true, initializes the input sequence such that eback() and gptr() +point to the first underlying character and egptr() points one past +the last underlying character. +

+
+ +

27.7.1.2/1 Change:

+ +
+

+-1- Returns: A basic_string object whose content is equal to the +basic_stringbuf underlying character sequence. If the buffer is only +created in input mode, the underlying character sequence is equal to +the input sequence; otherwise, it is equal to the output sequence. In +case of an empty underlying character sequence, the function returns +basic_string<charT,traits,Allocator>(). +

+
+ +

to:

+ +
+

+-1- Returns: A basic_string object whose content is equal to the +basic_stringbuf underlying character sequence. If the basic_stringbuf +was created only in input mode, the resultant basic_string contains +the character sequence in the range [eback(), egptr()). If the +basic_stringbuf was created with (which & ios_base::out) being true +then the resultant basic_string contains the character sequence in the +range [pbase(), high_mark) where high_mark represents the position one +past the highest initialized character in the buffer. Characters can +be initialized either through writing to the stream, or by +constructing the basic_stringbuf with a basic_string, or by calling +the str(basic_string) member function. In the case of calling the +str(basic_string) member function, all characters initialized prior to +the call are now considered uninitialized (except for those +characters re-initialized by the new basic_string). Otherwise the +basic_stringbuf has been created in neither input nor output mode and +a zero length basic_string is returned. +

+
+ +

+27.7.1.2/2 Change: +

+ +
+

+-2- Effects: If the basic_stringbuf's underlying character sequence is +not empty, deallocates it. Then copies the content of s into the +basic_stringbuf underlying character sequence and initializes the +input and output sequences according to the mode stored when creating +the basic_stringbuf object. If (mode&ios_base::out) is true, then +initializes the output sequence with the underlying sequence. If +(mode&ios_base::in) is true, then initializes the input sequence with +the underlying sequence. +

+
+ +

to:

+ +
+

+-2- Effects: Copies the content of s into the basic_stringbuf +underlying character sequence. If mode & ios_base::out is true, +initializes the output sequence such that pbase() points to the first +underlying character, epptr() points one past the last underlying +character, and if (mode & ios_base::ate) is true, +pptr() is set equal to epptr() else pptr() is set equal to pbase(). If +mode & ios_base::in is true, initializes the input sequence such that +eback() and gptr() point to the first underlying character and egptr() +points one past the last underlying character. +

+
+ +

Remove 27.2.1.2/3. (Same rationale as issue 238: incorrect and unnecessary.)

+ +

27.7.1.3/1 Change:

+ +
+

+1- Returns: If the input sequence has a read position available, +returns traits::to_int_type(*gptr()). Otherwise, returns +traits::eof(). +

+
+ +

to:

+ +
+

+1- Returns: If the input sequence has a read position available, +returns traits::to_int_type(*gptr()). Otherwise, returns +traits::eof(). Any character in the underlying buffer which has been +initialized is considered to be part of the input sequence. +

+
+ +

27.7.1.3/9 Change:

+ +
+

+-9- Notes: The function can make a write position available only if ( +mode & ios_base::out) != 0. To make a write position available, the +function reallocates (or initially allocates) an array object with a +sufficient number of elements to hold the current array object (if +any), plus one additional write position. If ( mode & ios_base::in) != +0, the function alters the read end pointer egptr() to point just past +the new write position (as does the write end pointer epptr()). +

+
+ +

to:

+ +
+

+-9- The function can make a write position available only if ( mode & +ios_base::out) != 0. To make a write position available, the function +reallocates (or initially allocates) an array object with a sufficient +number of elements to hold the current array object (if any), plus one +additional write position. If ( mode & ios_base::in) != 0, the +function alters the read end pointer egptr() to point just past the +new write position. +

+
+ +

27.7.1.3/12 Change:

+ +
+

+-12- _ If (newoff + off) < 0, or (xend - xbeg) < (newoff + off), the +positioning operation fails. Otherwise, the function assigns xbeg + +newoff + off to the next pointer xnext . +

+
+ +

to:

+ +
+

+-12- _ If (newoff + off) < 0, or if (newoff + off) refers to an +uninitialized character (as defined in 27.7.1.2 [lib.stringbuf.members] +paragraph 1), the positioning operation fails. Otherwise, the function +assigns xbeg + newoff + off to the next pointer xnext . +

+
+ +

[post-Kona: Howard provided wording. At Kona the LWG agreed that + something along these lines was a good idea, but the original + proposed resolution didn't say enough about the effect of various + member functions on the underlying character sequences.]

+ +

Rationale:

+

The current basic_stringbuf description is over-constrained in such +a way as to prohibit vendors from making this the high-performance +in-memory stream it was meant to be. The fundamental problem is that +the pointers: eback(), gptr(), egptr(), pbase(), pptr(), epptr() are +observable from a derived client, and the current description +restricts the range [pbase(), epptr()) from being grown geometrically. +This change allows, but does not require, geometric growth of this +range.

+ +

Backwards compatibility issues: These changes will break code that +derives from basic_stringbuf, observes epptr(), and depends upon +[pbase(), epptr()) growing by one character on each call to overflow() +(i.e. test suites). Otherwise there are no backwards compatibility +issues.

+ +

27.7.1.1/2: The non-normative note is non-binding, and if it were +binding, would be over specification. The recommended change focuses +on the important observable fact.

+ +

27.7.1.1/3: This change does two things: 1. It describes exactly +what must happen in terms of the sequences. The terms "input +sequence" and "output sequence" are not well defined. 2. It +introduces a common extension: open with app or ate mode. I concur +with issue 238 that paragraph 4 is both wrong and unnecessary.

+ +

27.7.1.2/1: This change is the crux of the efficiency issue. The +resultant basic_string is not dependent upon epptr(), and thus +implementors are free to grow the underlying buffer geometrically +during overflow() *and* place epptr() at the end of that buffer.

+ +

27.7.1.2/2: Made consistent with the proposed 27.7.1.1/3.

+ +

27.7.1.3/1: Clarifies that characters written to the stream beyond +the initially specified string are available for reading in an i/o +basic_streambuf.

+ +

27.7.1.3/9: Made normative by removing "Notes:", and removed the +trailing parenthetical comment concerning epptr().

+ +

27.7.1.3/12: Restricting the positioning to [xbeg, xend) is no +longer allowable since [pbase(), epptr()) may now contain +uninitialized characters. Positioning is only allowable over the +initialized range.

+
+

435. bug in DR 25

Section: 21.3.7.9 [lib.string.io]  Status: DR  Submitter: Martin Sebor  Date: 15 Oct 2003

+ +

+It has been pointed out that the proposed resolution in DR 25 may not be +quite up to snuff:
+http://gcc.gnu.org/ml/libstdc++/2003-09/msg00147.html +http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#25
+

+ +

+It looks like Petur is right. The complete corrected text is copied below. +I think we may have have been confused by the reference to 22.2.2.2.2 and +the subsequent description of `n' which actually talks about the second +argument to sputn(), not about the number of fill characters to pad with. +

+ +

+So the question is: was the original text correct? If the intent was to +follow classic iostreams then it most likely wasn't, since setting width() +to less than the length of the string doesn't truncate it on output. This +is also the behavior of most implementations (except for SGI's standard +iostreams where the operator does truncate). +

+

Proposed resolution:

+

Change the text in 21.3.7.9, p4 from

+
+ If bool(k) is true, inserts characters as if by calling + os.rdbuf()->sputn(str.data(), n), padding as described in stage 3 + of lib.facet.num.put.virtuals, where n is the larger of os.width() + and str.size(); +
+

to

+
+ If bool(k) is true, determines padding as described in + lib.facet.num.put.virtuals, and then inserts the resulting + sequence of characters seq as if by calling + os.rdbuf()->sputn(seq, n), where n is the larger of + os.width() and str.size(); +
+ +

[Kona: it appears that neither the original wording, DR25, nor the + proposed resolution, is quite what we want. We want to say that + the string will be output, padded to os.width() if necessary. We + don't want to duplicate the padding rules in clause 22, because + they're complicated, but we need to be careful because they weren't + quite written with quite this case in mind. We need to say what + the character sequence is, and then defer to clause 22. Post-Kona: + Benjamin provided wording.]

+ +
+

436. are cv-qualified facet types valid facets?

Section: 22.1.1.1.2 [lib.locale.facet]  Status: WP  Submitter: Martin Sebor  Date: 15 Oct 2003

Is "const std::ctype<char>" a valid template argument to has_facet, use_facet, and the locale template ctor? And if so, does it designate the same Facet as @@ -12005,6 +12466,82 @@ template parameter.

[Kona: changed the last sentence from a footnote to normative text.]

+
+

441. Is fpos::state const?

Section: 27.4.3 [lib.fpos]  Status: DR  Submitter: Vincent Leloup  Date: 17 Nov 2003

+

+In section 27.4.3.1 [lib.fpos.members] fpos<stateT>::state() is declared +non const, but in section 27.4.3 [lib.fpos] it is declared const. +

+

Proposed resolution:

+

+In section 27.4.3.1 [lib.fpos.members], change the declaration of +fpos<stateT>::state() to const. +

+
+

442. sentry::operator bool() inconsistent signature

Section: 27.6.2.3 [lib.ostream::sentry]  Status: DR  Submitter: Vincent Leloup  Date: 18 Nov 2003

+

+In section 27.6.2.3 [lib.ostream::sentry] paragraph 4, in description part +basic_ostream<charT, traits>::sentry::operator bool() is declared +as non const, but in section 27.6.2.3, in synopsis it is declared +const. +

+

Proposed resolution:

+

+In section 27.6.2.3 [lib.ostream::sentry] paragraph 4, change the declaration +of sentry::operator bool() to const. +

+
+

443. filebuf::close() inconsistent use of EOF

Section: 27.8.1.3 [lib.filebuf.members]  Status: DR  Submitter: Vincent Leloup  Date: 20 Nov 2003

+

+In section 27.8.1.3 [lib.filebuf.members] par6, in effects description of +basic_filebuf<charT, traits>::close(), overflow(EOF) is used twice; +should be overflow(traits::eof()). +

+

Proposed resolution:

+

+Change overflow(EOF) to overflow(traits::eof()). +

+
+

448. Random Access Iterators over abstract classes

Section: 24.1.5 [lib.random.access.iterators]  Status: DR  Submitter: Dave Abrahams  Date: 7 Jan 2004

+

+Table 76, the random access iterator requirement table, says that the +return type of a[n] must be "convertible to T". When an iterator's +value_type T is an abstract class, nothing is convertible to T. +Surely this isn't an intended restriction? +

+

Proposed resolution:

+

+Change the return type to "convertible to T const&". +

+
+

449. Library Issue 306 Goes Too Far

Section: 18.1 [lib.support.types]  Status: DR  Submitter: Pete Becker  Date: 15 Jan 2004

+

Original text:

+
+The macro offsetof accepts a restricted set of type arguments in this +International Standard. type shall be a POD structure or a POD union +(clause 9). The result of applying the offsetof macro to a field that +is a static data member or a function member is undefined." +
+ +

Revised text:

+
+"If type is not a POD structure or a POD union the results are undefined." +
+ +

+Looks to me like the revised text should have replaced only the second +sentence. It doesn't make sense standing alone. +

+ +

Proposed resolution:

+

Change 18.1, paragraph 5, to:

+ +
+The macro offsetof accepts a restricted set of type arguments in this +International Standard. If type is not a POD structure or a POD union +the results are undefined. The result of applying the offsetof macro +to a field that is a static data member or a function member is +undefined." +

----- End of document -----

- - + \ No newline at end of file -- 2.30.2