<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML><HEAD><TITLE>C++ Standard Library Defect Report List</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<TABLE>
  <TBODY>
  <TR>
    <TD align=left>Doc. no.</TD>
    <TD align=left>N1685=04-0125</TD></TR>
  <TR>
    <TD align=left>Date:</TD>
    <TD align=left>10 Sep 2004</TD></TR>
  <TR>
    <TD align=left>Project:</TD>
    <TD align=left>Programming Language C++</TD></TR>
  <TR>
    <TD align=left>Reply to:</TD>
    <TD align=left>Matt Austern &lt;austern@apple.com&gt;</TD></TR></TBODY></TABLE>
<H1>C++ Standard Library Defect Report List (Revision 32)</H1>
<P>Reference ISO/IEC IS 14882:1998(E)</P>
<P>Also see:</P>
<UL>
  <LI><A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-toc.html">Table 
  of Contents</A> for all library issues. 
  <LI><A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-index.html">Index 
  by Section</A> for all library issues. 
  <LI><A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-status.html">Index 
  by Status</A> for all library issues. 
  <LI><A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html">Library 
  Active Issues List</A> 
  <LI><A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html">Library 
  Closed Issues List</A> </LI></UL>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#DR">DR</A>, 
<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>, 
or <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#RR">RR</A>. 
See the <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html">Library 
Closed Issues List</A> for issues closed as non-defects. See the <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html">Library 
Active Issues List</A> for active issues and more information. The introductory 
material in that document also applies to this document.</P>
<H2>Revision History</H2>
<UL>
  <LI>R32: 2004-09 pre-Redmond mailing: reflects new proposed resolutions and 
  new issues received after the 2004-07 mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#479">479</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#481">481</A>. 

  <LI>R31: 2004-07 mid-term mailing: reflects new proposed resolutions and new 
  issues received after the post-Sydney mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#463">463</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#478">478</A>. 

  <LI>R30: Post-Sydney mailing: reflects decisions made at the Sydney meeting. 
  Voted all "Ready" issues from R29 into the working paper. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#460">460</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#462">462</A>. 

  <LI>R29: Pre-Sydney mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#441">441</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#457">457</A>. 

  <LI>R28: Post-Kona mailing: reflects decisions made at the Kona meeting. Added 
  new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#432">432</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#440">440</A>. 

  <LI>R27: Pre-Kona mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#404">404</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#431">431</A>. 

  <LI>R26: Post-Oxford mailing: reflects decisions made at the Oxford meeting. 
  All issues in Ready status were voted into DR status. All issues in DR status 
  were voted into WP status. 
  <LI>R25: Pre-Oxford mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#390">390</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#402">402</A>. 

  <LI>R24: Post-Santa Cruz mailing: reflects decisions made at the Santa Cruz 
  meeting. All Ready issues from R23 with the exception of <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#253">253</A>, 
  which has been given a new proposed resolution, were moved to DR status. Added 
  new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#383">383</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#389">389</A>. 
  (Issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#387">387</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#389">389</A> 
  were discussed at the meeting.) Made progress on issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#225">225</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#226">226</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#229">229</A>: 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#225">225</A> 
  and <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#229">229</A> 
  have been moved to Ready status, and the only remaining concerns with <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#226">226</A> 
  involve wording. 
  <LI>R23: Pre-Santa Cruz mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#367">367</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#382">382</A>. 
  Moved issues in the TC to TC status. 
  <LI>R22: Post-Curaao mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#362">362</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#366">366</A>. 

  <LI>R21: Pre-Curaao mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#351">351</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#361">361</A>. 

  <LI>R20: Post-Redmond mailing; reflects actions taken in Redmond. Added new 
  issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#336">336</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#350">350</A>, 
  of which issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#347">347</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#350">350</A> 
  were added since Redmond, hence not discussed at the meeting. All Ready issues 
  were moved to DR status, with the exception of issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#284">284</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#241">241</A>, 
  and <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#267">267</A>. 
  Noteworthy issues discussed at Redmond include <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#120">120</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#202">202</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#226">226</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#233">233</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#270">270</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#253">253</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#254">254</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#323">323</A>. 

  <LI>R19: Pre-Redmond mailing. Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#323">323</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#335">335</A>. 

  <LI>R18: Post-Copenhagen mailing; reflects actions taken in Copenhagen. Added 
  new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#312">312</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#317">317</A>, 
  and discussed new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#271">271</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#314">314</A>. 
  Changed status of issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#103">103</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#118">118</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#136">136</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#153">153</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#165">165</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#171">171</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#183">183</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#184">184</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#185">185</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#186">186</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#214">214</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#221">221</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#234">234</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#237">237</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#243">243</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#248">248</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#251">251</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#252">252</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#256">256</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#260">260</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#261">261</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#262">262</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#263">263</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#265">265</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#268">268</A> 
  to DR. Changed status of issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#49">49</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#109">109</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#117">117</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#182">182</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#228">228</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#230">230</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#232">232</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#235">235</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#238">238</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#241">241</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#242">242</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#250">250</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#259">259</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#264">264</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#266">266</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#267">267</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#271">271</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#272">272</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#273">273</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#275">275</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#281">281</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#284">284</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#285">285</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#286">286</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#288">288</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#292">292</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#295">295</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#297">297</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#298">298</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#301">301</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#303">303</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#306">306</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#307">307</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#308">308</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#312">312</A> 
  to Ready. Closed issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#111">111</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#277">277</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#279">279</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#287">287</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#289">289</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#293">293</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#302">302</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#313">313</A> 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#314">314</A> 
  as NAD. 
  <LI>R17: Pre-Copenhagen mailing. Converted issues list to XML. Added proposed 
  resolutions for issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#49">49</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#76">76</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#91">91</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#235">235</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#250">250</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#267">267</A>. 
  Added new issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#278">278</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#311">311</A>. 

  <LI>R16: post-Toronto mailing; reflects actions taken in Toronto. Added new 
  issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#265">265</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#277">277</A>. 
  Changed status of issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#3">3</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#8">8</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#9">9</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#19">19</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#26">26</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#31">31</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#61">61</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#63">63</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#86">86</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#108">108</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#112">112</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#114">114</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#115">115</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#122">122</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#127">127</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#129">129</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#134">134</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#137">137</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#142">142</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#144">144</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#146">146</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#147">147</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#159">159</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#164">164</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#170">170</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#181">181</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#199">199</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#208">208</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#209">209</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#210">210</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#211">211</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#212">212</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#217">217</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#220">220</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#222">222</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#223">223</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#224">224</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#227">227</A> 
  to "DR". Reopened issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#23">23</A>. 
  Reopened issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#187">187</A>. 
  Changed issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#2">2</A> 
  and <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#4">4</A> 
  to NAD. Fixed a typo in issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#17">17</A>. 
  Fixed issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#70">70</A>: 
  signature should be changed both places it appears. Fixed issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#160">160</A>: 
  previous version didn't fix the bug in enough places. 
  <LI>R15: pre-Toronto mailing. Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#233">233</A>-<A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#264">264</A>. 
  Some small HTML formatting changes so that we pass Weblint tests. 
  <LI>R14: post-Tokyo II mailing; reflects committee actions taken in Tokyo. 
  Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#228">228</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#232">232</A>. 
  (00-0019R1/N1242) 
  <LI>R13: pre-Tokyo II updated: Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#212">212</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#227">227</A>. 

  <LI>R12: pre-Tokyo II mailing: Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#199">199</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#211">211</A>. 
  Added "and paragraph 5" to the proposed resolution of issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#29">29</A>. 
  Add further rationale to issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#178">178</A>. 

  <LI>R11: post-Kona mailing: Updated to reflect LWG and full committee actions 
  in Kona (99-0048/N1224). Note changed resolution of issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#4">4</A> 
  and <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#38">38</A>. 
  Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#196">196</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#198">198</A>. 
  Closed issues list split into "defects" and "closed" documents. Changed the 
  proposed resolution of issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#4">4</A> 
  to NAD, and changed the wording of proposed resolution of issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#38">38</A>. 

  <LI>R10: pre-Kona updated. Added proposed resolutions <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#83">83</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#86">86</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#91">91</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#92">92</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#109">109</A>. 
  Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#190">190</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#195">195</A>. 
  (99-0033/D1209, 14 Oct 99) 
  <LI>R9: pre-Kona mailing. Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#140">140</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#189">189</A>. 
  Issues list split into separate "active" and "closed" documents. 
  (99-0030/N1206, 25 Aug 99) 
  <LI>R8: post-Dublin mailing. Updated to reflect LWG and full committee actions 
  in Dublin. (99-0016/N1193, 21 Apr 99) 
  <LI>R7: pre-Dublin updated: Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#130">130</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#131">131</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#132">132</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#133">133</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#134">134</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#135">135</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#136">136</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#137">137</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#138">138</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#139">139</A> 
  (31 Mar 99) 
  <LI>R6: pre-Dublin mailing. Added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#127">127</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#128">128</A>, 
  and <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#129">129</A>. 
  (99-0007/N1194, 22 Feb 99) 
  <LI>R5: update issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#103">103</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#112">112</A>; 
  added issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#114">114</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#126">126</A>. 
  Format revisions to prepare for making list public. (30 Dec 98) 
  <LI>R4: post-Santa Cruz II updated: Issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#110">110</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#111">111</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#112">112</A>, 
  <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#113">113</A> 
  added, several issues corrected. (22 Oct 98) 
  <LI>R3: post-Santa Cruz II: Issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#94">94</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#109">109</A> 
  added, many issues updated to reflect LWG consensus (12 Oct 98) 
  <LI>R2: pre-Santa Cruz II: Issues <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#73">73</A> 
  to <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#93">93</A> 
  added, issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#17">17</A> 
  updated. (29 Sep 98) 
  <LI>R1: Correction to issue <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#55">55</A> 
  resolution, <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#60">60</A> 
  code format, <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#64">64</A> 
  title. (17 Sep 98) </LI></UL>
<H2>Defect Reports</H2>
<HR>
<A name=1>
<H3>1.&nbsp;C library linkage editing oversight</H3></A>
<P><B>Section:</B>&nbsp;17.4.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.using.linkage">[lib.using.linkage]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Beman Dawes&nbsp; <B>Date:</B>&nbsp;16 Nov 1997</P>
<P>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.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 17.4.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.using.linkage">[lib.using.linkage]</A> 
paragraph 2 from:</P>
<BLOCKQUOTE>
  <P>It is unspecified whether a name from the Standard C library declared with 
  external linkage has either extern "C" or extern "C++" linkage.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Whether a name from the Standard C library declared with external linkage 
  has extern "C" or extern "C++" linkage is implementation defined. It is 
  recommended that an implementation use extern "C++" linkage for this 
  purpose.</P></BLOCKQUOTE>
<HR>
<A name=3>
<H3>3.&nbsp;Atexit registration during atexit() call is not described</H3></A>
<P><B>Section:</B>&nbsp;18.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.support.start.term">[lib.support.start.term]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;12 Dec 1997</P>
<P>We appear not to have covered all the possibilities of exit processing with 
respect to atexit registration. <BR><BR>Example 1: (C and C++)</P><PRE>    #include &lt;stdlib.h&gt;
    void f1() { }
    void f2() { atexit(f1); }
    
    int main()
    {
        atexit(f2); // the only use of f2
        return 0; // for C compatibility
    }</PRE>
<P>At program exit, f2 gets called due to its registration in main. Running f2 
causes f1 to be newly registered during the exit processing. Is this a valid 
program? If so, what are its semantics?</P>
<P>Interestingly, neither the C standard, nor the C++ draft standard nor the 
forthcoming C9X Committee Draft says directly whether you can register a 
function with atexit during exit processing.</P>
<P>All 3 standards say that functions are run in reverse order of their 
registration. Since f1 is registered last, it ought to be run first, but by the 
time it is registered, it is too late to be first.</P>
<P>If the program is valid, the standards are self-contradictory about its 
semantics.</P>
<P>Example 2: (C++ only)</P><PRE>    
    void F() { static T t; } // type T has a destructor

    int main()
    {
        atexit(F); // the only use of F
    }
</PRE>
<P>Function F registered with atexit has a local static variable t, and F is 
called for the first time during exit processing. A local static object is 
initialized the first time control flow passes through its definition, and all 
static objects are destroyed during exit processing. Is the code valid? If so, 
what are its semantics?</P>
<P>Section 18.3 "Start and termination" says that if a function F is registered 
with atexit before a static object t is initialized, F will not be called until 
after t's destructor completes.</P>
<P>In example 2, function F is registered with atexit before its local static 
object O could possibly be initialized. On that basis, it must not be called by 
exit processing until after O's destructor completes. But the destructor cannot 
be run until after F is called, since otherwise the object could not be 
constructed in the first place.</P>
<P>If the program is valid, the standard is self-contradictory about its 
semantics.</P>
<P>I plan to submit Example 1 as a public comment on the C9X CD, with a 
recommendation that the results be undefined. (Alternative: make it unspecified. 
I don't think it is worthwhile to specify the case where f1 itself registers 
additional functions, each of which registers still more functions.)</P>
<P>I think we should resolve the situation in the whatever way the C committee 
decides. </P>
<P>For Example 2, I recommend we declare the results undefined.</P>
<P><I>[See reflector message lib-6500 for further discussion.]</I></P>
<P><B>Proposed resolution:</B></P>
<P>Change section 18.3/8 from:</P>
<BLOCKQUOTE>First, objects with static storage duration are destroyed and 
  functions registered by calling atexit are called. Objects with static storage 
  duration are destroyed in the reverse order of the completion of their 
  constructor. (Automatic objects are not destroyed as a result of calling 
  exit().) Functions registered with atexit are called in the reverse order of 
  their registration. A function registered with atexit before an object obj1 of 
  static storage duration is initialized will not be called until obj1's 
  destruction has completed. A function registered with atexit after an object 
  obj2 of static storage duration is initialized will be called before obj2's 
  destruction starts. </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>First, objects with static storage duration are destroyed and 
  functions registered by calling atexit are called. Non-local objects with 
  static storage duration are destroyed in the reverse order of the completion 
  of their constructor. (Automatic objects are not destroyed as a result of 
  calling exit().) Functions registered with atexit are called in the reverse 
  order of their registration, except that a function is called after any 
  previously registered functions that had already been called at the time it 
  was registered. A function registered with atexit before a non-local object 
  obj1 of static storage duration is initialized will not be called until obj1's 
  destruction has completed. A function registered with atexit after a non-local 
  object obj2 of static storage duration is initialized will be called before 
  obj2's destruction starts. A local static object obj3 is destroyed at the same 
  time it would be if a function calling the obj3 destructor were registered 
  with atexit at the completion of the obj3 constructor. </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>See 99-0039/N1215, October 22, 1999, by Stephen D. Clamage for the analysis 
supporting to the proposed resolution.</P>
<HR>
<A name=5>
<H3>5.&nbsp;String::compare specification questionable</H3></A>
<P><B>Section:</B>&nbsp;21.3.6.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::compare">[lib.string::compare]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Jack Reeves&nbsp; <B>Date:</B>&nbsp;11 Dec 1997</P>
<P>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 
basic_string&lt;charT,traits,Allocator&gt;(*this,pos1,n1).compare( 
basic_string&lt;charT,traits,Allocator&gt;(s,n2); </P>
<P>Since the constructor basic_string(const charT* s, size_type n, const 
Allocator&amp; a = Allocator()) clearly requires that s != NULL and n &lt; npos 
and further states that it throws length_error if n == npos, it appears the 
compare() signature above should always throw length error if invoked like so: 
str.compare(1, str.size()-1, s); where 's' is some null terminated character 
array. </P>
<P>This appears to be a typo since the obvious intent is to allow either the 
call above or something like: str.compare(1, str.size()-1, s, strlen(s)-1); </P>
<P>This would imply that what was really intended was two signatures int 
compare(size_type 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. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace the compare signature in 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A> 
(at the very end of the basic_string synopsis) which reads:</P>
<BLOCKQUOTE>
  <P><TT>int compare(size_type pos1, size_type 
  n1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  const charT* s, size_type n2 = npos) const;</TT></P></BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE>
  <P><TT>int compare(size_type pos1, size_type 
  n1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  const charT* s) const;<BR>int compare(size_type pos1, size_type 
  n1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  const charT* s, size_type n2) const;</TT></P></BLOCKQUOTE>
<P>Replace the portion of 21.3.6.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::compare">[lib.string::compare]</A> 
paragraphs 5 and 6 which read:</P>
<BLOCKQUOTE>
  <P><TT>int compare(size_type pos, size_type 
  n1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  charT * s, size_type n2 = npos) 
  const;<BR></TT>Returns:<TT><BR>basic_string&lt;charT,traits,Allocator&gt;(*this, 
  pos, 
  n1).compare(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  basic_string&lt;charT,traits,Allocator&gt;( s, n2))</TT></P></BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE>
  <P><TT>int compare(size_type pos, size_type 
  n1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  const charT * s) 
  const;<BR></TT>Returns:<TT><BR>basic_string&lt;charT,traits,Allocator&gt;(*this, 
  pos, 
  n1).compare(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  basic_string&lt;charT,traits,Allocator&gt;( s ))<BR><BR>int compare(size_type 
  pos, size_type 
  n1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  const charT * s, size_type n2) 
  const;<BR></TT>Returns:<TT><BR>basic_string&lt;charT,traits,Allocator&gt;(*this, 
  pos, 
  n1).compare(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  basic_string&lt;charT,traits,Allocator&gt;( s, n2))</TT></P></BLOCKQUOTE>
<P>Editors please note that in addition to splitting the signature, the third 
argument becomes const, matching the existing synopsis.</P>
<P><B>Rationale:</B></P>
<P>While the LWG dislikes adding signatures, this is a clear defect in the 
Standard which must be fixed.&nbsp; The same problem was also identified in 
issues 7 (item 5) and 87.</P>
<HR>
<A name=7>
<H3>7.&nbsp;String clause minor problems</H3></A>
<P><B>Section:</B>&nbsp;21 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.strings">[lib.strings]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;15 Dec 1997</P>
<P>(1) In 21.3.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::insert">[lib.string::insert]</A>, 
the description of template &lt;class InputIterator&gt; 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 function. 
</P>
<P>(2) Several versions of basic_string::replace don't appear in the class 
synopsis. </P>
<P>(3) basic_string::push_back appears in the synopsis, but is never described 
elsewhere. In the synopsis its argument is const charT, which doesn't makes much 
sense; it should probably be charT, or possible const charT&amp;. </P>
<P>(4) basic_string::pop_back is missing. </P>
<P>(5) int compare(size_type pos, size_type n1, charT* s, size_type n2 = npos) 
make no sense. First, it's const charT* in the synopsis and 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::compare">[lib.string::compare]</A></P>
<P>(6) In table 37, in section 21.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.char.traits.require">[lib.char.traits.require]</A>, 
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 is correct even where s in in [p, p+n). 
These are two orthogonal guarantees, and neither one follows from the other. 
Both guarantees are necessary if X::move is supposed to have the same sort of 
semantics as memmove (which was clearly the intent), and both guarantees are 
necessary if X::move is actually supposed to be useful. </P>
<P><B>Proposed resolution:</B></P>
<P>ITEM 1: In 21.3.5.4 [lib.string::insert], change paragraph 16 to 
<BR><BR>&nbsp;&nbsp;&nbsp; EFFECTS: Equivalent to insert(p - begin(), 
basic_string(first, last)).<BR><BR>ITEM 2:&nbsp; Not a defect; the Standard is 
clear.. There are ten versions of replace() in the synopsis, and ten versions in 
21.3.5.6 [lib.string::replace].<BR><BR>ITEM 3: Change the declaration of 
push_back in the string synopsis (21.3, [lib.basic.string]) from:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; void push_back(const 
charT)<BR><BR>to<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; void 
push_back(charT)<BR><BR>Add the following text immediately after 21.3.5.2 
[lib.string::append], paragraph 10.<BR><BR>&nbsp;&nbsp;&nbsp; void 
basic_string::push_back(charT c);<BR>&nbsp;&nbsp;&nbsp; EFFECTS: Equivalent to 
append(static_cast&lt;size_type&gt;(1), c);<BR><BR>ITEM 4: Not a defect. The 
omission appears to have been deliberate.<BR><BR>ITEM 5: Duplicate; see issue 5 
(and 87).<BR><BR>ITEM 6: In table 37, Replace:<BR><BR>&nbsp;&nbsp;&nbsp; "Copies 
correctly even where p is in [s, 
s+n)."<BR><BR>with:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; "Copies correctly even where 
the ranges [p, p+n) and [s, s+n) overlap."</P>
<HR>
<A name=8>
<H3>8.&nbsp;Locale::global lacks guarantee</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.statics">[lib.locale.statics]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;24 Dec 1997</P>
<P>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 setlocale(s) sets the global C++ locale. 
</P>
<P>The intent, I think, is that it should not, but I can't find any such words 
anywhere. </P>
<P><B>Proposed resolution:</B></P>
<P>Add a sentence at the end of 22.1.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.statics">[lib.locale.statics]</A>, 
paragraph 2:&nbsp; </P>
<BLOCKQUOTE>
  <P>No library function other than <TT>locale::global()</TT> shall affect the 
  value returned by <TT>locale()</TT>. </P></BLOCKQUOTE>
<HR>
<A name=9>
<H3>9.&nbsp;Operator new(0) calls should not yield the same pointer</H3></A>
<P><B>Section:</B>&nbsp;18.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete">[lib.new.delete]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;4 Jan 1998</P>
<P>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 technique specifically prohibited by 
ARM 5.3.3.Was this prohibition really lifted? Does the FDIS agree with CD2 in 
the regard? [Issues list maintainer's note: the IS is the same.]</P>
<P><B>Proposed resolution:</B></P>
<P>Change the last paragraph of 3.7.3 from:</P>
<BLOCKQUOTE>
  <P>Any allocation and/or deallocation functions defined in a C++ program shall 
  conform to the semantics specified in 3.7.3.1 and 3.7.3.2.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Any allocation and/or deallocation functions defined in a C++ program, 
  including the default versions in the library, shall conform to the semantics 
  specified in 3.7.3.1 and 3.7.3.2.</P></BLOCKQUOTE>
<P>Change 3.7.3.1/2, next-to-last sentence, from :</P>
<BLOCKQUOTE>
  <P>If the size of the space requested is zero, the value returned shall not be 
  a null pointer value (4.10).</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Even if the size of the space requested is zero, the request can fail. If 
  the request succeeds, the value returned shall be a non-null pointer value 
  (4.10) p0 different from any previously returned value p1, unless that value 
  p1 was since passed to an operator delete.</P></BLOCKQUOTE>
<P>5.3.4/7 currently reads:</P>
<BLOCKQUOTE>
  <P>When the value of the expression in a direct-new-declarator is zero, the 
  allocation function is called to allocate an array with no elements. The 
  pointer returned by the new-expression is non-null. [Note: If the library 
  allocation function is called, the pointer returned is distinct from the 
  pointer to any other object.]</P></BLOCKQUOTE>
<P>Retain the first sentence, and delete the remainder.</P>
<P>18.4.1 currently has no text. Add the following:</P>
<BLOCKQUOTE>
  <P>Except where otherwise specified, the provisions of 3.7.3 apply to the 
  library versions of operator new and operator delete.</P></BLOCKQUOTE>
<P>To 18.4.1.3, add the following text:</P>
<BLOCKQUOTE>
  <P>The provisions of 3.7.3 do not apply to these reserved placement forms of 
  operator new and operator delete.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>See 99-0040/N1216, October 22, 1999, by Stephen D. Clamage for the analysis 
supporting to the proposed resolution.</P>
<HR>
<A name=11>
<H3>11.&nbsp;Bitset minor problems</H3></A>
<P><B>Section:</B>&nbsp;23.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.template.bitset">[lib.template.bitset]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;22 Jan 1998</P>
<P>(1) bitset&lt;&gt;::operator[] is mentioned in the class synopsis (23.3.5), 
but it is not documented in 23.3.5.2. </P>
<P>(2) The class synopsis only gives a single signature for 
bitset&lt;&gt;::operator[], reference operator[](size_t pos). This doesn't make 
much sense. It ought to be overloaded on const. reference operator[](size_t 
pos); bool operator[](size_t pos) const. </P>
<P>(3) Bitset's stream input function (23.3.5.3) ought to skip all whitespace 
before trying to extract 0s and 1s. The standard doesn't explicitly say that, 
though. This should go in the Effects clause.</P>
<P><B>Proposed resolution:</B></P>
<P>ITEMS 1 AND 2:<BR><BR>In the bitset synopsis (23.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.template.bitset">[lib.template.bitset]</A>), 
replace the member function <BR><BR><TT>&nbsp;&nbsp;&nbsp; reference 
operator[](size_t pos);<BR></TT><BR>with the two member 
functions<BR><BR><TT>&nbsp;&nbsp;&nbsp; bool operator[](size_t pos) const; 
<BR>&nbsp;&nbsp;&nbsp; reference operator[](size_t pos); <BR></TT><BR>Add the 
following text at the end of 23.3.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.bitset.members">[lib.bitset.members]</A>, 
immediately after paragraph 45:</P>
<BLOCKQUOTE>
  <P><TT>bool operator[](size_t pos) const;</TT><BR>Requires: pos is 
  valid<BR>Throws: nothing<BR>Returns: 
  <TT>test(pos)</TT><BR><BR><TT>bitset&lt;N&gt;::reference operator[](size_t 
  pos);</TT> <BR>Requires: pos is valid<BR>Throws: nothing<BR>Returns: An object 
  of type <TT>bitset&lt;N&gt;::reference</TT> such that <TT>(*this)[pos] == 
  this-&gt;test(pos)</TT>, and such that <TT>(*this)[pos] = val</TT> is 
  equivalent to <TT>this-&gt;set(pos, val);</TT></P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG believes Item 3 is not a defect. "Formatted input" implies the 
desired semantics. See 27.6.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted">[lib.istream.formatted]</A>. 
</P>
<HR>
<A name=13>
<H3>13.&nbsp;Eos refuses to die</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;William M. Miller&nbsp; <B>Date:</B>&nbsp;3 Mar 1998</P>
<P>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. </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A>, 
replace "eos" with "charT()"</P>
<HR>
<A name=14>
<H3>14.&nbsp;Locale::combine should be const</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.members">[lib.locale.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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 paragraph 6: "An instance of a locale is 
immutable." </P>
<P>History: this member function originally was a constructor. it happened that 
the interface it specified had no corresponding language syntax, so it was 
changed to a member 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. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A> 
and also in 22.1.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.members">[lib.locale.members]</A>, 
add "const" to the declaration of member combine: </P>
<BLOCKQUOTE><PRE>template &lt;class Facet&gt; locale combine(const locale&amp; other) const; </PRE></BLOCKQUOTE>
<HR>
<A name=15>
<H3>15.&nbsp;Locale::name requirement inconsistent</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.members">[lib.locale.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>locale::name() is described as returning a string that can be passed to a 
locale constructor, but there is no matching constructor. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.members">[lib.locale.members]</A>, 
paragraph 5, replace "<TT>locale(name())</TT>" with 
"<TT>locale(name().c_str())</TT>". </P>
<HR>
<A name=16>
<H3>16.&nbsp;Bad ctype_byname&lt;char&gt; decl</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname.special">[lib.locale.ctype.byname.special]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The new virtual members ctype_byname&lt;char&gt;::do_widen and do_narrow did 
not get edited in properly. Instead, the member do_widen appears four times, 
with wrong argument lists. </P>
<P><B>Proposed resolution:</B></P>
<P>The correct declarations for the overloaded members <TT>do_narrow</TT> and 
<TT>do_widen</TT> should be copied from 22.2.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.ctype.special">[lib.facet.ctype.special]</A>.</P>
<HR>
<A name=17>
<H3>17.&nbsp;Bad bool parsing</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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 
only one of those sequences, and chooses which according to the received value 
of a reference argument intended for returning the result, and reports an error 
if the other sequence is found. (!) Furthermore, it claims to get the names from 
the ctype&lt;&gt; facet rather than the numpunct&lt;&gt; facet, and it examines 
the "boolalpha" flag wrongly; it doesn't define the value "loc"; and finally, it 
computes wrongly whether to use numeric or "alpha" parsing.<BR><BR>I believe the 
correct algorithm is "as if": </P><PRE>  // in, err, val, and str are arguments.
  err = 0;
  const numpunct&lt;charT&gt;&amp; np = use_facet&lt;numpunct&lt;charT&gt; &gt;(str.getloc());
  const string_type t = np.truename(), f = np.falsename();
  bool tm = true, fm = true;
  size_t pos = 0;
  while (tm &amp;&amp; pos &lt; t.size() || fm &amp;&amp; pos &lt; f.size()) {
    if (in == end) { err = str.eofbit; }
    bool matched = false;
    if (tm &amp;&amp; pos &lt; t.size()) {
      if (!err &amp;&amp; t[pos] == *in) matched = true;
      else tm = false;
    }
    if (fm &amp;&amp; pos &lt; f.size()) {
      if (!err &amp;&amp; f[pos] == *in) matched = true;
      else fm = false;
    }
    if (matched) { ++in; ++pos; }
    if (pos &gt; t.size()) tm = false;
    if (pos &gt; f.size()) fm = false;
  }
  if (tm == fm || pos == 0) { err |= str.failbit; }
  else                      { val = tm; }
  return in;</PRE>
<P>Notice this works reasonably when the candidate strings are both empty, or 
equal, or when one is a substring of the other. The proposed text below captures 
the logic of the code above.</P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>, 
in the first line of paragraph 14, change "&amp;&amp;" to "&amp;".</P>
<P>Then, replace paragraphs 15 and 16 as follows:</P>
<BLOCKQUOTE>
  <P>Otherwise target sequences are determined "as if" by calling the members 
  <TT>falsename()</TT> and <TT>truename()</TT> of the facet obtained by 
  <TT>use_facet&lt;numpunct&lt;charT&gt;&nbsp;&gt;(str.getloc())</TT>. 
  Successive characters in the range <TT>[in,end)</TT> (see 
  [lib.sequence.reqmts]) are obtained and matched against corresponding 
  positions in the target sequences only as necessary to identify a unique 
  match. The input iterator <TT>in</TT> is compared to <TT>end</TT> only when 
  necessary to obtain a character. If and only if a target sequence is uniquely 
  matched, <TT>val</TT> is set to the corresponding value.</P></BLOCKQUOTE>
<BLOCKQUOTE>
  <P>The <TT>in</TT> iterator is always left pointing one position beyond the 
  last character successfully matched. If <TT>val</TT> is set, then err is set 
  to <TT>str.goodbit</TT>; or to <TT>str.eofbit</TT> if, when seeking another 
  character to match, it is found that <TT>(in==end)</TT>. If <TT>val</TT> is 
  not set, then <I>err</I> is set to <TT>str.failbit</TT>; or to 
  <TT>(str.failbit|str.eofbit)</TT>if the reason for the failure was that 
  <TT>(in==end)</TT>. [Example: for targets <TT>true</TT>:"a" and 
  <TT>false</TT>:"abb", the input sequence "a" yields <TT>val==true</TT> and 
  <TT>err==str.eofbit</TT>; the input sequence "abc" yields 
  <TT>err=str.failbit</TT>, with <TT>in</TT> ending at the 'c' element. For 
  targets <TT>true</TT>:"1" and <TT>false</TT>:"0", the input sequence "1" 
  yields <TT>val==true</TT> and <TT>err=str.goodbit</TT>. For empty targets 
  (""), any input sequence yields <TT>err==str.failbit</TT>. --end 
example]</P></BLOCKQUOTE>
<HR>
<A name=18>
<H3>18.&nbsp;Get(...bool&amp;) omitted</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.members">[lib.facet.num.get.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In the list of num_get&lt;&gt; 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. </P>
<P><B>Proposed resolution:</B></P>
<P>Add at the beginning of 22.2.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.members">[lib.facet.num.get.members]</A> 
another get member for bool&amp;, copied from the entry in 22.2.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.num.get">[lib.locale.num.get]</A>.</P>
<HR>
<A name=19>
<H3>19.&nbsp;"Noconv" definition too vague</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In the definitions of codecvt&lt;&gt;::do_out and do_in, they are specified 
to return noconv if "no conversion is needed". This definition is too vague, and 
does not say normatively what is done with the buffers. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the entry for noconv in the table under paragraph 4 in section 
22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A> 
to read: </P>
<BLOCKQUOTE>
  <P><TT>noconv</TT>: <TT>internT</TT> and <TT>externT</TT> are the same type, 
  and input sequence is identical to converted sequence.</P></BLOCKQUOTE>
<P>Change the Note in paragraph 2 to normative text as follows:</P>
<BLOCKQUOTE>
  <P>If returns <TT>noconv</TT>, <TT>internT</TT> and <TT>externT</TT> are the 
  same type and the converted sequence is identical to the input sequence 
  <TT>[from,from_next)</TT>. <TT>to_next</TT> is set equal to <TT>to</TT>, the 
  value of <TT>state</TT> is unchanged, and there are no changes to the values 
  in <TT>[to, to_limit)</TT>.</P></BLOCKQUOTE>
<HR>
<A name=20>
<H3>20.&nbsp;Thousands_sep returns wrong type</H3></A>
<P><B>Section:</B>&nbsp;22.2.3.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.numpunct.virtuals">[lib.facet.numpunct.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The synopsis for numpunct&lt;&gt;::do_thousands_sep, and the definition of 
numpunct&lt;&gt;::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". </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.3.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.numpunct.virtuals">[lib.facet.numpunct.virtuals]</A>, 
above paragraph 2, change "string_type" to "char_type". </P>
<HR>
<A name=21>
<H3>21.&nbsp;Codecvt_byname&lt;&gt; instantiations</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In the second table in the section, captioned "Required instantiations", the 
instantiations for codecvt_byname&lt;&gt; have been omitted. These are necessary 
to allow users to construct a locale by name from facets. </P>
<P><B>Proposed resolution:</B></P>
<P>Add in 22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A> 
to the table captioned "Required instantiations", in the category "ctype" the 
lines </P>
<BLOCKQUOTE><PRE>codecvt_byname&lt;char,char,mbstate_t&gt;,
codecvt_byname&lt;wchar_t,char,mbstate_t&gt; </PRE></BLOCKQUOTE>
<HR>
<A name=22>
<H3>22.&nbsp;Member open vs. flags</H3></A>
<P><B>Section:</B>&nbsp;27.8.1.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ifstream.members">[lib.ifstream.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The description of basic_istream&lt;&gt;::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 not expect eofbit and failbit to remain set after a 
successful open. There are three reasonable resolutions: 1) status quo 2) fail 
if fail(), ignore eofbit 3) clear failbit and eofbit on call to open(). </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.8.1.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ifstream.members">[lib.ifstream.members]</A> 
paragraph 3, <I>and</I> in 27.8.1.10 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ofstream.members">[lib.ofstream.members]</A> 
paragraph 3, under open() effects, add a footnote: </P>
<BLOCKQUOTE>
  <P>A successful open does not change the error state.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>This may seem surprising to some users, but it's just an instance of a 
general rule: error flags are never cleared by the implementation. The only way 
error flags are are ever cleared is if the user explicitly clears them by 
hand.</P>
<P>The LWG believed that preserving this general rule was important enough so 
that an exception shouldn't be made just for this one case. The resolution of 
this issue clarifies what the LWG believes to have been the original intent.</P>
<HR>
<A name=24>
<H3>24.&nbsp;"do_convert" doesn't exist</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The description of codecvt&lt;&gt;::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". </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt">[lib.locale.codecvt]</A>, 
paragraph 3, change "do_convert" to "do_in or do_out". Also, in 22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>, 
change "do_convert()" to "do_in or do_out". </P>
<HR>
<A name=25>
<H3>25.&nbsp;String operator&lt;&lt; uses width() value wrong</H3></A>
<P><B>Section:</B>&nbsp;21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In the description of operator&lt;&lt; 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. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A> 
paragraph 4 from:<BR><BR>&nbsp;&nbsp;&nbsp; "... where <TT>n</TT> is the smaller 
of <TT>os.width()</TT> and <TT>str.size()</TT>; ..."<BR><BR>to: 
<BR><BR>&nbsp;&nbsp;&nbsp; "... where <TT>n</TT> is the larger of 
<TT>os.width()</TT> and <TT>str.size()</TT>; ..."</P>
<HR>
<A name=26>
<H3>26.&nbsp;Bad sentry example</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::sentry">[lib.istream::sentry]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In paragraph 6, the code in the example: </P><PRE>  template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
  basic_istream&lt;charT,traits&gt;::sentry(
           basic_istream&lt;charT,traits&gt;&amp; is, bool noskipws = false) {
      ...
      int_type c;
      typedef ctype&lt;charT&gt; ctype_type;
      const ctype_type&amp; ctype = use_facet&lt;ctype_type&gt;(is.getloc());
      while ((c = is.rdbuf()-&gt;snextc()) != traits::eof()) {
        if (ctype.is(ctype.space,c)==0) {
          is.rdbuf()-&gt;sputbackc (c);
          break;
        }
      }
      ...
   }</PRE>
<P>fails to demonstrate correct use of the facilities described. In 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.) </P>
<P><B>Proposed resolution:</B></P>
<P>Remove the example above from 27.6.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::sentry">[lib.istream::sentry]</A> 
paragraph 6.</P>
<P><B>Rationale:</B></P>
<P>The originally proposed replacement code for the example was not correct. The 
LWG tried in Kona and again in Tokyo to correct it without success. In Tokyo, an 
implementor reported that actual working 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.</P>
<HR>
<A name=27>
<H3>27.&nbsp;String::erase(range) yields wrong iterator</H3></A>
<P><B>Section:</B>&nbsp;21.3.5.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::erase">[lib.string::erase]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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. </P>
<P><B>Proposed resolution:</B></P>
<P>In 21.3.5.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::erase">[lib.string::erase]</A>, 
paragraph 10, change: </P>
<BLOCKQUOTE>
  <P>Returns: an iterator which points to the element immediately following 
  _last_ prior to the element being erased. </P></BLOCKQUOTE>
<P>to read </P>
<BLOCKQUOTE>
  <P>Returns: an iterator which points to the element pointed to by _last_ prior 
  to the other elements being erased. </P></BLOCKQUOTE>
<HR>
<A name=28>
<H3>28.&nbsp;Ctype&lt;char&gt;is ambiguous</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.ctype.char.members">[lib.facet.ctype.char.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The description of the vector form of ctype&lt;char&gt;::is can be 
interpreted to mean something very different from what was intended. Paragraph 4 
says </P>
<BLOCKQUOTE>
  <P>Effects: The second form, for all *p in the range [low, high), assigns 
  vec[p-low] to table()[(unsigned char)*p]. </P></BLOCKQUOTE>
<P>This is intended to copy the value indexed from table()[] into the place 
identified in vec[]. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 22.2.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.ctype.char.members">[lib.facet.ctype.char.members]</A>, 
paragraph 4, to read </P>
<BLOCKQUOTE>
  <P>Effects: The second form, for all *p in the range [low, high), assigns into 
  vec[p-low] the value table()[(unsigned char)*p]. </P></BLOCKQUOTE>
<HR>
<A name=29>
<H3>29.&nbsp;Ios_base::init doesn't exist</H3></A>
<P><B>Section:</B>&nbsp;27.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.narrow.stream.objects">[lib.narrow.stream.objects]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>Sections 27.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.narrow.stream.objects">[lib.narrow.stream.objects]</A> 
and 27.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.wide.stream.objects">[lib.wide.stream.objects]</A> 
mention a function ios_base::init, which is not defined. Probably they mean 
basic_ios&lt;&gt;::init, defined in 27.4.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.cons">[lib.basic.ios.cons]</A>, 
paragraph 3. </P>
<P><B>Proposed resolution:</B></P>
<P>[R12: modified to include paragraph 5.]</P>
<P>In 27.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.narrow.stream.objects">[lib.narrow.stream.objects]</A> 
paragraph 2 and 5, change </P>
<BLOCKQUOTE>
  <P>ios_base::init </P></BLOCKQUOTE>
<P>to </P>
<BLOCKQUOTE>
  <P>basic_ios&lt;char&gt;::init </P></BLOCKQUOTE>
<P>Also, make a similar change in 27.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.wide.stream.objects">[lib.wide.stream.objects]</A> 
except it should read </P>
<BLOCKQUOTE>
  <P>basic_ios&lt;wchar_t&gt;::init </P></BLOCKQUOTE>
<HR>
<A name=30>
<H3>30.&nbsp;Wrong header for LC_*</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>Paragraph 2 implies that the C macros LC_CTYPE etc. are defined in 
&lt;cctype&gt;, where they are in fact defined elsewhere to appear in 
&lt;clocale&gt;. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>, 
paragraph 2, change "&lt;cctype&gt;" to read "&lt;clocale&gt;". </P>
<HR>
<A name=31>
<H3>31.&nbsp;Immutable locale values</H3></A>
<P><B>Section:</B>&nbsp;22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>Paragraph 6, says "An instance of <TT>locale</TT> is <I>immutable</I>; once a 
facet reference is obtained from it, ...". This has caused some confusion, 
because locale variables are manifestly assignable. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A> 
replace paragraph 6</P>
<BLOCKQUOTE>
  <P>An instance of <TT>locale</TT> is immutable; once a facet reference is 
  obtained from it, that reference remains usable as long as the locale value 
  itself exists.</P></BLOCKQUOTE>
<P>with</P>
<BLOCKQUOTE>
  <P>Once a facet reference is obtained from a locale object by calling 
  use_facet&lt;&gt;, that reference remains usable, and the results from member 
  functions of it may be cached and re-used, as long as some locale object 
  refers to that facet.</P></BLOCKQUOTE>
<HR>
<A name=32>
<H3>32.&nbsp;Pbackfail description inconsistent</H3></A>
<P><B>Section:</B>&nbsp;27.5.2.4.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.pback">[lib.streambuf.virt.pback]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The description of the required state before calling virtual member 
basic_streambuf&lt;&gt;::pbackfail requirements is inconsistent with the 
conditions described in 27.5.2.2.4 [lib.streambuf.pub.pback] where member 
sputbackc calls it. Specifically, the latter says it calls pbackfail if: </P>
<P>&nbsp;&nbsp;&nbsp; traits::eq(c,gptr()[-1]) is false </P>
<P>where pbackfail claims to require: </P>
<P>&nbsp;&nbsp;&nbsp; traits::eq(*gptr(),traits::to_char_type(c)) returns false 
</P>
<P>It appears that the pbackfail description is wrong. </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.5.2.4.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.pback">[lib.streambuf.virt.pback]</A>, 
paragraph 1, change:</P>
<BLOCKQUOTE>
  <P>"<TT>traits::eq(*gptr(),traits::to_char_type( c))</TT>"</P></BLOCKQUOTE>
<P>to </P>
<BLOCKQUOTE>
  <P>"<TT>traits::eq(traits::to_char_type(c),gptr()[-1])</TT>" </P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Note deliberate reordering of arguments for clarity in addition to the 
correction of the argument value.</P>
<HR>
<A name=33>
<H3>33.&nbsp;Codecvt&lt;&gt; mentions from_type</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In the table defining the results from do_out and do_in, the specification 
for the result <I>error</I> says </P>
<BLOCKQUOTE>
  <P>encountered a from_type character it could not convert </P></BLOCKQUOTE>
<P>but from_type is not defined. This clearly is intended to be an externT for 
do_in, or an internT for do_out. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A> 
paragraph 4, replace the definition in the table for the case of _error_ with 
</P>
<BLOCKQUOTE>
  <P>encountered a character in <TT>[from,from_end)</TT> that it could not 
  convert. </P></BLOCKQUOTE>
<HR>
<A name=34>
<H3>34.&nbsp;True/falsename() not in ctype&lt;&gt;</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In paragraph 19, Effects:, members truename() and falsename are used from 
facet ctype&lt;charT&gt;, but it has no such members. Note that this is also a 
problem in 22.2.2.1.2, addressed in (4). </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>, 
paragraph 19, in the Effects: clause for member put(...., bool), replace the 
initialization of the string_type value s as follows: </P>
<BLOCKQUOTE><PRE>const numpunct&amp; np = use_facet&lt;numpunct&lt;charT&gt; &gt;(loc);
string_type s = val ? np.truename() : np.falsename(); </PRE></BLOCKQUOTE>
<HR>
<A name=35>
<H3>35.&nbsp;No manipulator unitbuf in synopsis</H3></A>
<P><B>Section:</B>&nbsp;27.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostreams.base">[lib.iostreams.base]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In 27.4.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fmtflags.manip">[lib.fmtflags.manip]</A>, 
we have a definition for a manipulator named "unitbuf". Unlike other 
manipulators, it's not listed in synopsis. Similarly for "nounitbuf". </P>
<P><B>Proposed resolution:</B></P>
<P>Add to the synopsis for &lt;ios&gt; in 27.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostreams.base">[lib.iostreams.base]</A>, 
after the entry for "nouppercase", the prototypes: </P>
<BLOCKQUOTE><PRE>ios_base&amp; unitbuf(ios_base&amp; str);
ios_base&amp; nounitbuf(ios_base&amp; str); </PRE></BLOCKQUOTE>
<HR>
<A name=36>
<H3>36.&nbsp;Iword &amp; pword storage lifetime omitted</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.storage">[lib.ios.base.storage]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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: </P>
<P>The reference returned may become invalid after another call to the object's 
iword member with a different index ... </P>
<P>This is not idle speculation; at least one implementation was done this way. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Add in 27.4.2.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.storage">[lib.ios.base.storage]</A>, 
in both paragraph 2 and also in paragraph 4, replace the sentence: </P>
<BLOCKQUOTE>
  <P>The reference returned may become invalid after another call to the 
  object's iword [pword] member with a different index, after a call to its 
  copyfmt member, or when the object is destroyed. </P></BLOCKQUOTE>
<P>with: </P>
<BLOCKQUOTE>
  <P>The reference returned is invalid after any other operations on the object. 
  However, the value of the storage referred to is retained, so that until the 
  next call to copyfmt, calling iword [pword] with the same index yields another 
  reference to the same value. </P></BLOCKQUOTE>
<P>substituting "iword" or "pword" as appropriate. </P>
<HR>
<A name=37>
<H3>37.&nbsp;Leftover "global" reference</H3></A>
<P><B>Section:</B>&nbsp;22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>In the overview of locale semantics, paragraph 4, is the sentence </P>
<BLOCKQUOTE>
  <P>If Facet is not present in a locale (or, failing that, in the global 
  locale), it throws the standard exception bad_cast. </P></BLOCKQUOTE>
<P>This is not supported by the definition of use_facet&lt;&gt;, and represents 
semantics from an old draft. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A>, 
paragraph 4, delete the parenthesized expression </P>
<BLOCKQUOTE>
  <P>(or, failing that, in the global locale) </P></BLOCKQUOTE>
<HR>
<A name=38>
<H3>38.&nbsp;Facet definition incomplete</H3></A>
<P><B>Section:</B>&nbsp;22.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.global.templates">[lib.locale.global.templates]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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 <I>id</I>, cannot safely serve as the argument <I>F</I> to 
use_facet&lt;F&gt;(loc), because there is no guarantee that a reference to the 
facet instance stored in <I>loc</I> is safely convertible to <I>F</I>. </P>
<P><B>Proposed resolution:</B></P>
<P>In the definition of std::use_facet&lt;&gt;(), replace the text in paragraph 
1 which reads: </P>
<BLOCKQUOTE>
  <P>Get a reference to a facet of a locale. </P></BLOCKQUOTE>
<P>with: </P>
<BLOCKQUOTE>
  <P>Requires: <TT>Facet</TT> is a facet class whose definition contains the 
  public static member <TT>id</TT> as defined in 22.1.1.1.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.facet">[lib.locale.facet]</A>. 
  </P></BLOCKQUOTE>
<P><I>[ Kona: strike as overspecification the text "(not inherits)" from the 
original resolution, which read "... whose definition contains (not inherits) 
the public static member <TT>id</TT>..." ]</I></P>
<HR>
<A name=39>
<H3>39.&nbsp;istreambuf_iterator&lt;&gt;::operator++(int) definition 
garbled</H3></A>
<P><B>Section:</B>&nbsp;24.5.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator::op++">[lib.istreambuf.iterator::op++]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>Following the definition of istreambuf_iterator&lt;&gt;::operator++(int) in 
paragraph 3, the standard contains three lines of garbage text left over from a 
previous edit. </P>
<BLOCKQUOTE><PRE>istreambuf_iterator&lt;charT,traits&gt; tmp = *this;
sbuf_-&gt;sbumpc();
return(tmp); </PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>In 24.5.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator::op++">[lib.istreambuf.iterator::op++]</A>, 
delete the three lines of code at the end of paragraph 3. </P>
<HR>
<A name=40>
<H3>40.&nbsp;Meaningless normative paragraph in examples</H3></A>
<P><B>Section:</B>&nbsp;22.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facets.examples">[lib.facets.examples]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Delete 22.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facets.examples">[lib.facets.examples]</A> 
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. </P>
<HR>
<A name=41>
<H3>41.&nbsp;Ios_base needs clear(), exceptions()</H3></A>
<P><B>Section:</B>&nbsp;27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The description of ios_base::iword() and pword() in 27.4.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.members.static">[lib.ios.members.static]</A>, 
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&lt;&gt;. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the description in 27.4.2.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.storage">[lib.ios.base.storage]</A> 
in paragraph 2, and also in paragraph 4, as follows. Replace</P>
<BLOCKQUOTE>
  <P>If the function fails it sets badbit, which may throw an 
exception.</P></BLOCKQUOTE>
<P>with</P>
<BLOCKQUOTE>
  <P>If the function fails, and <TT>*this</TT> is a base sub-object of a 
  <TT>basic_ios&lt;&gt;</TT> object or sub-object, the effect is equivalent to 
  calling <TT>basic_ios&lt;&gt;::setstate(badbit)</TT> on the derived object 
  (which may throw <TT>failure</TT>).</P></BLOCKQUOTE>
<P><I>[Kona: LWG reviewed wording; setstate(failbit) changed to 
setstate(badbit).]</I></P>
<HR>
<A name=42>
<H3>42.&nbsp;String ctors specify wrong default allocator</H3></A>
<P><B>Section:</B>&nbsp;21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The basic_string&lt;&gt; copy constructor: </P><PRE>basic_string(const basic_string&amp; str, size_type pos = 0,
             size_type n = npos, const Allocator&amp; a = Allocator()); </PRE>
<P>specifies an Allocator argument default value that is counter-intuitive. The 
natural choice for a the allocator to copy from is str.get_allocator(). Though 
this cannot be expressed in default-argument notation, overloading suffices. 
</P>
<P>Alternatively, the other containers in Clause 23 (deque, list, vector) do not 
have this form of constructor, so it is inconsistent, and an evident source of 
confusion, for basic_string&lt;&gt; to have it, so it might better be removed. 
</P>
<P><B>Proposed resolution:</B></P>
<P>In 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>, 
replace the declaration of the copy constructor as follows: </P>
<BLOCKQUOTE><PRE>basic_string(const basic_string&amp; str);
basic_string(const basic_string&amp; str, size_type pos, size_type n = npos,
             const Allocator&amp; a = Allocator());</PRE></BLOCKQUOTE>
<P>In 21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A>, 
replace the copy constructor declaration as above. Add to paragraph 5, 
Effects:</P>
<BLOCKQUOTE>
  <P>In the first form, the Allocator value used is copied from 
  <TT>str.get_allocator()</TT>.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG believes the constructor is actually broken, rather than just an 
unfortunate design choice.</P>
<P>The LWG considered two other possible resolutions:</P>
<P>A. In 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>, 
replace the declaration of the copy constructor as follows:</P>
<BLOCKQUOTE><PRE>basic_string(const basic_string&amp; str, size_type pos = 0,
             size_type n = npos);
basic_string(const basic_string&amp; str, size_type pos,
             size_type n, const Allocator&amp; a); </PRE></BLOCKQUOTE>
<P>In 21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A>, 
replace the copy constructor declaration as above. Add to paragraph 5, Effects: 
</P>
<BLOCKQUOTE>
  <P>When no <TT>Allocator</TT> argument is provided, the string is constructed 
  using the value <TT>str.get_allocator()</TT>. </P></BLOCKQUOTE>
<P>B. In 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>, 
and also in 21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A>, 
replace the declaration of the copy constructor as follows: </P>
<BLOCKQUOTE><PRE>basic_string(const basic_string&amp; str, size_type pos = 0,
             size_type n = npos); </PRE></BLOCKQUOTE>
<P>The proposed resolution reflects the original intent of the LWG. It was also 
noted by Pete Becker that this fix "will cause a small amount of existing code 
to now work correctly."</P>
<P><I>[ Kona: issue editing snafu fixed - the proposed resolution now correctly 
reflects the LWG consensus. ]</I></P>
<HR>
<A name=44>
<H3>44.&nbsp;Iostreams use operator== on int_type values</H3></A>
<P><B>Section:</B>&nbsp;27 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.input.output">[lib.input.output]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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 specified to be used 
throughout. This is an inconsistency; we should change uses of == and != to use 
the traits members instead. </P>
<P><B>Proposed resolution:</B></P>
<P><I>[Pre-Kona: Dietmar supplied wording]</I></P>
<P>List of changes to clause 27:</P>
<OL>
  <LI>In lib.basic.ios.members paragraph 13 (postcondition clause for 
  'fill(cT)') change 
  <BLOCKQUOTE>fillch == fill() </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(fillch, fill()) </BLOCKQUOTE>
  <LI>In lib.istream.unformatted paragraph 7 (effects clause for 
  'get(cT,streamsize,cT)'), third bullet, change 
  <BLOCKQUOTE>c == delim for the next available input character c 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(c, delim) for the next available input character c 
  </BLOCKQUOTE>
  <LI>In lib.istream.unformatted paragraph 12 (effects clause for 
  'get(basic_streambuf&lt;cT,Tr&gt;&amp;,cT)'), third bullet, change 
  <BLOCKQUOTE>c == delim for the next available input character c 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(c, delim) for the next available input character c 
  </BLOCKQUOTE>
  <LI>In lib.istream.unformatted paragraph 17 (effects clause for 
  'getline(cT,streamsize,cT)'), second bullet, change 
  <BLOCKQUOTE>c == delim for the next available input character c 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(c, delim) for the next available input character c 
  </BLOCKQUOTE>
  <LI>In lib.istream.unformatted paragraph 24 (effects clause for 
  'ignore(int,int_type)'), second bullet, change 
  <BLOCKQUOTE>c == delim for the next available input character c 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq_int_type(c, delim) for the next available input 
    character c </BLOCKQUOTE>
  <LI>In lib.istream.unformatted paragraph 25 (notes clause for 
  'ignore(int,int_type)'), second bullet, change 
  <BLOCKQUOTE>The last condition will never occur if delim == traits::eof() 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>The last condition will never occur if 
    traits::eq_int_type(delim, traits::eof()). </BLOCKQUOTE>
  <LI>In lib.istream.sentry paragraph 6 (example implementation for the sentry 
  constructor) change 
  <BLOCKQUOTE>while ((c = is.rdbuf()-&gt;snextc()) != traits::eof()) { 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>while (!traits::eq_int_type(c = is.rdbuf()-&gt;snextc(), 
    traits::eof())) { </BLOCKQUOTE></LI></OL>
<P>List of changes to Chapter 21:</P>
<OL>
  <LI>In lib.string::find paragraph 1 (effects clause for find()), second 
  bullet, change 
  <BLOCKQUOTE>at(xpos+I) == str.at(I) for all elements ... </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(at(xpos+I), str.at(I)) for all elements ... 
  </BLOCKQUOTE>
  <LI>In lib.string::rfind paragraph 1 (effects clause for rfind()), second 
  bullet, change 
  <BLOCKQUOTE>at(xpos+I) == str.at(I) for all elements ... </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(at(xpos+I), str.at(I)) for all elements ... 
  </BLOCKQUOTE>
  <LI>In lib.string::find.first.of paragraph 1 (effects clause for 
  find_first_of()), second bullet, change 
  <BLOCKQUOTE>at(xpos+I) == str.at(I) for all elements ... </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(at(xpos+I), str.at(I)) for all elements ... 
  </BLOCKQUOTE>
  <LI>In lib.string::find.last.of paragraph 1 (effects clause for 
  find_last_of()), second bullet, change 
  <BLOCKQUOTE>at(xpos+I) == str.at(I) for all elements ... </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(at(xpos+I), str.at(I)) for all elements ... 
  </BLOCKQUOTE>
  <LI>In lib.string::find.first.not.of paragraph 1 (effects clause for 
  find_first_not_of()), second bullet, change 
  <BLOCKQUOTE>at(xpos+I) == str.at(I) for all elements ... </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(at(xpos+I), str.at(I)) for all elements ... 
  </BLOCKQUOTE>
  <LI>In lib.string::find.last.not.of paragraph 1 (effects clause for 
  find_last_not_of()), second bullet, change 
  <BLOCKQUOTE>at(xpos+I) == str.at(I) for all elements ... </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(at(xpos+I), str.at(I)) for all elements ... 
  </BLOCKQUOTE>
  <LI>In lib.string.ios paragraph 5 (effects clause for getline()), second 
  bullet, change 
  <BLOCKQUOTE>c == delim for the next available input character c 
  </BLOCKQUOTE>to 
  <BLOCKQUOTE>traits::eq(c, delim) for the next available input character c 
  </BLOCKQUOTE></LI></OL>
<P>Notes:</P>
<UL>
  <LI>Fixing this issue highlights another sloppyness in lib.istream.unformatted 
  paragraph 24: this clause mentions a "character" which is then compared to an 
  'int_type' (see item 5. in the list below). It is not clear whether this 
  requires explicit words and if so what these words are supposed to be. A 
  similar issue exists, BTW, for operator*() of istreambuf_iterator which 
  returns the result of sgetc() as a character type (see 
  lib.istreambuf.iterator::op* paragraph 1), and for operator++() of 
  istreambuf_iterator which passes the result of sbumpc() to a constructor 
  taking a char_type (see lib.istreambuf.iterator::operator++ paragraph 3). 
  Similarily, the assignment operator ostreambuf_iterator passes a char_type to 
  a function taking an int_type (see lib.ostreambuf.iter.ops paragraph 1). 
  <LI>It is inconsistent to use comparisons using the traits functions in 
  Chapter 27 while not using them in Chapter 21, especially as some of the 
  inconsistent uses actually involve streams (eg. getline() on streams). To 
  avoid leaving this issue open still longer due to this inconsistency (it is 
  open since 1998), a list of changes to Chapter 21 is below. 
  <LI>In Chapter 24 there are several places with statements like "the end of 
  stream is reached (streambuf_type::sgetc() returns traits::eof())" 
  (lib.istreambuf.iterator paragraph 1, lib.ostreambuf.iter.ops paragraph 5). It 
  is unclear whether these should be clarified to use traits::eq_int_type() for 
  detecting traits::eof(). </LI></UL>
<HR>
<A name=46>
<H3>46.&nbsp;Minor Annex D errors</H3></A>
<P><B>Section:</B>&nbsp;D.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.str.strstreams">[depr.str.strstreams]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Brendan Kehoe&nbsp; <B>Date:</B>&nbsp; 1 Jun 1998</P>
<P>See lib-6522 and edit-814.</P>
<P><B>Proposed resolution:</B></P>
<P>Change D.7.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstreambuf">[depr.strstreambuf]</A> 
(since streambuf is a typedef of basic_streambuf&lt;char&gt;) from:</P><PRE>         virtual streambuf&lt;char&gt;* setbuf(char* s, streamsize n);</PRE>
<P>to:</P><PRE>         virtual streambuf* setbuf(char* s, streamsize n);</PRE>
<P>In D.7.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstream">[depr.strstream]</A> 
insert the semicolon now missing after int_type:</P><PRE>     namespace std {
       class strstream
         : public basic_iostream&lt;char&gt; {
       public:
         // Types
         typedef char                                char_type;
         typedef typename char_traits&lt;char&gt;::int_type int_type
         typedef typename char_traits&lt;char&gt;::pos_type pos_type;</PRE>
<HR>
<A name=47>
<H3>47.&nbsp;Imbue() and getloc() Returns clauses swapped</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.locales">[lib.ios.base.locales]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;21 Jun 1998</P>
<P>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?</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.4.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.locales">[lib.ios.base.locales]</A> 
swap paragraphs 2 and 4.</P>
<HR>
<A name=48>
<H3>48.&nbsp;Use of non-existent exception constructor</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios::failure">[lib.ios::failure]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;21 Jun 1998</P>
<P>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.</P>
<P><B>Proposed resolution:</B></P>
<P>Replace 27.4.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios::failure">[lib.ios::failure]</A>, 
paragraph 2, with</P>
<BLOCKQUOTE>
  <P>EFFECTS: Constructs an object of class <TT>failure</TT>.</P></BLOCKQUOTE>
<HR>
<A name=49>
<H3>49.&nbsp;Underspecification of ios_base::sync_with_stdio</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.members.static">[lib.ios.members.static]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;21 Jun 1998</P>
<P>Two problems</P>
<P>(1) 27.4.2.4 doesn't say what ios_base::sync_with_stdio(f) returns. Does it 
return f, or does it return the previous synchronization state? My guess is the 
latter, but the standard doesn't say so.</P>
<P>(2) 27.4.2.4 doesn't say what it means for streams to be 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.)</P>
<P><B>Proposed resolution:</B></P>
<P>Change the following sentence in 27.4.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.members.static">[lib.ios.members.static]</A> 
returns clause from:</P>
<BLOCKQUOTE>
  <P><TT>true</TT> if the standard iostream objects (27.3) are synchronized and 
  otherwise returns <TT>false</TT>.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P><TT>true</TT> if the previous state of the standard iostream objects (27.3) 
  was synchronized and otherwise returns <TT>false</TT>.</P></BLOCKQUOTE>
<P>Add the following immediately after 27.4.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.members.static">[lib.ios.members.static]</A>, 
paragraph 2:</P>
<BLOCKQUOTE>
  <P>When a standard iostream object str is <I>synchronized</I> with a standard 
  stdio stream f, the effect of inserting a character c by</P><PRE>  fputc(f, c);
</PRE>
  <P>is the same as the effect of</P><PRE>  str.rdbuf()-&gt;sputc(c);
</PRE>
  <P>for any sequence of characters; the effect of extracting a character c 
  by</P><PRE>  c = fgetc(f);
</PRE>
  <P>is the same as the effect of:</P><PRE>  c = str.rdbuf()-&gt;sbumpc(c);
</PRE>
  <P>for any sequences of characters; and the effect of pushing back a character 
  c by</P><PRE>  ungetc(c, f);
</PRE>
  <P>is the same as the effect of</P><PRE>  str.rdbuf()-&gt;sputbackc(c);
</PRE>
  <P>for any sequence of characters. [<I>Footnote</I>: This implies that 
  operations on a standard iostream object can be mixed arbitrarily with 
  operations on the corresponding stdio stream. In practical terms, 
  synchronization usually means that a standard iostream object and a standard 
  stdio object share a buffer. <I>--End Footnote</I>]</P></BLOCKQUOTE>
<P><I>[pre-Copenhagen: PJP and Matt contributed the definition of 
"synchronization"]</I></P>
<P><I>[post-Copenhagen: proposed resolution was revised slightly: text was added 
in the non-normative footnote to say that operations on the two streams can be 
mixed arbitrarily.]</I></P>
<HR>
<A name=50>
<H3>50.&nbsp;Copy constructor and assignment operator of ios_base</H3></A>
<P><B>Section:</B>&nbsp;27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;21 Jun 1998</P>
<P>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 take specific steps to avoid 
them.) However, nothing in 27.4.2 says what the copy constructor and assignment 
operator do. </P>
<P>My guess is that this was an oversight, that ios_base is, like basic_ios, not 
supposed to have a copy constructor or an assignment operator.</P>
<P>Jerry Schwarz comments: Yes, its an oversight, but in the opposite sense to 
what you're suggesting. At one point there was a definite intention that you 
could copy ios_base. It's an easy way to save the entire state of a stream for 
future use. As you note, to carry out that intention would have required a 
explicit description of the semantics (e.g. what happens to the iarray and 
parray stuff). </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A>, 
class ios_base, specify the copy constructor and operator= members as being 
private.</P>
<P><B>Rationale:</B></P>
<P>The LWG believes the difficulty of specifying correct semantics outweighs any 
benefit of allowing ios_base objects to be copyable.</P>
<HR>
<A name=51>
<H3>51.&nbsp;Requirement to not invalidate iterators missing</H3></A>
<P><B>Section:</B>&nbsp;23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;David Vandevoorde&nbsp; <B>Date:</B>&nbsp;23 Jun 1998</P>
<P>The std::sort algorithm can in general only sort a given sequence by moving 
around values. The list&lt;&gt;::sort() member on the other hand could move 
around values or just update internal pointers. Either method can leave 
iterators into the list&lt;&gt; dereferencable, but they would point to 
different things. </P>
<P>Does the FDIS mandate anywhere which method should be used for 
list&lt;&gt;::sort()?</P>
<P>Matt Austern comments:</P>
<P>I think you've found an omission in the standard. </P>
<P>The library working group discussed this point, and there was supposed to be 
a general requirement saying that list, set, map, multiset, and multimap may not 
invalidate iterators, or change the values that iterators point to, except when 
an operation does it explicitly. So, for example, insert() doesn't invalidate 
any iterators and erase() and remove() only invalidate iterators pointing to the 
elements that are being erased. </P>
<P>I looked for that general requirement in the FDIS, and, while I found a 
limited form of it for the sorted associative containers, I didn't find it for 
list. It looks like it just got omitted. </P>
<P>The intention, though, is that list&lt;&gt;::sort does not invalidate any 
iterators and does not change the values that any iterator points to. There 
would be no reason to have the member function otherwise.</P>
<P><B>Proposed resolution:</B></P>
<P>Add a new paragraph at the end of 23.1:</P>
<BLOCKQUOTE>
  <P>Unless otherwise specified (either explicitly or by defining a function in 
  terms of other functions), invoking a container member function or passing a 
  container as an argument to a library function shall not invalidate iterators 
  to, or change the values of, objects within that container. </P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>This was US issue CD2-23-011; it was accepted in London but the change was 
not made due to an editing oversight. The wording in the proposed resolution 
below is somewhat updated from CD2-23-011, particularly the addition of the 
phrase "or change the values of"</P>
<HR>
<A name=52>
<H3>52.&nbsp;Small I/O problems</H3></A>
<P><B>Section:</B>&nbsp;27.4.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fpos.operations">[lib.fpos.operations]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;23 Jun 1998</P>
<P>First, 27.4.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.cons">[lib.basic.ios.cons]</A>, 
table 89. This is pretty obvious: it should be titled "basic_ios&lt;&gt;() 
effects", not "ios_base() effects". </P>
<P>[The second item is a duplicate; see issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#6">6</A> 
for resolution.]</P>
<P>Second, 27.4.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fpos.operations">[lib.fpos.operations]</A> 
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 of 
thing "i" is. </P>
<P>(The other problem is that it requires support for streampos arithmetic. This 
is impossible on some systems, i.e. ones where file position is a complicated 
structure rather than just a number. Jerry tells me that the intention was to 
require syntactic support for streampos arithmetic, but that it wasn't actually 
supposed to do anything meaningful except on platforms, like Unix, where genuine 
arithmetic is possible.) </P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.4.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.cons">[lib.basic.ios.cons]</A> 
table 89 title from "ios_base() effects" to "basic_ios&lt;&gt;() effects". </P>
<HR>
<A name=53>
<H3>53.&nbsp;Basic_ios destructor unspecified</H3></A>
<P><B>Section:</B>&nbsp;27.4.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.cons">[lib.basic.ios.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;23 Jun 1998</P>
<P>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().</P>
<P><B>Proposed resolution:</B></P>
<P>Add after 27.4.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.cons">[lib.basic.ios.cons]</A> 
paragraph 2:</P>
<BLOCKQUOTE>
  <P><TT>virtual ~basic_ios();</TT></P>
  <P><B>Notes</B>: The destructor does not destroy 
<TT>rdbuf()</TT>.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG reviewed the additional question of whether or not <TT>rdbuf(0)</TT> 
may set <TT>badbit</TT>. The answer is clearly yes; it may be set via 
<TT>clear()</TT>. See 27.4.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.members">[lib.basic.ios.members]</A>, 
paragraph 6. This issue was reviewed at length by the LWG, which removed from 
the original proposed resolution a footnote which incorrectly said 
"<TT>rdbuf(0)</TT> does not set <TT>badbit</TT>".</P>
<HR>
<A name=54>
<H3>54.&nbsp;Basic_streambuf's destructor</H3></A>
<P><B>Section:</B>&nbsp;27.5.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.cons">[lib.streambuf.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;25 Jun 1998</P>
<P>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. </P>
<P><B>Proposed resolution:</B></P>
<P>Add after 27.5.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.cons">[lib.streambuf.cons]</A> 
paragraph 2:</P>
<BLOCKQUOTE>
  <P><TT>virtual&nbsp; ~basic_streambuf();</TT></P>
  <P><B>Effects</B>: None.</P></BLOCKQUOTE>
<HR>
<A name=55>
<H3>55.&nbsp;Invalid stream position is undefined</H3></A>
<P><B>Section:</B>&nbsp;27 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.input.output">[lib.input.output]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;26 Jun 1998</P>
<P>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, paragraph 4, and 27.8.1.4, paragraph 15) 
contain a cross-reference to a definition in _lib.iostreams.definitions_, a 
nonexistent section. </P>
<P>I suspect that the invalid stream position is just supposed to be 
pos_type(-1). Probably best to say explicitly in (for example) 27.5.2.4.2 that 
the return value is pos_type(-1), rather than to use the term "invalid stream 
position", define that term somewhere, and then put in a cross-reference. </P>
<P>The phrase "invalid stream position" appears ten times in the C++ Standard. 
In seven places it refers to a return value, and it should be changed. In three 
places it refers to an argument, and it should not be changed. Here are the 
three places where "invalid stream position" should not be changed:</P>
<BLOCKQUOTE>
  <P>27.7.1.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.virtuals">[lib.stringbuf.virtuals]</A>, 
  paragraph 14<BR>27.8.1.4 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A>, 
  paragraph 14<BR>D.7.1.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstreambuf.virtuals">[depr.strstreambuf.virtuals]</A>, 
  paragraph 17 </P></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>In 27.5.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.buffer">[lib.streambuf.virt.buffer]</A>, 
paragraph 4, change "Returns an object of class pos_type that stores an invalid 
stream position (_lib.iostreams.definitions_)" to "Returns 
<TT>pos_type(off_type(-1))</TT>". </P>
<P>In 27.5.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.buffer">[lib.streambuf.virt.buffer]</A>, 
paragraph 6, change "Returns an object of class pos_type that stores an invalid 
stream position" to "Returns <TT>pos_type(off_type(-1))</TT>".</P>
<P>In 27.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.virtuals">[lib.stringbuf.virtuals]</A>, 
paragraph 13, change "the object stores an invalid stream position" to "the 
return value is <TT>pos_type(off_type(-1))</TT>". </P>
<P>In 27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A>, 
paragraph 13, change "returns an invalid stream position (27.4.3)" to "returns 
<TT>pos_type(off_type(-1))</TT>" </P>
<P>In 27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A>, 
paragraph 15, change "Otherwise returns an invalid stream position 
(_lib.iostreams.definitions_)" to "Otherwise returns 
<TT>pos_type(off_type(-1))</TT>" </P>
<P>In D.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstreambuf.virtuals">[depr.strstreambuf.virtuals]</A>, 
paragraph 15, change "the object stores an invalid stream position" to "the 
return value is <TT>pos_type(off_type(-1))</TT>" </P>
<P>In D.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstreambuf.virtuals">[depr.strstreambuf.virtuals]</A>, 
paragraph 18, change "the object stores an invalid stream position" to "the 
return value is <TT>pos_type(off_type(-1))</TT>"</P>
<HR>
<A name=56>
<H3>56.&nbsp;Showmanyc's return type</H3></A>
<P><B>Section:</B>&nbsp;27.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf">[lib.streambuf]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;29 Jun 1998</P>
<P>The class summary for basic_streambuf&lt;&gt;, in 27.5.2, says that showmanyc 
has return type int. However, 27.5.2.4.3 says that its return type is 
streamsize. </P>
<P><B>Proposed resolution:</B></P>
<P>Change <TT>showmanyc</TT>'s return type in the 27.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf">[lib.streambuf]</A> 
class summary to <TT>streamsize</TT>.</P>
<HR>
<A name=57>
<H3>57.&nbsp;Mistake in char_traits</H3></A>
<P><B>Section:</B>&nbsp;21.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.char.traits.specializations.wchar.t">[lib.char.traits.specializations.wchar.t]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;1 Jul 1998</P>
<P>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 encodings in wide-oriented streams". 
</P>
<P>That's wrong: the two are the same type. The &lt;iosfwd&gt; summary in 27.2 
says that streampos and wstreampos are, respectively, synonyms for 
fpos&lt;char_traits&lt;char&gt;::state_type&gt; and 
fpos&lt;char_traits&lt;wchar_t&gt;::state_type&gt;, and, flipping back to clause 
21, we see in 21.1.3.1 and 21.1.3.2 that char_traits&lt;char&gt;::state_type and 
char_traits&lt;wchar_t&gt;::state_type must both be mbstate_t. </P>
<P><B>Proposed resolution:</B></P>
<P>Remove the sentence in 21.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.char.traits.specializations.wchar.t">[lib.char.traits.specializations.wchar.t]</A> 
paragraph 3 which begins "The types streampos and wstreampos may be 
different..." . </P>
<HR>
<A name=59>
<H3>59.&nbsp;Ambiguity in specification of gbump</H3></A>
<P><B>Section:</B>&nbsp;27.5.2.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.get.area">[lib.streambuf.get.area]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;28 Jul 1998</P>
<P>27.5.2.3.1 says that basic_streambuf::gbump() "Advances the next pointer for 
the input sequence by n." </P>
<P>The straightforward interpretation is that it is just gptr() += n. An 
alternative interpretation, though, is that it behaves as if it calls sbumpc n 
times. (The issue, of course, is whether it might ever call underflow.) There is 
a similar ambiguity in the case of pbump. </P>
<P>(The "classic" AT&amp;T implementation used the former interpretation.)</P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.5.2.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.get.area">[lib.streambuf.get.area]</A> 
paragraph 4 gbump effects from:</P>
<BLOCKQUOTE>
  <P>Effects: Advances the next pointer for the input sequence by 
n.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Effects: Adds <TT>n</TT> to the next pointer for the input 
sequence.</P></BLOCKQUOTE>
<P>Make the same change to 27.5.2.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.put.area">[lib.streambuf.put.area]</A> 
paragraph 4 pbump effects.</P>
<HR>
<A name=60>
<H3>60.&nbsp;What is a formatted input function?</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.reqmts">[lib.istream.formatted.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;3 Aug 1998</P>
<P>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 like a formatted input member (as 
described in 27.6.1.2.1)"), but others don't. The question: is 27.6.1.2.1 
supposed to apply to everything in 27.6.1.2, or only to those member functions 
that explicitly say "behaves like a formatted input member"? Or to put it 
differently: are we to assume that everything that appears in a section called 
"Formatted input functions" really is a formatted input function? I assume that 
27.6.1.2.1 is intended to apply to the arithmetic extractors (27.6.1.2.2), but I 
assume that it is not intended to apply to extractors like </P><PRE>    basic_istream&amp; operator&gt;&gt;(basic_istream&amp; (*pf)(basic_istream&amp;));</PRE>
<P>and </P><PRE>    basic_istream&amp; operator&gt;&gt;(basic_streammbuf*);</PRE>
<P>There is a similar ambiguity for unformatted input, formatted output, and 
unformatted output. </P>
<P>Comments from Judy Ward: It seems like the problem is that the basic_istream 
and basic_ostream operator &lt;&lt;()'s that are used for the manipulators and 
streambuf* are in the wrong section and should have their own separate section 
or be modified to make it clear 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. </P>
<P>Additional comments from Dietmar Khl: It appears to be somewhat nonsensical 
to consider the functions defined in 27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A> 
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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.reqmts">[lib.istream.formatted.reqmts]</A>: 
If this is the case, all manipulators, not just <TT>ws</TT>, would skip 
whitespace unless <TT>noskipws</TT> is set (... but setting <TT>noskipws</TT> 
using the manipulator syntax would also skip whitespace :-)</P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A> 
are unformatted input functions. However, it does not really make much sense to 
construct a sentry object for <TT>gcount()</TT>, <TT>sync()</TT>, ... Also it is 
unclear what happens to the <TT>gcount()</TT> if eg. <TT>gcount()</TT>, 
<TT>putback()</TT>, <TT>unget()</TT>, or <TT>sync()</TT> is called: These 
functions don't extract characters, some of them even "unextract" a character. 
Should this still be reflected in <TT>gcount()</TT>? Of course, it could be read 
as if after a call to <TT>gcount()</TT> <TT>gcount()</TT> return <TT>0</TT> (the 
last unformatted input function, <TT>gcount()</TT>, didn't extract any 
character) and after a call to <TT>putback()</TT> <TT>gcount()</TT> returns 
<TT>-1</TT> (the last unformatted input function <TT>putback()</TT> did 
"extract" back into the stream). Correspondingly for <TT>unget()</TT>. Is this 
what is intended? If so, this should be clarified. Otherwise, a corresponding 
clarification should be used.</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.2.2 [lib.istream.formatted.arithmetic], paragraph 1. Change the 
beginning of the second sentence from "The conversion occurs" to "These 
extractors behave as formatted input functions (as described in 27.6.1.2.1). 
After a sentry object is constructed, the conversion occurs" </P>
<P>In 27.6.1.2.3, [lib.istream::extractors], before paragraph 1. Add an effects 
clause. "Effects: None. This extractor does not behave as a formatted input 
function (as described in 27.6.1.2.1). </P>
<P>In 27.6.1.2.3, [lib.istream::extractors], paragraph 2. Change the effects 
clause to "Effects: Calls pf(*this). This extractor does not behave as a 
formatted input function (as described in 27.6.1.2.1). </P>
<P>In 27.6.1.2.3, [lib.istream::extractors], paragraph 4. Change the effects 
clause to "Effects: Calls pf(*this). This extractor does not behave as a 
formatted input function (as described in 27.6.1.2.1). </P>
<P>In 27.6.1.2.3, [lib.istream::extractors], paragraph 12. Change the first two 
sentences from "If sb is null, calls setstate(failbit), which may throw 
ios_base::failure (27.4.4.3). Extracts characters from *this..." to "Behaves as 
a formatted input function (as described in 27.6.1.2.1). If sb is null, calls 
setstate(failbit), which may throw ios_base::failure (27.4.4.3). After a sentry 
object is constructed, extracts characters from *this...". </P>
<P>In 27.6.1.3, [lib.istream.unformatted], before paragraph 2. Add an effects 
clause. "Effects: none. This member function does not behave as an unformatted 
input function (as described in 27.6.1.3, paragraph 1)." </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 3. Change the beginning of 
the first sentence of the effects clause from "Extracts a character" to "Behaves 
as an unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, extracts a character" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 5. Change the beginning of 
the first sentence of the effects clause from "Extracts a character" to "Behaves 
as an unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, extracts a character" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 5. Change the beginning of 
the first sentence of the effects clause from "Extracts characters" to "Behaves 
as an unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, extracts characters" </P>
<P>[No change needed in paragraph 10, because it refers to paragraph 7.] </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 12. Change the beginning of 
the first sentence of the effects clause from "Extracts characters" to "Behaves 
as an unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, extracts characters" </P>
<P>[No change needed in paragraph 15.] </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 17. Change the beginning of 
the first sentence of the effects clause from "Extracts characters" to "Behaves 
as an unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, extracts characters" </P>
<P>[No change needed in paragraph 23.] </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 24. Change the beginning of 
the first sentence of the effects clause from "Extracts characters" to "Behaves 
as an unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, extracts characters" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], before paragraph 27. Add an Effects 
clause: "Effects: Behaves as an unformatted input function (as described in 
27.6.1.3, paragraph 1). After constructing a sentry object, reads but does not 
extract the current input character." </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 28. Change the first 
sentence of the Effects clause from "If !good() calls" to Behaves as an 
unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, if !good() calls" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 30. Change the first 
sentence of the Effects clause from "If !good() calls" to "Behaves as an 
unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, if !good() calls" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 32. Change the first 
sentence of the Effects clause from "If !good() calls..." to "Behaves as an 
unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, if !good() calls..." Add a new sentence to the end 
of the Effects clause: "[Note: this function extracts no characters, so the 
value returned by the next call to gcount() is 0.]" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 34. Change the first 
sentence of the Effects clause from "If !good() calls" to "Behaves as an 
unformatted input function (as described in 27.6.1.3, paragraph 1). After 
constructing a sentry object, if !good() calls". Add a new sentence to the end 
of the Effects clause: "[Note: this function extracts no characters, so the 
value returned by the next call to gcount() is 0.]" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 36. Change the first 
sentence of the Effects clause from "If !rdbuf() is" to "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 rdbuf() is" </P>
<P>In 27.6.1.3, [lib.istream.unformatted], before paragraph 37. Add an Effects 
clause: "Effects: 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()." Change the first sentence of paragraph 37 from "if fail()" to "after 
constructing a sentry object, if fail()". </P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 38. Change the first 
sentence of the Effects clause from "If fail()" to "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() 
</P>
<P>In 27.6.1.3, [lib.istream.unformatted], paragraph 40. Change the first 
sentence of the Effects clause from "If fail()" to "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() 
</P>
<P>In 27.6.2.5.2 [lib.ostream.inserters.arithmetic], paragraph 1. Change the 
beginning of the third sentence from "The formatting conversion" to "These 
extractors behave as formatted output functions (as described in 27.6.2.5.1). 
After the sentry object is constructed, the conversion occurs". </P>
<P>In 27.6.2.5.3 [lib.ostream.inserters], before paragraph 1. Add an effects 
clause: "Effects: None. Does not behave as a formatted output function (as 
described in 27.6.2.5.1).". </P>
<P>In 27.6.2.5.3 [lib.ostream.inserters], paragraph 2. Change the effects clause 
to "Effects: calls pf(*this). This extractor does not behave as a formatted 
output function (as described in 27.6.2.5.1).". </P>
<P>In 27.6.2.5.3 [lib.ostream.inserters], paragraph 4. Change the effects clause 
to "Effects: calls pf(*this). This extractor does not behave as a formatted 
output function (as described in 27.6.2.5.1).". </P>
<P>In 27.6.2.5.3 [lib.ostream.inserters], paragraph 6. Change the first sentence 
from "If sb" to "Behaves as a formatted output function (as described in 
27.6.2.5.1). After the sentry object is constructed, if sb". </P>
<P>In 27.6.2.6 [lib.ostream.unformatted], paragraph 2. Change the first sentence 
from "Inserts the character" to "Behaves as an unformatted output function (as 
described in 27.6.2.6, paragraph 1). After constructing a sentry object, inserts 
the character". </P>
<P>In 27.6.2.6 [lib.ostream.unformatted], paragraph 5. Change the first sentence 
from "Obtains characters" to "Behaves as an unformatted output function (as 
described in 27.6.2.6, paragraph 1). After constructing a sentry object, obtains 
characters". </P>
<P>In 27.6.2.6 [lib.ostream.unformatted], paragraph 7. Add a new sentence at the 
end of the paragraph: "Does not behave as an unformatted output function (as 
described in 27.6.2.6, paragraph 1)." </P>
<P><B>Rationale:</B></P>
<P>See J16/99-0043==WG21/N1219, Proposed Resolution to Library Issue 60, by Judy 
Ward and Matt Austern. This proposed resolution is section VI of that paper.</P>
<HR>
<A name=61>
<H3>61.&nbsp;Ambiguity in iostreams exception policy</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>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 the exception. That seems 
clear enough. Several of the specific functions, however, such as get() and 
read(), are documented in some circumstances as setting eofbit and/or failbit. 
(The standard notes, correctly, that setting eofbit or failbit can sometimes 
result in an exception being thrown.) The question: if one of these functions 
throws an exception triggered by setting failbit, is this an exception "thrown 
during input" and hence covered by 27.6.1.3, or does 27.6.1.3 only refer to a 
limited class of exceptions? Just to make this concrete, suppose you have the 
following snippet. </P><PRE>  
  char buffer[N];
  istream is;
  ...
  is.exceptions(istream::failbit); // Throw on failbit but not on badbit.
  is.read(buffer, N);</PRE>
<P>Now suppose we reach EOF before we've read N characters. What iostate bits 
can we expect to be set, and what exception (if any) will be thrown? </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.3, paragraph 1, after the sentence that begins "If an exception is 
thrown...", add the following parenthetical comment: "(Exceptions thrown from 
<TT>basic_ios&lt;&gt;::clear()</TT> are not caught or rethrown.)" </P>
<P><B>Rationale:</B></P>
<P>The LWG looked to two alternative wordings, and choose the proposed 
resolution as better standardese.</P>
<HR>
<A name=62>
<H3>62.&nbsp;<TT>Sync</TT>'s return value</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;6 Aug 1998</P>
<P>The Effects clause for sync() (27.6.1.3, paragraph 36) says that it "calls 
rdbuf()-&gt;pubsync() and, if that function returns -1 ... returns 
traits::eof()." </P>
<P>That looks suspicious, because traits::eof() is of type traits::int_type 
while the return type of sync() is int. </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>, 
paragraph 36, change "returns <TT>traits::eof()</TT>" to "returns <TT>-1</TT>". 
</P>
<HR>
<A name=63>
<H3>63.&nbsp;Exception-handling policy for unformatted output</H3></A>
<P><B>Section:</B>&nbsp;27.6.2.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.unformatted">[lib.ostream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;11 Aug 1998</P>
<P>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 kind of exception-handling 
policy as in the other three places, or else it should have a footnote saying 
that the omission is deliberate. </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.2.6, paragraph 1, replace the last sentence ("In any case, the 
unformatted output function ends by destroying the sentry object, then returning 
the value specified for the formatted output function.") with the following 
text: </P>
<BLOCKQUOTE>If an exception is thrown during output, then <TT>ios::badbit</TT> 
  is turned on [Footnote: without causing an <TT>ios::failure</TT> to be 
  thrown.] in <TT>*this</TT>'s error state. If <TT>(exceptions() &amp; badbit) 
  != 0</TT> then the exception is rethrown. In any case, the unformatted output 
  function ends by destroying the sentry object, then, if no exception was 
  thrown, returning the value specified for the formatted output function. 
</BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>This exception-handling policy is consistent with that of formatted input, 
unformatted input, and formatted output. </P>
<HR>
<A name=64>
<H3>64.&nbsp;Exception handling in 
<TT>basic_istream::operator&gt;&gt;(basic_streambuf*)</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;11 Aug 1998 </P>
<P>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. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace 27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A>, 
paragraph 13, which begins "If the function inserts no characters ..." with:</P>
<BLOCKQUOTE>
  <P>If the function inserts no characters, it calls <TT>setstate(failbit)</TT>, 
  which may throw <TT>ios_base::failure</TT> (27.4.4.3). If it inserted no 
  characters because it caught an exception thrown while extracting characters 
  from <TT>sb</TT> and <TT>failbit</TT> is on in <TT>exceptions()</TT> 
  (27.4.4.3), then the caught exception is rethrown. </P></BLOCKQUOTE>
<HR>
<A name=66>
<H3>66.&nbsp;Strstreambuf::setbuf</H3></A>
<P><B>Section:</B>&nbsp;D.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstreambuf.virtuals">[depr.strstreambuf.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;18 Aug 1998</P>
<P>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. </P>
<P><B>Proposed resolution:</B></P>
<P>D.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstreambuf.virtuals">[depr.strstreambuf.virtuals]</A>, 
paragraph 19, replace the setbuf effects clause which currently says "Performs 
an operation that is defined separately for each class derived from 
strstreambuf" with:</P>
<BLOCKQUOTE>
  <P><B>Effects</B>: implementation defined, except that <TT>setbuf(0,0)</TT> 
  has no effect.</P></BLOCKQUOTE>
<HR>
<A name=68>
<H3>68.&nbsp;Extractors for char* should store null at end</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;14 Jul 1998</P>
<P>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?</P>
<P>Comment from Jerry Schwarz: There is apparently an editing 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.</P>
<P><B>Proposed resolution:</B></P>
<P>27.6.1.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::extractors">[lib.istream::extractors]</A>, 
paragraph 7, change the last list item from:</P>
<BLOCKQUOTE>A null byte (<TT>charT()</TT>) in the next position, which may be 
  the first position if no characters were extracted. </BLOCKQUOTE>
<P>to become a new paragraph which reads:</P>
<BLOCKQUOTE>Operator&gt;&gt; then stores a null byte (<TT>charT()</TT>) in the 
  next position, which may be the first position if no characters were 
  extracted. </BLOCKQUOTE>
<HR>
<A name=69>
<H3>69.&nbsp;Must elements of a vector be contiguous?</H3></A>
<P><B>Section:</B>&nbsp;23.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector">[lib.vector]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrew Koenig&nbsp; <B>Date:</B>&nbsp;29 Jul 1998</P>
<P>The issue is this: Must the elements of a vector be in contiguous memory?</P>
<P>(Please note that this is entirely separate from the question of 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)</P>
<P><B>Proposed resolution:</B></P>
<P>Add the following text to the end of 23.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector">[lib.vector]</A>, 
paragraph 1. </P>
<BLOCKQUOTE>
  <P>The elements of a vector are stored contiguously, meaning that if v is a 
  <TT>vector&lt;T, Allocator&gt;</TT> where T is some type other than 
  <TT>bool</TT>, then it obeys the identity <TT>&amp;v[n] == &amp;v[0] + n</TT> 
  for all <TT>0 &lt;= n &lt; v.size()</TT>.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG feels that as a practical matter the answer is clearly "yes". There 
was considerable discussion as to the best way to express the concept of 
"contiguous", which is not directly defined in the standard. Discussion 
included:</P>
<UL>
  <LI>An operational definition similar to the above proposed resolution is 
  already used for valarray (26.3.2.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.valarray.access">[lib.valarray.access]</A>). 

  <LI>There is no need to explicitly consider a user-defined operator&amp; 
  because elements must be copyconstructible (23.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
  para 3) and copyconstructible (20.1.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.copyconstructible">[lib.copyconstructible]</A>) 
  specifies requirements for operator&amp;. 
  <LI>There is no issue of one-past-the-end because of language rules. </LI></UL>
<HR>
<A name=70>
<H3>70.&nbsp;Uncaught_exception() missing throw() specification</H3></A>
<P><B>Section:</B>&nbsp;18.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.support.exception">[lib.support.exception]</A>, 
18.6.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.uncaught">[lib.uncaught]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;Unknown</P>
<P>In article 3E04@pratique.fr, Valentin Bonnard writes: </P>
<P>uncaught_exception() doesn't have a throw specification.</P>
<P>It is intentional ? Does it means that one should be prepared to handle 
exceptions thrown from uncaught_exception() ?</P>
<P>uncaught_exception() is called in exception handling contexts where exception 
safety is very important.</P>
<P><B>Proposed resolution:</B></P>
<P>In 15.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/except.html#except.uncaught">[except.uncaught]</A>, 
paragraph 1, 18.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.support.exception">[lib.support.exception]</A>, 
and 18.6.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.uncaught">[lib.uncaught]</A>, 
add "throw()" to uncaught_exception().</P>
<HR>
<A name=71>
<H3>71.&nbsp;Do_get_monthname synopsis missing argument</H3></A>
<P><B>Section:</B>&nbsp;22.2.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.get">[lib.locale.time.get]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;13 Aug 1998</P>
<P>The locale facet member <TT>time_get&lt;&gt;::do_get_monthname</TT> is 
described in 22.2.5.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.get.virtuals">[lib.locale.time.get.virtuals]</A> 
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.</P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.get">[lib.locale.time.get]</A>, 
add an "end" argument to the declaration of member do_monthname as follows:</P><PRE>  virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base&amp;,
                                     ios_base::iostate&amp; err, tm* t) const;</PRE>
<HR>
<A name=74>
<H3>74.&nbsp;Garbled text for <TT>codecvt::do_max_length</TT> </H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;8 Sep 1998</P>
<P>The text of <TT>codecvt::do_max_length</TT>'s "Returns" clause (22.2.1.5.2, 
paragraph 11) is garbled. It has unbalanced parentheses and a spurious 
<B>n</B>.</P>
<P><B>Proposed resolution:</B></P>
<P>Replace 22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A> 
paragraph 11 with the following:</P>
<BLOCKQUOTE><B>Returns</B>: The maximum value that <TT>do_length(state, from, 
  from_end, 1)</TT> can return for any valid range <TT>[from, from_end)</TT> and 
  <TT>stateT</TT> value <TT>state</TT>. The specialization <TT>codecvt&lt;char, 
  char, mbstate_t&gt;::do_max_length()</TT> returns 1. </BLOCKQUOTE>
<HR>
<A name=75>
<H3>75.&nbsp;Contradiction in <TT>codecvt::length</TT>'s argument types</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt">[lib.locale.codecvt]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp; Matt Austern&nbsp; <B>Date:</B>&nbsp; 18 Sep 1998</P>
<P>The class synopses for classes <TT>codecvt&lt;&gt;</TT> (22.2.1.5) and 
<TT>codecvt_byname&lt;&gt;</TT> (22.2.1.6) say that the first parameter of the 
member functions <TT>length</TT> and <TT>do_length</TT> is of type <TT>const 
stateT&amp;</TT>. The member function descriptions, however (22.2.1.5.1, 
paragraph 6; 22.2.1.5.2, paragraph 9) say that the type is <TT>stateT&amp;</TT>. 
Either the synopsis or the summary must be changed. </P>
<P>If (as I believe) the member function descriptions are correct, then we must 
also add text saying how <TT>do_length</TT> changes its <TT>stateT</TT> 
argument. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt">[lib.locale.codecvt]</A>, 
and also in 22.2.1.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.byname">[lib.locale.codecvt.byname]</A>, 
change the <TT>stateT</TT> argument type on both member <TT>length()</TT> and 
member <TT>do_length()</TT> from </P>
<BLOCKQUOTE>
  <P><TT>const stateT&amp;</TT></P></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
  <P><TT>stateT&amp;</TT></P></BLOCKQUOTE>
<P>In 22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>, 
add to the definition for member <TT>do_length</TT> a paragraph:</P>
<BLOCKQUOTE>
  <P>Effects: The effect on the <TT>state</TT> argument is ``as if'' it called 
  <TT>do_in(state, from, from_end, from, to, to+max, to)</TT> for <TT>to</TT> 
  pointing to a buffer of at least <TT>max</TT> elements.</P></BLOCKQUOTE>
<HR>
<A name=76>
<H3>76.&nbsp;Can a <TT>codecvt</TT> facet always convert one internal character 
at a time?</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt">[lib.locale.codecvt]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;25 Sep 1998</P>
<P>This issue concerns the requirements on classes derived from 
<TT>codecvt</TT>, including user-defined classes. What are the restrictions on 
the conversion from external characters (e.g. <TT>char</TT>) to internal 
characters (e.g. <TT>wchar_t</TT>)? Or, alternatively, what assumptions about 
<TT>codecvt</TT> facets can the I/O library make? </P>
<P>The question is whether it's possible to convert from internal characters to 
external characters one internal character at a time, and whether, given a valid 
sequence of external characters, it's possible to pick off internal characters 
one at a time. Or, to put it differently: given a sequence of external 
characters and the corresponding sequence of internal characters, does a 
position in the internal sequence correspond to some position in the external 
sequence? </P>
<P>To make this concrete, suppose that <TT>[first, last)</TT> is a sequence of 
<I>M</I> external characters and that <TT>[ifirst, ilast)</TT> is the 
corresponding sequence of <I>N</I> internal characters, where <I>N &gt; 1</I>. 
That is, <TT>my_encoding.in()</TT>, applied to <TT>[first, last)</TT>, yields 
<TT>[ifirst, ilast)</TT>. Now the question: does there necessarily exist a 
subsequence of external characters, <TT>[first, last_1)</TT>, such that the 
corresponding sequence of internal characters is the single character 
<TT>*ifirst</TT>? </P>
<P>(What a "no" answer would mean is that <TT>my_encoding</TT> translates 
sequences only as blocks. There's a sequence of <I>M</I> external characters 
that maps to a sequence of <I>N</I> internal characters, but that external 
sequence has no subsequence that maps to <I>N-1</I> internal characters.) </P>
<P>Some of the wording in the standard, such as the description of 
<TT>codecvt::do_max_length</TT> (22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>, 
paragraph 11) and <TT>basic_filebuf::underflow</TT> (27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A>, 
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. </P>
<P>This issue seems (and is) quite technical, but it is important if we expect 
users to provide their own encoding facets. This is an area where the standard 
library calls user-supplied code, so a well-defined set of requirements for the 
user-supplied code is crucial. Users must be aware of the assumptions that the 
library makes. This issue affects positioning operations on 
<TT>basic_filebuf</TT>, unbuffered input, and several of <TT>codecvt</TT>'s 
member functions. </P>
<P><B>Proposed resolution:</B></P>
<P>Add the following text as a new paragraph, following 22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A> 
paragraph 2:</P>
<BLOCKQUOTE>
  <P>A <TT>codecvt</TT> facet that is used by <TT>basic_filebuf</TT> (27.8 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.file.streams">[lib.file.streams]</A>) 
  must have the property that if</P><PRE>    do_out(state, from, from_end, from_next, to, to_lim, to_next)
</PRE>would return <TT>ok</TT>, where <TT>from != from_end</TT>, then <PRE>    do_out(state, from, from + 1, from_next, to, to_end, to_next)
</PRE>must also return <TT>ok</TT>, and that if <PRE>    do_in(state, from, from_end, from_next, to, to_lim, to_next)
</PRE>would return <TT>ok</TT>, where <TT>to != to_lim</TT>, then <PRE>    do_in(state, from, from_end, from_next, to, to + 1, to_next)
</PRE>
  <P>must also return <TT>ok</TT>. [<I>Footnote:</I> Informally, this means that 
  <TT>basic_filebuf</TT> assumes that the mapping from internal to external 
  characters is 1 to N: a <TT>codecvt</TT> that is used by 
  <TT>basic_filebuf</TT> must be able to translate characters one internal 
  character at a time. <I>--End Footnote</I>]</P></BLOCKQUOTE>
<P><I>[Redmond: Minor change in proposed resolution. Original proposed 
resolution talked about "success", with a parenthetical comment that success 
meant returning <TT>ok</TT>. New wording removes all talk about "success", and 
just talks about the return value.]</I></P>
<P><B>Rationale:</B></P>
<P>The proposed resoluion says that conversions can be performed one internal 
character at a time. This rules out some encodings that would otherwise be 
legal. The alternative answer would mean there would be some internal positions 
that do not correspond to any external file position.</P>
<P>An example of an encoding that this rules out is one where the 
<TT>internT</TT> and <TT>externT</TT> are of the same type, and where the 
internal sequence <TT>c1 c2</TT> corresponds to the external sequence <TT>c2 
c1</TT>. </P>
<P>It was generally agreed that <TT>basic_filebuf</TT> relies on this property: 
it was designed under the assumption that the external-to-internal mapping is 
N-to-1, and it is not clear that <TT>basic_filebuf</TT> is implementable without 
that restriction. </P>
<P>The proposed resolution is expressed as a restriction on <TT>codecvt</TT> 
when used by <TT>basic_filebuf</TT>, rather than a blanket restriction on all 
<TT>codecvt</TT> facets, because <TT>basic_filebuf</TT> is the only other part 
of the library that uses <TT>codecvt</TT>. If a user wants to define a 
<TT>codecvt</TT> facet that implements a more general N-to-M mapping, there is 
no reason to prohibit it, so long as the user does not expect 
<TT>basic_filebuf</TT> to be able to use it. </P>
<HR>
<A name=78>
<H3>78.&nbsp;Typo: event_call_back</H3></A>
<P><B>Section:</B>&nbsp;27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>typo: event_call_back should be event_callback &nbsp; </P>
<P><B>Proposed resolution:</B></P>
<P>In the 27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A> 
synopsis change "event_call_back" to "event_callback". </P>
<HR>
<A name=79>
<H3>79.&nbsp;Inconsistent declaration of polar()</H3></A>
<P><B>Section:</B>&nbsp;26.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.synopsis">[lib.complex.synopsis]</A>, 
26.2.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.value.ops">[lib.complex.value.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>In 26.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.synopsis">[lib.complex.synopsis]</A> 
polar is declared as follows:</P><PRE>   template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp;, const T&amp;); </PRE>
<P>In 26.2.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.value.ops">[lib.complex.value.ops]</A> 
it is declared as follows:</P><PRE>   template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp; rho, const T&amp; theta = 0); </PRE>
<P>Thus whether the second parameter is optional is not clear. </P>
<P><B>Proposed resolution:</B></P>
<P>In 26.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.synopsis">[lib.complex.synopsis]</A> 
change:</P><PRE>   template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp;, const T&amp;);</PRE>
<P>to:</P><PRE>   template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp; rho, const T&amp; theta = 0); </PRE>
<HR>
<A name=80>
<H3>80.&nbsp;Global Operators of complex declared twice</H3></A>
<P><B>Section:</B>&nbsp;26.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.synopsis">[lib.complex.synopsis]</A>, 
26.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex">[lib.complex]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>Both 26.2.1 and 26.2.2 contain declarations of global operators for class 
complex. This redundancy should be removed.</P>
<P><B>Proposed resolution:</B></P>
<P>Reduce redundancy according to the general style of the standard. </P>
<HR>
<A name=83>
<H3>83.&nbsp;String::npos vs. string::max_size()</H3></A>
<P><B>Section:</B>&nbsp;21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>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 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.</P>
<P><B>Proposed resolution:</B></P>
<P>After 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A> 
paragraph 4 ("The functions described in this clause...") add a new 
paragraph:</P>
<BLOCKQUOTE>
  <P>For any string operation, if as a result of the operation, <TT>size()</TT> 
  would exceed <TT>max_size()</TT> then the operation throws 
  <TT>length_error</TT>.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG believes length_error is the correct exception to throw.</P>
<HR>
<A name=86>
<H3>86.&nbsp;String constructors don't describe exceptions</H3></A>
<P><B>Section:</B>&nbsp;21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>The constructor from a range:</P><PRE>template&lt;class InputIterator&gt; 
         basic_string(InputIterator begin, InputIterator end, 
                      const Allocator&amp; a = Allocator());</PRE>
<P>lacks a throws clause. However, I would expect that it throws according to 
the other constructors if the numbers of characters in the range equals npos (or 
exceeds max_size(), see above). </P>
<P><B>Proposed resolution:</B></P>
<P>In 21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A>, 
Strike throws paragraphs for constructors which say "Throws: length_error if n 
== npos."</P>
<P><B>Rationale:</B></P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#83">83</A>.</P>
<HR>
<A name=90>
<H3>90.&nbsp;Incorrect description of operator &gt;&gt; for strings</H3></A>
<P><B>Section:</B>&nbsp;21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>The effect of operator &gt;&gt; for strings contain the following item:</P>
<P>&nbsp;&nbsp;&nbsp; <TT>isspace(c,getloc())</TT> is true for the next 
available input character c.</P>
<P>Here <TT>getloc()</TT> has to be replaced by <TT>is.getloc()</TT>. </P>
<P><B>Proposed resolution:</B></P>
<P>In 21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A> 
paragraph 1 Effects clause replace:</P>
<BLOCKQUOTE>
  <P><TT>isspace(c,getloc())</TT> is true for the next available input character 
  c.</P></BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE>
  <P><TT>isspace(c,is.getloc())</TT> is true for the next available input 
  character c.</P></BLOCKQUOTE>
<HR>
<A name=91>
<H3>91.&nbsp;Description of operator&gt;&gt; and getline() for string&lt;&gt; 
might cause endless loop</H3></A>
<P><B>Section:</B>&nbsp;21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>Operator &gt;&gt; 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() ? </P>
<P><B>Proposed resolution:</B></P>
<P>In 21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>, 
paragraph 1, replace:</P>
<BLOCKQUOTE>Effects: Begins by constructing a sentry object k as if k were 
  constructed by typename basic_istream&lt;charT,traits&gt;::sentry k( is). If 
  bool( k) is true, it 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 number n of characters appended is is.width(); 
  otherwise n is str.max_size(). Characters are extracted and appended until any 
  of the following occurs: </BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE>Effects: Behaves as a formatted input function (27.6.1.2.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.reqmts">[lib.istream.formatted.reqmts]</A>). 
  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 
  number n of characters appended is is.width(); otherwise n is str.max_size(). 
  Characters are extracted and appended until any of the following occurs: 
</BLOCKQUOTE>
<P>In 21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>, 
paragraph 6, replace</P>
<BLOCKQUOTE>Effects: Begins by constructing a sentry object k as if by 
  typename basic_istream&lt;charT,traits&gt;::sentry k( is, true). If bool( k) 
  is true, it calls str.erase() and then extracts characters from is and appends 
  them to str as if by calling str.append(1, c) until any of the following 
  occurs: </BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE>Effects: Behaves as an unformatted input function (27.6.1.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>), 
  except that it does not affect the value returned by subsequent calls to 
  basic_istream&lt;&gt;::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 str as if by calling str.append(1,c) until any of the 
  following occurs: </BLOCKQUOTE>
<P><I>[Redmond: Made changes in proposed resolution. <TT>operator&gt;&gt;</TT> 
should be a formatted input function, not an unformatted input function. 
<TT>getline</TT> should not be required to set <TT>gcount</TT>, since there is 
no mechanism for <TT>gcount</TT> to be set except by one of 
<TT>basic_istream</TT>'s member functions.]</I></P>
<P><I>[Curaao: Nico agrees with proposed resolution.]</I></P>
<P><B>Rationale:</B></P>
<P>The real issue here is whether or not these string input functions get their 
characters from a streambuf, rather than by calling an istream's member 
functions, a streambuf signals failure either by 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.</P>
<HR>
<A name=92>
<H3>92.&nbsp;Incomplete Algorithm Requirements</H3></A>
<P><B>Section:</B>&nbsp;25 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.algorithms">[lib.algorithms]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;29 Sep 1998</P>
<P>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: </P><PRE>class Nth {    // function object that returns true for the nth element 
  private: 
    int nth;     // element to return true for 
    int count;   // element counter 
  public: 
    Nth (int n) : nth(n), count(0) { 
    } 
    bool operator() (int) { 
        return ++count == nth; 
    } 
}; 
.... 
// remove third element 
    list&lt;int&gt;::iterator pos; 
    pos = remove_if(coll.begin(),coll.end(),  // range 
                    Nth(3)),                  // remove criterion 
    coll.erase(pos,coll.end()); </PRE>
<P>This call, in fact removes the 3rd <B>AND the 6th</B> element. This happens 
because the usual implementation of the algorithm copies the function object 
internally: </P><PRE>template &lt;class ForwIter, class Predicate&gt; 
ForwIter std::remove_if(ForwIter beg, ForwIter end, Predicate op) 
{ 
    beg = find_if(beg, end, op); 
    if (beg == end) { 
        return beg; 
    } 
    else { 
        ForwIter next = beg; 
        return remove_copy_if(++next, end, beg, op); 
    } 
} </PRE>
<P>The algorithm uses find_if() to find the first element that should be 
removed. However, it then uses a copy of the passed function object to process 
the resulting elements (if any). Here, Nth is used again and removes also the 
sixth element. This behavior compromises the advantage of function objects being 
able to have a state. Without any cost it could be avoided (just implement it 
directly instead of calling find_if()). </P>
<P><B>Proposed resolution:</B></P>
<P>Add a new paragraph following 25 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.algorithms">[lib.algorithms]</A> 
paragraph 8:</P>
<BLOCKQUOTE>[Note: Unless otherwise specified, algorithms that take function 
  objects as arguments are permitted to copy those function objects freely. 
  Programmers for whom object identity is important should consider using a 
  wrapper class that points to a noncopied implementation object, or some 
  equivalent solution.] </BLOCKQUOTE>
<P><I>[Dublin: Pete Becker felt that this may not be a defect, but rather 
something that programmers need to be educated about. There was discussion of 
adding wording to the effect that the number and order of calls to function 
objects, including predicates, not affect the behavior of the function 
object.]</I></P>
<P><I>[Pre-Kona: Nico comments: It seems the problem is that we don't have a 
clear statement of "predicate" in the standard. People including me seemed to 
think "a function returning a Boolean value and being able to be called by an 
STL algorithm or be used as sorting criterion or ... is a predicate". But a 
predicate has more requirements: It should never change its behavior due to a 
call or being copied. IMHO we have to state this in the standard. If you like, 
see section 8.1.4 of my library book for a detailed discussion.]</I></P>
<P><I>[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".&nbsp; Consider placing in 25 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.algorithms">[lib.algorithms]</A> 
after paragraph 9.]</I></P>
<P><I>[Santa Cruz: The standard doesn't currently guarantee that functions 
object won't be copied, and what isn't forbidden is allowed. It is believed 
(especially since implementations that were written in concert with the standard 
do make copies of function objects) that this was intentional. Thus, no 
normative change is needed. What we should put in is a non-normative note 
suggesting to programmers that if they want to guarantee the lack of copying 
they should use something like the <TT>ref</TT> wrapper.]</I></P>
<P><I>[Oxford: Matt provided wording.]</I></P>
<HR>
<A name=98>
<H3>98.&nbsp;Input iterator requirements are badly written</H3></A>
<P><B>Section:</B>&nbsp;24.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.input.iterators">[lib.input.iterators]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;AFNOR&nbsp; <B>Date:</B>&nbsp;7 Oct 1998</P>
<P>Table 72 in 24.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.input.iterators">[lib.input.iterators]</A> 
specifies semantics for <TT>*r++</TT> of:</P>
<P>&nbsp;&nbsp; <TT>{ T tmp = *r; ++r; return tmp; }</TT></P>
<P>There are two problems with this. First, the return type is specified to be 
"T", as opposed to something like "convertible to T". This is too specific: we 
want to allow *r++ to return an lvalue.</P>
<P>Second, writing the semantics in terms of code misleadingly 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#334">334</A> 
for a similar problem.</P>
<P><B>Proposed resolution:</B></P>In Table 72 in 24.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.input.iterators">[lib.input.iterators]</A>, 
change the return type for <TT>*r++</TT> from <TT>T</TT> to "convertible to T". 
<P><B>Rationale:</B></P>
<P>This issue has two parts: the return type, and the number of times the copy 
constructor is invoked.</P>
<P>The LWG believes the the first part is a real issue. It's inappropriate for 
the return type to be specified so much more precisely for *r++ than it is for 
*r. In particular, if r is of (say) type <TT>int*</TT>, then *r++ isn't 
<TT>int</TT>, but <TT>int&amp;</TT>.</P>
<P>The LWG does not believe that the number of times the copy constructor is 
invoked is a real issue. This can vary in any case, because of language rules on 
copy constructor elision. That's too much to read into these semantics 
clauses.</P>
<P>Additionally, as Dave Abrahams pointed out (c++std-lib-13703): since we're 
told (24.1/3) that forward iterators satisfy all the requirements of input 
iterators, we can't impose any requirements in the Input Iterator requirements 
table that forward iterators don't satisfy.</P>
<HR>
<A name=103>
<H3>103.&nbsp;set::iterator is required to be modifiable, but this allows 
modification of keys</H3></A>
<P><B>Section:</B>&nbsp;23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;AFNOR&nbsp; <B>Date:</B>&nbsp;7 Oct 1998</P>
<P>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 iterator pointing to T.</P>
<P>23.1.2 paragraph 2 implies that the keys should not be modified to break the 
ordering of elements. But that is not clearly specified. Especially considering 
that the current standard requires that iterator for associative containers be 
different from const_iterator. Set, for example, has the following: </P>
<P><TT>typedef implementation defined 
iterator;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // See 
_lib.container.requirements_</TT></P>
<P>23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
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 significantly restrict the usage of associative 
container. A class to be used as elements of set, for example, can no longer be 
modified easily without either redesigning the class (using mutable on fields 
that have nothing to do with ordering), or using const_cast, which defeats 
requiring iterator to be const_iterator. The proposed solution goes in line with 
trusting user knows what he is doing. </P>
<P><B>Other Options Evaluated:</B> </P>
<P>Option A.&nbsp;&nbsp; In 23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>, 
paragraph 2, after first sentence, and before "In addition,...", add one line: 
</P>
<BLOCKQUOTE>
  <P>Modification of keys shall not change their strict weak ordering. 
</P></BLOCKQUOTE>
<P>Option B.&nbsp;Add three new sentences to 23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>:</P>
<BLOCKQUOTE>
  <P>At the end of paragraph 5: "Keys in an associative container are 
  immutable." At the end of paragraph 6: "For associative containers where the 
  value type is the same as the key type, both <TT>iterator</TT> and 
  <TT>const_iterator</TT> are constant iterators. It is unspecified whether or 
  not <TT>iterator</TT> and <TT>const_iterator</TT> are the same 
type."</P></BLOCKQUOTE>
<P>Option C.&nbsp;To 23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>, 
paragraph 3, which currently reads:</P>
<BLOCKQUOTE>
  <P>The phrase ``equivalence of keys'' means the equivalence relation imposed 
  by the comparison and not the operator== on keys. That is, two keys k1 and k2 
  in the same container are considered to be equivalent if for the comparison 
  object comp, comp(k1, k2) == false &amp;&amp; comp(k2, k1) == 
false.</P></BLOCKQUOTE>
<P>&nbsp; add the following:</P>
<BLOCKQUOTE>
  <P>For any two keys k1 and k2 in the same container, comp(k1, k2) shall return 
  the same value whenever it is evaluated. [Note: If k2 is removed from the 
  container and later reinserted, comp(k1, k2) must still return a consistent 
  value but this value may be different than it was the first time k1 and k2 
  were in the same container. This is intended to allow usage like a string key 
  that contains a filename, where comp compares file contents; if k2 is removed, 
  the file is changed, and the same k2 (filename) is reinserted, comp(k1, k2) 
  must again return a consistent value but this value may be different than it 
  was the previous time k2 was in the container.]</P></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Add the following to 23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A> 
at the indicated location:</P>
<BLOCKQUOTE>
  <P>At the end of paragraph 3: "For any two keys k1 and k2 in the same 
  container, calling comp(k1, k2) shall always return the same value."</P>
  <P>At the end of paragraph 5: "Keys in an associative container are 
  immutable."</P>
  <P>At the end of paragraph 6: "For associative containers where the value type 
  is the same as the key type, both <TT>iterator</TT> and 
  <TT>const_iterator</TT> are constant iterators. It is unspecified whether or 
  not <TT>iterator</TT> and <TT>const_iterator</TT> are the same 
type."</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Several arguments were advanced for and against allowing set elements to be 
mutable as long as the ordering was not effected. The argument which swayed the 
LWG was one of safety; if elements were mutable, there would be no compile-time 
way to detect of a simple user oversight which caused ordering to be modified. 
There was a report that this had actually happened in practice, and had been 
painful to diagnose. If users need to modify elements, it is possible to use 
mutable members or const_cast.</P>
<P>Simply requiring that keys be immutable is not sufficient, because the 
comparison object may indirectly (via pointers) operate on values outside of the 
keys.</P>
<P>The types <TT>iterator</TT> and <TT>const_iterator</TT> are permitted to be 
different types to allow for potential future work in which some member 
functions might be overloaded between the two types. No such member functions 
exist now, and the LWG believes that user functionality will not be impaired by 
permitting the two types to be the same. A function that operates on both 
iterator types can be defined for <TT>const_iterator</TT> alone, and can rely on 
the automatic conversion from <TT>iterator</TT> to <TT>const_iterator</TT>. </P>
<P><I>[Tokyo: The LWG crafted the proposed resolution and rationale.]</I></P>
<HR>
<A name=106>
<H3>106.&nbsp;Numeric library private members are implementation 
defined</H3></A>
<P><B>Section:</B>&nbsp;26.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.slice.array">[lib.template.slice.array]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;AFNOR&nbsp; <B>Date:</B>&nbsp;7 Oct 1998</P>
<P>This is the only place in the whole standard where the implementation has to 
document something private.</P>
<P><B>Proposed resolution:</B></P>
<P>Remove the comment which says "// remainder implementation defined" from: 
</P>
<UL>
  <LI>26.3.5 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.slice.array">[lib.template.slice.array]</A> 

  <LI>26.3.7 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.gslice.array">[lib.template.gslice.array]</A> 

  <LI>26.3.8 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.mask.array">[lib.template.mask.array]</A> 

  <LI>26.3.9 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.indirect.array">[lib.template.indirect.array]</A> 
  </LI></UL>
<HR>
<A name=108>
<H3>108.&nbsp;Lifetime of exception::what() return unspecified</H3></A>
<P><B>Section:</B>&nbsp;18.6.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.exception">[lib.exception]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;AFNOR&nbsp; <B>Date:</B>&nbsp;7 Oct 1998</P>
<P>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.</P>
<P><B>Proposed resolution:</B></P>
<P>Add to 18.6.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.exception">[lib.exception]</A> 
paragraph 9 (exception::what notes clause) the sentence:</P>
<BLOCKQUOTE>
  <P>The return value remains valid until the exception object from which it is 
  obtained is destroyed or a non-const member function of the exception object 
  is called.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>If an exception object has non-const members, they may be used to set 
internal state that should affect the contents of the string returned by 
<TT>what()</TT>. </P>
<HR>
<A name=109>
<H3>109.&nbsp;Missing binders for non-const sequence elements</H3></A>
<P><B>Section:</B>&nbsp;20.3.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.binders">[lib.binders]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Bjarne Stroustrup&nbsp; <B>Date:</B>&nbsp;7 Oct 1998</P>
<P>There are no versions of binders that apply to non-const elements of a 
sequence. This makes examples like for_each() using bind2nd() on page 521 of 
"The C++ Programming Language (3rd)" non-conforming. Suitable versions of the 
binders need to be added.</P>
<P>Further discussion from Nico:</P>
<P>What is probably meant here is shown in the following example:</P><PRE>class Elem { 
  public: 
    void print (int i) const { } 
    void modify (int i) { } 
}; </PRE><PRE>int main() 
{ 
    vector&lt;Elem&gt; coll(2); 
    for_each (coll.begin(), coll.end(), bind2nd(mem_fun_ref(&amp;Elem::print),42));    // OK 
    for_each (coll.begin(), coll.end(), bind2nd(mem_fun_ref(&amp;Elem::modify),42));   // ERROR 
}</PRE>
<P>The error results from the fact that bind2nd() passes its first argument (the 
argument of the sequence) as constant reference. See the following typical 
implementation:</P>
<BLOCKQUOTE><PRE>template &lt;class Operation&gt; 
class binder2nd 
  : public unary_function&lt;typename Operation::first_argument_type, 
                          typename Operation::result_type&gt; { 
protected: 
  Operation op; 
  typename Operation::second_argument_type value; 
public: 
  binder2nd(const Operation&amp; o, 
            const typename Operation::second_argument_type&amp; v) 
      : op(o), value(v) {} </PRE><PRE> typename Operation::result_type 
  operator()(const typename Operation::first_argument_type&amp; x) const { 
    return op(x, value); 
  } 
};</PRE></BLOCKQUOTE>
<P>The solution is to overload operator () of bind2nd for non-constant 
arguments:</P>
<BLOCKQUOTE><PRE>template &lt;class Operation&gt; 
class binder2nd 
  : public unary_function&lt;typename Operation::first_argument_type, 
                          typename Operation::result_type&gt; { 
protected: 
  Operation op; 
  typename Operation::second_argument_type value; 
public: 
  binder2nd(const Operation&amp; o, 
            const typename Operation::second_argument_type&amp; v) 
      : op(o), value(v) {} </PRE><PRE> typename Operation::result_type 
  operator()(const typename Operation::first_argument_type&amp; x) const { 
    return op(x, value); 
  } 
  typename Operation::result_type 
  operator()(typename Operation::first_argument_type&amp; x) const { 
    return op(x, value); 
  } 
};</PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P><B>Howard believes there is a flaw</B> in this resolution. See 
c++std-lib-9127. We may need to reopen this issue.</P>
<P>In 20.3.6.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.binder.1st">[lib.binder.1st]</A> 
in the declaration of binder1st after:</P>
<BLOCKQUOTE>
  <P><TT>typename Operation::result_type<BR>&nbsp;operator()(const typename 
  Operation::second_argument_type&amp; x) const;</TT></P></BLOCKQUOTE>
<P>insert:</P>
<BLOCKQUOTE>
  <P><TT>typename Operation::result_type<BR>&nbsp;operator()(typename 
  Operation::second_argument_type&amp; x) const;</TT></P></BLOCKQUOTE>
<P>In 20.3.6.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.binder.2nd">[lib.binder.2nd]</A> 
in the declaration of binder2nd after:</P>
<BLOCKQUOTE>
  <P><TT>typename Operation::result_type<BR>&nbsp;operator()(const typename 
  Operation::first_argument_type&amp; x) const;</TT></P></BLOCKQUOTE>
<P>insert:</P>
<BLOCKQUOTE>
  <P><TT>typename Operation::result_type<BR>&nbsp;operator()(typename 
  Operation::first_argument_type&amp; x) const;</TT></P></BLOCKQUOTE>
<P><I>[Kona: The LWG discussed this at some length.It was agreed that this is a 
mistake in the design, but there was no consensus on whether it was a defect in 
the Standard. Straw vote: NAD - 5. Accept proposed resolution - 3. Leave open - 
6.]</I></P>
<P><I>[Copenhagen: It was generally agreed that this was a defect. Strap poll: 
NAD - 0. Accept proposed resolution - 10. Leave open - 1.]</I></P>
<HR>
<A name=110>
<H3>110.&nbsp;istreambuf_iterator::equal not const</H3></A>
<P><B>Section:</B>&nbsp;24.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator">[lib.istreambuf.iterator]</A>, 
24.5.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator::equal">[lib.istreambuf.iterator::equal]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;15 Oct 1998</P>
<P>Member istreambuf_iterator&lt;&gt;::equal is not declared "const", yet 
24.5.3.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator::op==">[lib.istreambuf.iterator::op==]</A> 
says that operator==, which is const, calls it. This is contradictory. </P>
<P><B>Proposed resolution:</B></P>
<P>In 24.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator">[lib.istreambuf.iterator]</A> 
and also in 24.5.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istreambuf.iterator::equal">[lib.istreambuf.iterator::equal]</A>, 
replace:</P>
<BLOCKQUOTE><PRE>bool equal(istreambuf_iterator&amp; b);</PRE></BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE><PRE>bool equal(const istreambuf_iterator&amp; b) const;</PRE></BLOCKQUOTE>
<HR>
<A name=112>
<H3>112.&nbsp;Minor typo in <TT>ostreambuf_iterator</TT> constructor</H3></A>
<P><B>Section:</B>&nbsp;24.5.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.ostreambuf.iter.cons">[lib.ostreambuf.iter.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;20 Oct 1998</P>
<P>The <B>requires</B> clause for <TT>ostreambuf_iterator</TT>'s constructor 
from an <TT>ostream_type</TT> (24.5.4.1, paragraph 1) reads "<I>s</I> is not 
null". However, <I>s</I> is a reference, and references can't be null. </P>
<P><B>Proposed resolution:</B></P>
<P>In 24.5.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.ostreambuf.iter.cons">[lib.ostreambuf.iter.cons]</A>:</P>
<P>Move the current paragraph 1, which reads "Requires: s is not null.", from 
the first constructor to the second constructor.</P>
<P>Insert a new paragraph 1 Requires clause for the first constructor 
reading:</P>
<BLOCKQUOTE>
  <P><B>Requires</B>: <TT>s.rdbuf()</TT> is not null.</P></BLOCKQUOTE>
<HR>
<A name=114>
<H3>114.&nbsp;Placement forms example in error twice</H3></A>
<P><B>Section:</B>&nbsp;18.4.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.placement">[lib.new.delete.placement]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;28 Oct 1998</P>
<P>Section 18.4.1.3 contains the following example: </P><PRE>[Example: This can be useful for constructing an object at a known address:
        char place[sizeof(Something)];
        Something* p = new (place) Something();
 -end example]</PRE>
<P>First code line: "place" need not have any special alignment, and the 
following constructor could fail due to misaligned data.</P>
<P>Second code line: Aren't the parens on Something() incorrect?&nbsp; [Dublin: 
the LWG believes the () are correct.]</P>
<P>Examples are not normative, but nevertheless should not show code that is 
invalid or likely to fail.</P>
<P><B>Proposed resolution:</B></P>
<P>Replace the <U>first line of code</U> in the example in 18.4.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.placement">[lib.new.delete.placement]</A> 
with: </P>
<BLOCKQUOTE><PRE>void* place = operator new(sizeof(Something));</PRE></BLOCKQUOTE>
<HR>
<A name=115>
<H3>115.&nbsp;Typo in strstream constructors</H3></A>
<P><B>Section:</B>&nbsp;D.7.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstream.cons">[depr.strstream.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;2 Nov 1998</P>
<P>D.7.4.1 strstream constructors paragraph 2 says: </P>
<BLOCKQUOTE>
  <P>Effects: Constructs an object of class strstream, initializing the base 
  class with iostream(&amp; sb) and initializing sb with one of the two 
  constructors: </P>
  <P>- If mode&amp;app==0, then s shall designate the first element of an array 
  of n elements. The constructor is strstreambuf(s, n, s). </P>
  <P>- If mode&amp;app==0, then s shall designate the first element of an array 
  of n elements that contains an NTBS whose first element is designated by s. 
  The constructor is strstreambuf(s, n, s+std::strlen(s)).</P></BLOCKQUOTE>
<P>Notice the second condition is the same as the first. I think the second 
condition should be "If mode&amp;app==app", or "mode&amp;app!=0", meaning that 
the append bit is set.</P>
<P><B>Proposed resolution:</B></P>
<P>In D.7.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ostrstream.cons">[depr.ostrstream.cons]</A> 
paragraph 2 and D.7.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.strstream.cons">[depr.strstream.cons]</A> 
paragraph 2, change the first condition to <TT>(mode&amp;app)==0</TT> and the 
second condition to <TT>(mode&amp;app)!=0</TT>.</P>
<HR>
<A name=117>
<H3>117.&nbsp;<TT>basic_ostream</TT> uses nonexistent <TT>num_put</TT> member 
functions</H3></A>
<P><B>Section:</B>&nbsp;27.6.2.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.inserters.arithmetic">[lib.ostream.inserters.arithmetic]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;20 Nov 1998</P>
<P>The <B>effects</B> clause for numeric inserters says that insertion of a 
value <TT>x</TT>, whose type is either <TT>bool</TT>, <TT>short</TT>, 
<TT>unsigned short</TT>, <TT>int</TT>, <TT>unsigned int</TT>, <TT>long</TT>, 
<TT>unsigned long</TT>, <TT>float</TT>, <TT>double</TT>, <TT>long double</TT>, 
or <TT>const void*</TT>, is delegated to <TT>num_put</TT>, and that insertion is 
performed as if through the following code fragment: </P><PRE>bool failed = use_facet&lt;
   num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt; 
   &gt;(getloc()).put(*this, *this, fill(), val). failed();</PRE>
<P>This doesn't work, because <TT>num_put&lt;&gt;</TT>::put is only overloaded 
for the types <TT>bool</TT>, <TT>long</TT>, <TT>unsigned long</TT>, 
<TT>double</TT>, <TT>long double</TT>, and <TT>const void*</TT>. That is, the 
code fragment in the standard is incorrect (it is diagnosed as ambiguous at 
compile time) for the types <TT>short</TT>, <TT>unsigned short</TT>, 
<TT>int</TT>, <TT>unsigned int</TT>, and <TT>float</TT>. </P>
<P>We must either add new member functions to <TT>num_put</TT>, or else change 
the description in <TT>ostream</TT> so that it only calls functions that are 
actually there. I prefer the latter. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace 27.6.2.5.2, paragraph 1 with the following: </P>
<BLOCKQUOTE>
  <P>The classes num_get&lt;&gt; and num_put&lt;&gt; handle locale&shy;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 formatting conversion occurs as 
  if it performed the following code fragment: </P><PRE>bool failed = use_facet&lt;
   num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
   &gt;(getloc()).put(*this, *this, fill(), val). failed();
</PRE>
  <P>When val is of type short the formatting conversion occurs as if it 
  performed the following code fragment: </P><PRE>ios_base::fmtflags baseflags = ios_base::flags() &amp; ios_base::basefield;
bool failed = use_facet&lt;
   num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
   &gt;(getloc()).put(*this, *this, fill(),
      baseflags == ios_base::oct || baseflags == ios_base::hex
         ? static_cast&lt;long&gt;(static_cast&lt;unsigned short&gt;(val))
         : static_cast&lt;long&gt;(val)). failed();
</PRE>
  <P>When val is of type int the formatting conversion occurs as if it performed 
  the following code fragment: </P><PRE>ios_base::fmtflags baseflags = ios_base::flags() &amp; ios_base::basefield;
bool failed = use_facet&lt;
   num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
   &gt;(getloc()).put(*this, *this, fill(),
      baseflags == ios_base::oct || baseflags == ios_base::hex
         ? static_cast&lt;long&gt;(static_cast&lt;unsigned int&gt;(val))
         : static_cast&lt;long&gt;(val)). failed();
</PRE>
  <P>When val is of type unsigned short or unsigned int the formatting 
  conversion occurs as if it performed the following code fragment: </P><PRE>bool failed = use_facet&lt;
   num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
   &gt;(getloc()).put(*this, *this, fill(), static_cast&lt;unsigned long&gt;(val)).
failed();
</PRE>
  <P>When val is of type float the formatting conversion occurs as if it 
  performed the following code fragment: </P><PRE>bool failed = use_facet&lt;
   num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
   &gt;(getloc()).put(*this, *this, fill(), static_cast&lt;double&gt;(val)).
failed();
</PRE></BLOCKQUOTE>
<P><I>[post-Toronto: This differs from the previous proposed resolution; PJP 
provided the new wording. The differences are in signed short and int 
output.]</I></P>
<P><B>Rationale:</B></P>
<P>The original proposed resolution was to cast int and short to long, unsigned 
int and unsigned short to unsigned long, and float to double, thus ensuring that 
we don't try to use nonexistent num_put&lt;&gt; member functions. The current 
proposed resolution is more 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.)</P>
<HR>
<A name=118>
<H3>118.&nbsp;<TT>basic_istream</TT> uses nonexistent <TT>num_get</TT> member 
functions</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.arithmetic">[lib.istream.formatted.arithmetic]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;20 Nov 1998</P>
<P>Formatted input is defined for the types <TT>short</TT>, <TT>unsigned 
short</TT>, <TT>int</TT>, <TT>unsigned int</TT>, <TT>long</TT>, <TT>unsigned 
long</TT>, <TT>float</TT>, <TT>double</TT>, <TT>long double</TT>, <TT>bool</TT>, 
and <TT>void*</TT>. According to section 27.6.1.2.2, formatted input of a value 
<TT>x</TT> is done as if by the following code fragment: </P><PRE>typedef num_get&lt; charT,istreambuf_iterator&lt;charT,traits&gt; &gt; numget; 
iostate err = 0; 
use_facet&lt; numget &gt;(loc).get(*this, 0, *this, err, val); 
setstate(err);</PRE>
<P>According to section 22.2.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.members">[lib.facet.num.get.members]</A>, 
however, <TT>num_get&lt;&gt;::get()</TT> is only overloaded for the types 
<TT>bool</TT>, <TT>long</TT>, <TT>unsigned short</TT>, <TT>unsigned int</TT>, 
<TT>unsigned long</TT>, <TT>unsigned long</TT>, <TT>float</TT>, <TT>double</TT>, 
<TT>long double</TT>, and <TT>void*</TT>. Comparing the lists from the two 
sections, we find that 27.6.1.2.2 is using a nonexistent function for types 
<TT>short</TT> and <TT>int</TT>. </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.arithmetic">[lib.istream.formatted.arithmetic]</A> 
Arithmetic Extractors, remove the two lines (1st and 3rd) which read:</P>
<BLOCKQUOTE><PRE>operator&gt;&gt;(short&amp; val);
...
operator&gt;&gt;(int&amp; val);</PRE></BLOCKQUOTE>
<P>And add the following at the end of that section (27.6.1.2.2) :</P>
<BLOCKQUOTE><PRE>operator&gt;&gt;(short&amp; val);</PRE>
  <P>The conversion occurs as if performed by the following code fragment (using 
  the same notation as for the preceding code fragment):</P><PRE>  typedef num_get&lt; charT,istreambuf_iterator&lt;charT,traits&gt; &gt; numget;
  iostate err = 0;
  long lval;
  use_facet&lt; numget &gt;(loc).get(*this, 0, *this, err, lval);
        if (err == 0
                &amp;&amp; (lval &lt; numeric_limits&lt;short&gt;::min() || numeric_limits&lt;short&gt;::max() &lt; lval))
                err = ios_base::failbit;
  setstate(err);</PRE><PRE>operator&gt;&gt;(int&amp; val);</PRE>
  <P>The conversion occurs as if performed by the following code fragment (using 
  the same notation as for the preceding code fragment):</P><PRE>  typedef num_get&lt; charT,istreambuf_iterator&lt;charT,traits&gt; &gt; numget;
  iostate err = 0;
  long lval;
  use_facet&lt; numget &gt;(loc).get(*this, 0, *this, err, lval);
        if (err == 0
                &amp;&amp; (lval &lt; numeric_limits&lt;int&gt;::min() || numeric_limits&lt;int&gt;::max() &lt; lval))
                err = ios_base::failbit;
  setstate(err);</PRE></BLOCKQUOTE>
<P><I>[Post-Tokyo: PJP provided the above wording.]</I></P>
<HR>
<A name=119>
<H3>119.&nbsp;Should virtual functions be allowed to strengthen the exception 
specification?</H3></A>
<P><B>Section:</B>&nbsp;17.4.4.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.res.on.exception.handling">[lib.res.on.exception.handling]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998</P>
<P>Section 17.4.4.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.res.on.exception.handling">[lib.res.on.exception.handling]</A> 
states: </P>
<P>"An implementation may strengthen the exception-specification for a function 
by removing listed exceptions." </P>
<P>The problem is that if an implementation is allowed to do this for virtual 
functions, then a library user cannot write a class that portably derives from 
that class. </P>
<P>For example, this would not compile if ios_base::failure::~failure had an 
empty exception specification: </P><PRE>#include &lt;ios&gt;
#include &lt;string&gt;

class D : public std::ios_base::failure {
public:
        D(const std::string&amp;);
        ~D(); // error - exception specification must be compatible with 
              // overridden virtual function ios_base::failure::~failure()
};</PRE>
<P><B>Proposed resolution:</B></P>
<P>Change Section 17.4.4.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.res.on.exception.handling">[lib.res.on.exception.handling]</A> 
from:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; "may strengthen the exception-specification for a 
function"</P>
<P>to:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; "may strengthen the exception-specification for a 
non-virtual function". </P>
<HR>
<A name=120>
<H3>120.&nbsp;Can an implementor add specializations?</H3></A>
<P><B>Section:</B>&nbsp;17.4.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.reserved.names">[lib.reserved.names]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998</P>
<P>The original issue asked whether a library implementor could specialize 
standard library templates for built-in types. (This was an issue because users 
are permitted to explicitly instantiate standard library templates.)</P>
<P>Specializations are no longer a problem, because of the resolution to core 
issue 259. Under the proposed resolution, it will be legal for a translation 
unit to contain both a specialization and an explicit instantiation of the same 
template, provided that the specialization comes first. In such a case, the 
explicit instantiation will be ignored. Further discussion of library issue 120 
assumes that the core 259 resolution will be adopted.</P>
<P>However, as noted in lib-7047, one piece of this issue still remains: what 
happens if a standard library implementor explicitly instantiates a standard 
library templates? It's illegal for a program to contain two different explicit 
instantiations of the same template for the same type in two different 
translation units (ODR violation), and the core working group doesn't believe it 
is practical to relax that restriction.</P>
<P>The issue, then, is: are users allowed to explicitly instantiate standard 
library templates for non-user defined types? The status quo answer is 'yes'. 
Changing it to 'no' would give library implementors more freedom.</P>
<P>This is an issue because, for performance reasons, library implementors often 
need to explicitly instantiate standard library templates. (for example, 
std::basic_string&lt;char&gt;) Does giving users freedom to explicitly 
instantiate standard library templates for non-user defined types make it 
impossible or painfully difficult for library implementors to do this?</P>
<P>John Spicer suggests, in lib-8957, that library implementors have a mechanism 
they can use for explicit instantiations that doesn't prevent users from 
performing their own explicit instantiations: put each explicit instantiation in 
its own object file. (Different solutions might be necessary for Unix DSOs or 
MS-Windows DLLs.) On some platforms, library implementors might not need to do 
anything special: the "undefined behavior" that results from having two 
different explicit instantiations might be harmless.</P>
<P><B>Proposed resolution:</B></P>
<P>Append to 17.4.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.reserved.names">[lib.reserved.names]</A> 
paragraph 1: </P>
<BLOCKQUOTE>A program may explicitly instantiate any templates in the standard 
  library only if the declaration depends on the name of a user-defined type of 
  external linkage and the instantiation meets the standard library requirements 
  for the original template. </BLOCKQUOTE>
<P><I>[Kona: changed the wording from "a user-defined name" to "the name of a 
user-defined type"]</I></P>
<P><B>Rationale:</B></P>
<P>The LWG considered another possible resolution:</P>
<BLOCKQUOTE>
  <P>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 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.reserved.names">[lib.reserved.names]</A> 
  paragraph 1:</P>
  <BLOCKQUOTE>[<I>Note:</I> A program may explicitly instantiate standard 
    library templates, even when an explicit instantiation does not depend on a 
    user-defined name. <I>--end note</I>] </BLOCKQUOTE></BLOCKQUOTE>
<P>The LWG rejected this because it was believed that it would make it 
unnecessarily difficult for library implementors to write high-quality 
implementations. A program may not include an explicit instantiation of the same 
template, for the same template arguments, in two different translation units. 
If users are allowed to provide explicit instantiations of Standard Library 
templates for built-in types, then library implementors aren't, at least not 
without nonportable tricks.</P>
<P>The most serious problem is a class template that has writeable static member 
variables. Unfortunately, such class templates are important and, in existing 
Standard Library implementations, are often explicitly specialized by library 
implementors: locale facets, which have a writeable static member variable 
<TT>id</TT>. If a user's explicit instantiation collided with the 
implementations explicit instantiation, iostream initialization could cause 
locales to be constructed in an inconsistent state.</P>
<P>One proposed implementation technique was for Standard Library implementors 
to provide explicit instantiations in separate object files, so that they would 
not be picked up by the linker when the user also provides an explicit 
instantiation. However, this technique only applies for Standard Library 
implementations that are packaged as static archives. Most Standard Library 
implementations nowadays are packaged as dynamic libraries, so this technique 
would not apply.</P>
<P>The Committee is now considering standardization of dynamic linking. If there 
are such changes in the future, it may be appropriate to revisit this issue 
later.</P>
<HR>
<A name=122>
<H3>122.&nbsp;streambuf/wstreambuf description should not say they are 
specializations</H3></A>
<P><B>Section:</B>&nbsp;27.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf">[lib.streambuf]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998</P>
<P>Section 27.5.2 describes the streambuf classes this way: </P>
<BLOCKQUOTE>
  <P>The class streambuf is a specialization of the template class 
  basic_streambuf specialized for the type char. </P>
  <P>The class wstreambuf is a specialization of the template class 
  basic_streambuf specialized for the type wchar_t. </P></BLOCKQUOTE>
<P>This implies that these classes must be template specializations, not 
typedefs. </P>
<P>It doesn't seem this was intended, since Section 27.5 has them declared as 
typedefs. </P>
<P><B>Proposed resolution:</B></P>
<P>Remove 27.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf">[lib.streambuf]</A> 
paragraphs 2 and 3 (the above two sentences). </P>
<P><B>Rationale:</B></P>
<P>The <TT>streambuf</TT> synopsis already has a declaration for the typedefs 
and that is sufficient. </P>
<HR>
<A name=123>
<H3>123.&nbsp;Should valarray helper arrays fill functions be const?</H3></A>
<P><B>Section:</B>&nbsp;26.3.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.slice.arr.fill">[lib.slice.arr.fill]</A>, 
26.3.7.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.gslice.array.fill">[lib.gslice.array.fill]</A>, 
26.3.8.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.mask.array.fill">[lib.mask.array.fill]</A>, 
26.3.9.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.indirect.array.fill">[lib.indirect.array.fill]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998 </P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.slice.arr.assign">[lib.slice.arr.assign]</A> 
is const: </P>
<P>&nbsp;&nbsp;&nbsp; <TT>void operator=(const valarray&lt;T&gt;&amp;) 
const;</TT> </P>
<P>but this one in Section 26.3.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.slice.arr.fill">[lib.slice.arr.fill]</A> 
is not: </P>
<P>&nbsp;&nbsp;&nbsp; <TT>void operator=(const T&amp;); </TT></P>
<P>The description of the semantics for these two functions is similar. </P>
<P><B>Proposed resolution:</B></P>
<P>26.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.slice.array">[lib.template.slice.array]</A> 
Template class slice_array</P>
<BLOCKQUOTE>
  <P>In the class template definition for slice_array, replace the member 
  function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>with</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.slice.arr.fill">[lib.slice.arr.fill]</A> 
slice_array fill function</P>
<BLOCKQUOTE>
  <P>Change the function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>to</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.gslice.array">[lib.template.gslice.array]</A> 
Template class gslice_array</P>
<BLOCKQUOTE>
  <P>In the class template definition for gslice_array, replace the member 
  function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>with</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.7.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.gslice.array.fill">[lib.gslice.array.fill]</A> 
gslice_array fill function</P>
<BLOCKQUOTE>
  <P>Change the function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>to</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.mask.array">[lib.template.mask.array]</A> 
Template class mask_array</P>
<BLOCKQUOTE>
  <P>In the class template definition for mask_array, replace the member 
  function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>with</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.8.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.mask.array.fill">[lib.mask.array.fill]</A> 
mask_array fill function</P>
<BLOCKQUOTE>
  <P>Change the function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>to</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.indirect.array">[lib.template.indirect.array]</A> 
Template class indirect_array</P>
<BLOCKQUOTE>
  <P>In the class template definition for indirect_array, replace the member 
  function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>with</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P>26.3.9.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.indirect.array.fill">[lib.indirect.array.fill]</A> 
indirect_array fill function</P>
<BLOCKQUOTE>
  <P>Change the function declaration</P><PRE>      void operator=(const T&amp;);
    </PRE>
  <P>to</P><PRE>      void operator=(const T&amp;) const;
    </PRE></BLOCKQUOTE>
<P><I>[Redmond: Robert provided wording.]</I></P>
<P><B>Rationale:</B></P>
<P>There's no good reason for one version of operator= being const and another 
one not. Because of issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#253">253</A>, 
this now matters: these functions are now callable in more circumstances. In 
many existing implementations, both versions are already const.</P>
<HR>
<A name=124>
<H3>124.&nbsp;ctype_byname&lt;charT&gt;::do_scan_is &amp; do_scan_not return 
type should be const charT*</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname">[lib.locale.ctype.byname]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998</P>
<P>In Section 22.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname">[lib.locale.ctype.byname]</A> 
ctype_byname&lt;charT&gt;::do_scan_is() and do_scan_not() are declared to return 
a const char* not a const charT*. </P>
<P><B>Proposed resolution:</B></P>
<P>Change Section 22.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname">[lib.locale.ctype.byname]</A> 
<TT>do_scan_is()</TT> and <TT>do_scan_not()</TT> to return a <TT>const 
charT*</TT>. </P>
<HR>
<A name=125>
<H3>125.&nbsp;valarray&lt;T&gt;::operator!() return type is 
inconsistent</H3></A>
<P><B>Section:</B>&nbsp;26.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.valarray">[lib.template.valarray]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998</P>
<P>In Section 26.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.valarray">[lib.template.valarray]</A> 
valarray&lt;T&gt;::operator!() is declared to return a valarray&lt;T&gt;, but in 
Section 26.3.2.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.valarray.unary">[lib.valarray.unary]</A> 
it is declared to return a valarray&lt;bool&gt;. The latter appears to be 
correct. </P>
<P><B>Proposed resolution:</B></P>
<P>Change in Section 26.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.valarray">[lib.template.valarray]</A> 
the declaration of <TT>operator!()</TT> so that the return type is 
<TT>valarray&lt;bool&gt;</TT>. </P>
<HR>
<A name=126>
<H3>126.&nbsp;typos in Effects clause of ctype::do_narrow()</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.virtuals">[lib.locale.ctype.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;15 Dec 1998</P>
<P>Typos in 22.2.1.1.2 need to be fixed.</P>
<P><B>Proposed resolution:</B></P>
<P>In Section 22.2.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.virtuals">[lib.locale.ctype.virtuals]</A> 
change: </P><PRE>   do_widen(do_narrow(c),0) == c</PRE>
<P>to:</P><PRE>   do_widen(do_narrow(c,0)) == c</PRE>
<P>and change:</P><PRE>   (is(M,c) || !ctc.is(M, do_narrow(c),dfault) )</PRE>
<P>to:</P><PRE>   (is(M,c) || !ctc.is(M, do_narrow(c,dfault)) )</PRE>
<HR>
<A name=127>
<H3>127.&nbsp;auto_ptr&lt;&gt; conversion issues</H3></A>
<P><B>Section:</B>&nbsp;20.4.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.auto.ptr">[lib.auto.ptr]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Greg Colvin&nbsp; <B>Date:</B>&nbsp;17 Feb 1999</P>
<P>There are two problems with the current <TT>auto_ptr</TT> wording in the 
standard: </P>
<P>First, the <TT>auto_ptr_ref</TT> definition cannot be nested because 
<TT>auto_ptr&lt;Derived&gt;::auto_ptr_ref</TT> is unrelated to 
<TT>auto_ptr&lt;Base&gt;::auto_ptr_ref</TT>. <I>Also submitted by Nathan Myers, 
with the same proposed resolution.</I></P>
<P>Second, there is no <TT>auto_ptr</TT> assignment operator taking an 
<TT>auto_ptr_ref</TT> argument. </P>
<P>I have discussed these problems with my proposal coauthor, Bill Gibbons, and 
with some compiler and library implementors, and we believe that these problems 
are not desired or desirable implications of the standard. </P>
<P>25 Aug 1999: The proposed resolution now reflects changes suggested by Dave 
Abrahams, with Greg Colvin's concurrence; 1) changed "assignment operator" to 
"public assignment operator", 2) changed effects to specify use of release(), 3) 
made the conversion to auto_ptr_ref const. </P>
<P>2 Feb 2000: Lisa Lippincott comments: [The resolution of] this issue states 
that the conversion from auto_ptr to auto_ptr_ref should be const. This is not 
acceptable, because it would allow initialization and assignment from _any_ 
const auto_ptr! It also introduces an implementation difficulty in writing this 
conversion function -- namely, somewhere along the line, a const_cast will be 
necessary to remove that const so that release() may be called. This may result 
in undefined behavior [7.1.5.1/4]. The conversion operator does not have to be 
const, because a non-const implicit object parameter may be bound to an rvalue 
[13.3.3.1.4/3] [13.3.1/5]. </P>
<P>Tokyo: The LWG removed the following from the proposed resolution:</P>
<P>In 20.4.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.auto.ptr">[lib.auto.ptr]</A>, 
paragraph 2, and 20.4.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.auto.ptr.conv">[lib.auto.ptr.conv]</A>, 
paragraph 2, make the conversion to auto_ptr_ref const:</P>
<BLOCKQUOTE><PRE>template&lt;class Y&gt; operator auto_ptr_ref&lt;Y&gt;() const throw();</PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>In 20.4.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.auto.ptr">[lib.auto.ptr]</A>, 
paragraph 2, move the <TT>auto_ptr_ref</TT> definition to namespace scope.</P>
<P>In 20.4.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.auto.ptr">[lib.auto.ptr]</A>, 
paragraph 2, add a public assignment operator to the <TT>auto_ptr</TT> 
definition: </P>
<BLOCKQUOTE><PRE>auto_ptr&amp; operator=(auto_ptr_ref&lt;X&gt; r) throw();</PRE></BLOCKQUOTE>
<P>Also add the assignment operator to 20.4.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.auto.ptr.conv">[lib.auto.ptr.conv]</A>: 
</P>
<BLOCKQUOTE><PRE>auto_ptr&amp; operator=(auto_ptr_ref&lt;X&gt; r) throw()</PRE><B>Effects:</B> 
  Calls <TT>reset(p.release())</TT> for the <TT>auto_ptr p</TT> that <TT>r</TT> 
  holds a reference to.<BR><B>Returns: </B><TT>*this</TT>. </BLOCKQUOTE>
<HR>
<A name=129>
<H3>129.&nbsp;Need error indication from seekp() and seekg()</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>, 
27.6.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.seeks">[lib.ostream.seeks]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;22 Feb 1999</P>
<P>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 stream. Hence, it is 
undefined what happens if they fail. And they <I>can</I> fail, for instance, 
when a file stream is disconnected from the underlying file (is_open()==false) 
or when a wide character file stream must perform a state-dependent code 
conversion, etc. </P>
<P>The stream functions seekg() and seekp() should set failbit in the stream 
state in case of failure.</P>
<P><B>Proposed resolution:</B></P>
<P>Add to the Effects: clause of&nbsp; seekg() in 27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A> 
and to the Effects: clause of seekp() in 27.6.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.seeks">[lib.ostream.seeks]</A>: 
</P>
<BLOCKQUOTE>
  <P>In case of failure, the function calls <TT>setstate(failbit)</TT> (which 
  may throw <TT>ios_base::failure</TT>). </P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Setting failbit is the usual error reporting mechanism for streams</P>
<HR>
<A name=132>
<H3>132.&nbsp;list::resize description uses random access iterators</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.capacity">[lib.list.capacity]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;6 Mar 1999</P>
<P>The description reads:</P>
<P>-1- Effects:</P><PRE>         if (sz &gt; size())
           insert(end(), sz-size(), c);
         else if (sz &lt; size())
           erase(begin()+sz, end());
         else
           ;                           //  do nothing</PRE>
<P>Obviously list::resize should not be specified in terms of random access 
iterators.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 23.2.2.2 paragraph 1 to:</P>
<P>Effects:</P><PRE>         if (sz &gt; size())
           insert(end(), sz-size(), c);
         else if (sz &lt; size())
         {
           iterator i = begin();
           advance(i, sz);
           erase(i, end());
         }</PRE>
<P><I>[Dublin: The LWG asked Howard to discuss exception safety offline with 
David Abrahams. They had a discussion and believe there is no issue of exception 
safety with the proposed resolution.]</I></P>
<HR>
<A name=133>
<H3>133.&nbsp;map missing get_allocator()</H3></A>
<P><B>Section:</B>&nbsp;23.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.map">[lib.map]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;6 Mar 1999</P>
<P>The title says it all.</P>
<P><B>Proposed resolution:</B></P>
<P>Insert in 23.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.map">[lib.map]</A>, 
paragraph 2, after operator= in the map declaration:</P><PRE>    allocator_type get_allocator() const;</PRE>
<HR>
<A name=134>
<H3>134.&nbsp;vector constructors over specified</H3></A>
<P><B>Section:</B>&nbsp;23.2.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.cons">[lib.vector.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;6 Mar 1999</P>
<P>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 
...".</P>
<P>This appears to be overly restrictive, dictating the precise 
memory/performance tradeoff for the implementor.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 23.2.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.cons">[lib.vector.cons]</A>, 
paragraph 1 to:</P>
<P>-1- Complexity: The constructor template &lt;class InputIterator&gt; 
vector(InputIterator first, InputIterator last) makes only N calls to the copy 
constructor of T (where N is the distance between first and last) and no 
reallocations if iterators first and last are of forward, bidirectional, or 
random access categories. It makes order N calls to the copy constructor of T 
and order logN reallocations if they are just input iterators. </P>
<P><B>Rationale:</B></P>
<P>"at most 2N calls" is correct only if the growth factor is greater than or 
equal to 2. </P>
<HR>
<A name=136>
<H3>136.&nbsp;seekp, seekg setting wrong streams?</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;6 Mar 1999</P>
<P>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 that's really the intent, I 
withdraw this proposal.</P>
<P><B>Proposed resolution:</B></P>
<P>In section 27.6.1.3 change:</P><PRE>basic_istream&lt;charT,traits&gt;&amp; seekg(pos_type pos);
Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos). </PRE>
<P>To:</P><PRE>basic_istream&lt;charT,traits&gt;&amp; seekg(pos_type pos);
Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos, ios_base::in). </PRE>
<P>In section 27.6.1.3 change:</P><PRE>basic_istream&lt;charT,traits&gt;&amp; seekg(off_type&amp; off, ios_base::seekdir dir);
Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir). </PRE>
<P>To:</P><PRE>basic_istream&lt;charT,traits&gt;&amp; seekg(off_type&amp; off, ios_base::seekdir dir);
Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir, ios_base::in). </PRE>
<P>In section 27.6.2.4, paragraph 2 change:</P><PRE>-2- Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos). </PRE>
<P>To:</P><PRE>-2- Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos, ios_base::out). </PRE>
<P>In section 27.6.2.4, paragraph 4 change:</P><PRE>-4- Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir). </PRE>
<P>To:</P><PRE>-4- Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir, ios_base::out). </PRE>
<P><I>[Dublin: Dietmar Khl thinks this is probably correct, but would like the 
opinion of more iostream experts before taking action.]</I></P>
<P><I>[Tokyo: Reviewed by the LWG. PJP noted that although his docs are 
incorrect, his implementation already implements the Proposed 
Resolution.]</I></P>
<P><I>[Post-Tokyo: Matt Austern comments:<BR>Is it a problem with basic_istream 
and basic_ostream, or is it a problem with basic_stringbuf? We could resolve the 
issue either by changing basic_istream and basic_ostream, or by changing 
basic_stringbuf. I prefer the latter change (or maybe both changes): I don't see 
any reason for the standard to require that std::stringbuf s(std::string("foo"), 
std::ios_base::in); s.pubseekoff(0, std::ios_base::beg); must fail.<BR>This 
requirement is a bit weird. There's no similar requirement for 
basic_streambuf&lt;&gt;::seekpos, or for basic_filebuf&lt;&gt;::seekoff or 
basic_filebuf&lt;&gt;::seekpos.]</I></P>
<HR>
<A name=137>
<H3>137.&nbsp;Do use_facet and has_facet look in the global locale?</H3></A>
<P><B>Section:</B>&nbsp;22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;17 Mar 1999</P>
<P>Section 22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A> 
says:</P>
<P>-4- In the call to use_facet&lt;Facet&gt;(loc), the type argument chooses a 
facet, making available all members of the named type. If Facet is not present 
in a locale (or, failing that, in the global locale), it throws the standard 
exception bad_cast. A C++ program can check if a locale implements a particular 
facet with the template function has_facet&lt;Facet&gt;(). </P>
<P>This contradicts the specification given in section 22.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.global.templates">[lib.locale.global.templates]</A>: 
<BR><BR>template &lt;class&nbsp; Facet&gt; const&nbsp; Facet&amp; 
use_facet(const locale&amp;&nbsp; loc); <BR><BR>-1- Get a reference to a facet 
of a locale. <BR>-2- Returns: a reference to the corresponding facet of loc, if 
present. <BR>-3- Throws: bad_cast if has_facet&lt;Facet&gt;(loc) is false. 
<BR>-4- Notes: The reference returned remains valid at least as long as any copy 
of loc exists </P>
<P><B>Proposed resolution:</B></P>
<P>Remove the phrase "(or, failing that, in the global locale)" from section 
22.1.1. </P>
<P><B>Rationale:</B></P>
<P>Needed for consistency with the way locales are handled elsewhere in the 
standard.</P>
<HR>
<A name=139>
<H3>139.&nbsp;Optional sequence operation table description unclear</H3></A>
<P><B>Section:</B>&nbsp;23.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.sequence.reqmts">[lib.sequence.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrew Koenig&nbsp; <B>Date:</B>&nbsp;30 Mar 1999</P>
<P>The sentence introducing the Optional sequence operation table (23.1.1 
paragraph 12) has two problems:</P>
<P>A. It says ``The operations in table 68 are provided only for the containers 
for which they take constant time.''<BR><BR>That could be interpreted in two 
ways, one of them being ``Even though table 68 shows particular operations as 
being provided, implementations are free to omit them if they cannot implement 
them in constant time.''<BR><BR>B. That paragraph says nothing about amortized 
constant time, and it should.&nbsp;</P>
<P><B>Proposed resolution:</B></P>
<P>Replace the wording in 23.1.1 paragraph 12&nbsp; which begins ``The 
operations in table 68 are provided only..." with:</P>
<BLOCKQUOTE>
  <P>Table 68 lists sequence operations that are provided for some types of 
  sequential containers but not others. An implementation shall provide these 
  operations for all container types shown in the ``container'' column, and 
  shall implement them so as to take amortized constant time.</P></BLOCKQUOTE>
<HR>
<A name=141>
<H3>141.&nbsp;basic_string::find_last_of, find_last_not_of say pos instead of 
xpos</H3></A>
<P><B>Section:</B>&nbsp;21.3.6.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::find.last.of">[lib.string::find.last.of]</A>, 
21.3.6.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::find.last.not.of">[lib.string::find.last.not.of]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Arch Robison&nbsp; <B>Date:</B>&nbsp;28 Apr 1999</P>
<P>Sections 21.3.6.4 paragraph 1 and 21.3.6.6 paragraph 1 surely have misprints 
where they say:<BR><BR> <TT>xpos &lt;= pos</TT> and <TT>pos &lt; 
size();</TT></P>
<P>Surely the document meant to say ``<TT>xpos &lt; size()</TT>'' in both 
places.</P>
<P><I>[Judy Ward also sent in this issue for 21.3.6.4 with the same proposed 
resolution.]</I></P>
<P><B>Proposed resolution:</B></P>
<P>Change Sections 21.3.6.4 paragraph 1 and 21.3.6.6 paragraph 1, the line which 
says:<BR><BR> <TT>xpos &lt;= pos</TT> and <TT>pos &lt; 
size();<BR><BR></TT>to:<BR><TT><BR></TT> <TT>xpos &lt;= pos</TT> and <TT>xpos 
&lt; size();</TT></P>
<HR>
<A name=142>
<H3>142.&nbsp;lexicographical_compare complexity wrong</H3></A>
<P><B>Section:</B>&nbsp;25.3.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.lex.comparison">[lib.alg.lex.comparison]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;20 Jun 1999</P>
<P>The lexicographical_compare complexity is specified 
as:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; "At most min((last1 - first1), (last2 - 
first2)) applications of the corresponding comparison."<BR><BR>The best I can do 
is twice that expensive.</P>
<P>Nicolai Josuttis comments in lib-6862: You mean, to check for equality you 
have to check both &lt; and &gt;? Yes, IMO you are right! (and Matt states this 
complexity in his book)</P>
<P><B>Proposed resolution:</B></P>
<P>Change 25.3.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.lex.comparison">[lib.alg.lex.comparison]</A> 
complexity to:</P>
<BLOCKQUOTE>At most <TT>2*min((last1 - first1), (last2 - first2))</TT> 
  applications of the corresponding comparison. </BLOCKQUOTE>
<P>Change the example at the end of paragraph 3 to read:</P>
<BLOCKQUOTE>[Example:<BR><BR>&nbsp;&nbsp;&nbsp; for ( ; first1 != last1 
  &amp;&amp; first2 != last2 ; ++first1, ++first2) 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (*first1 &lt; *first2) return 
  true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (*first2 &lt; *first1) return 
  false;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return first1 == last1 
  &amp;&amp; first2 != last2;<BR>&nbsp;&nbsp;&nbsp;<BR>--end example] 
</BLOCKQUOTE>
<HR>
<A name=144>
<H3>144.&nbsp;Deque constructor complexity wrong </H3></A>
<P><B>Section:</B>&nbsp;23.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.deque.cons">[lib.deque.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Herb Sutter&nbsp; <B>Date:</B>&nbsp;9 May 1999</P>
<P>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, 
below, was taken from vector:</P>
<BLOCKQUOTE>
  <P>Complexity: If the iterators first and last are forward iterators, 
  bidirectional iterators, or random access iterators the constructor makes only 
  N calls to the copy constructor, and performs no reallocations, where N is 
  last - first.</P></BLOCKQUOTE>
<P>The word "reallocations" does not really apply to deque. Further, all of the 
following appears to be spurious:</P>
<BLOCKQUOTE>
  <P>It makes at most 2N calls to the copy constructor of T and log N 
  reallocations if they are input iterators.1)</P>
  <P>1) The complexity is greater in the case of input iterators because each 
  element must be added individually: it is impossible to determine the distance 
  between first abd last before doing the copying.</P></BLOCKQUOTE>
<P>This makes perfect sense for vector, but not for deque. Why should deque gain 
an efficiency advantage from knowing in advance the number of elements to 
insert?</P>
<P><B>Proposed resolution:</B></P>
<P>In 23.2.1.1 paragraph 6, replace the Complexity description, including the 
footnote, with the following text (which also corrects the "abd" typo):</P>
<BLOCKQUOTE>
  <P>Complexity: Makes last - first calls to the copy constructor of 
T.</P></BLOCKQUOTE>
<HR>
<A name=146>
<H3>146.&nbsp;complex&lt;T&gt; Inserter and Extractor need sentries</H3></A>
<P><B>Section:</B>&nbsp;26.2.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.ops">[lib.complex.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;12 May 1999</P>
<P>The <U>extractor</U> for complex numbers is specified as:&nbsp;</P>
<BLOCKQUOTE>
  <P>template&lt;class T, class charT, class 
  traits&gt;&nbsp;<BR>basic_istream&lt;charT, 
  traits&gt;&amp;&nbsp;<BR>operator&gt;&gt;(basic_istream&lt;charT, 
  traits&gt;&amp; is, complex&lt;T&gt;&amp; x);<BR>&nbsp;<BR>Effects: Extracts a 
  complex number x of the form: u, (u), or (u,v), where u is the real part and v 
  is the imaginary part (lib.istream.formatted).&nbsp;<BR>Requires: The input 
  values be convertible to T. If bad input is encountered, calls 
  is.setstate(ios::failbit) (which may throw ios::failure 
  (lib.iostate.flags).&nbsp;<BR>Returns: is .</P></BLOCKQUOTE>
<P>Is it intended that the extractor for complex numbers does not skip 
whitespace, unlike all other extractors in the standard library do? Shouldn't a 
sentry be used?&nbsp;<BR><BR>The <U>inserter</U> for complex numbers is 
specified as:</P>
<BLOCKQUOTE>
  <P>template&lt;class T, class charT, class 
  traits&gt;&nbsp;<BR>basic_ostream&lt;charT, 
  traits&gt;&amp;&nbsp;<BR>operator&lt;&lt;(basic_ostream&lt;charT, 
  traits&gt;&amp; o, const complex&lt;T&gt;&amp; x);<BR><BR>Effects: inserts the 
  complex number x onto the stream o as if it were implemented as 
  follows:<BR><BR>template&lt;class T, class charT, class 
  traits&gt;&nbsp;<BR>basic_ostream&lt;charT, 
  traits&gt;&amp;&nbsp;<BR>operator&lt;&lt;(basic_ostream&lt;charT, 
  traits&gt;&amp; o, const complex&lt;T&gt;&amp; 
  x)&nbsp;<BR>{&nbsp;<BR>basic_ostringstream&lt;charT, traits&gt; 
  s;&nbsp;<BR>s.flags(o.flags());&nbsp;<BR>s.imbue(o.getloc());&nbsp;<BR>s.precision(o.precision());&nbsp;<BR>s 
  &lt;&lt; '(' &lt;&lt; x.real() &lt;&lt; "," &lt;&lt; x.imag() &lt;&lt; 
  ')';&nbsp;<BR>return o &lt;&lt; s.str();&nbsp;<BR>}</P></BLOCKQUOTE>
<P>Is it intended that the inserter for complex numbers ignores the field width 
and does not do any padding? If, with the suggested implementation above, the 
field width were set in the stream then the opening parentheses would be 
adjusted, but the rest not, because the field width is reset to zero after each 
insertion.</P>
<P>I think that both operations should use sentries, for sake of 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.&nbsp;</P>
<P><B>Proposed resolution:</B></P>
<P>After 26.2.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.complex.ops">[lib.complex.ops]</A> 
paragraph 14 (operator&gt;&gt;), add a Notes clause:</P>
<BLOCKQUOTE>
  <P>Notes: This extraction is performed as a series of simpler extractions. 
  Therefore, the skipping of whitespace is specified to be the same for each of 
  the simpler extractions.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>For extractors, the note is added to make it clear that skipping whitespace 
follows an "all-or-none" rule.</P>
<P>For inserters, the LWG believes there is no defect; the standard is correct 
as written.</P>
<HR>
<A name=147>
<H3>147.&nbsp;Library Intro refers to global functions that aren't 
global</H3></A>
<P><B>Section:</B>&nbsp;17.4.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.global.functions">[lib.global.functions]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Lois Goldthwaite&nbsp; <B>Date:</B>&nbsp;4 Jun 1999</P>
<P>The library had many global functions until 17.4.1.1 [lib.contents] paragraph 
2 was added: </P>
<BLOCKQUOTE>
  <P>All library entities except macros, operator new and operator delete are 
  defined within the namespace std or namespaces nested within namespace std. 
  </P></BLOCKQUOTE>
<P>It appears "global function" was never updated in the following: </P>
<BLOCKQUOTE>
  <P>17.4.4.3 - Global functions [lib.global.functions]<BR><BR>-1- It is 
  unspecified whether any global functions in the C++ Standard Library are 
  defined as inline (dcl.fct.spec).<BR><BR>-2- A call to a global function 
  signature described in Clauses lib.language.support through lib.input.output 
  behaves the same as if the implementation declares no additional global 
  function signatures.*<BR><BR>[Footnote: A valid C++ program always calls the 
  expected library global function. An implementation may also define additional 
  global functions that would otherwise not be called by a valid C++ program. 
  --- end footnote]<BR><BR>-3- A global function cannot be declared by the 
  implementation as taking additional default arguments.&nbsp;<BR><BR>17.4.4.4 - 
  Member functions [lib.member.functions]<BR><BR>-2- An implementation can 
  declare additional non-virtual member function signatures within a class: </P>
  <BLOCKQUOTE>
    <P>-- by adding arguments with default values to a member function 
    signature; The same latitude does not extend to the implementation of 
    virtual or global functions, however. </P></BLOCKQUOTE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Change "global" to "global or non-member" in:</P>
<BLOCKQUOTE>
  <P>17.4.4.3 [lib.global.functions] section title,<BR>17.4.4.3 
  [lib.global.functions] para 1,<BR>17.4.4.3 [lib.global.functions] para 2 in 2 
  places plus 2 places in the footnote,<BR>17.4.4.3 [lib.global.functions] para 
  3,<BR>17.4.4.4 [lib.member.functions] para 2</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Because operator new and delete are global, the proposed resolution was 
changed from "non-member" to "global or non-member. </P>
<HR>
<A name=148>
<H3>148.&nbsp;Functions in the example facet BoolNames should be const</H3></A>
<P><B>Section:</B>&nbsp;22.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facets.examples">[lib.facets.examples]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Jeremy Siek&nbsp; <B>Date:</B>&nbsp;3 Jun 1999</P>
<P>In 22.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facets.examples">[lib.facets.examples]</A> 
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&lt;char&gt; are const. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facets.examples">[lib.facets.examples]</A> 
paragraph 13, insert "const" in two places:</P>
<BLOCKQUOTE>
  <P><TT>string do_truename() const { return "Oui Oui!"; }<BR>string 
  do_falsename() const { return "Mais Non!"; }</TT></P></BLOCKQUOTE>
<HR>
<A name=150>
<H3>150.&nbsp;Find_first_of says integer instead of iterator </H3></A>
<P><B>Section:</B>&nbsp;25.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.find.first.of">[lib.alg.find.first.of]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt McClure&nbsp; <B>Date:</B>&nbsp;30 Jun 1999</P>
<P><B>Proposed resolution:</B></P>
<P>Change 25.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.find.first.of">[lib.alg.find.first.of]</A> 
paragraph 2 from:</P>
<BLOCKQUOTE>
  <P>Returns: The first iterator i in the range [first1, last1) such that for 
  some <U>integer</U> j in the range [first2, last2) ...</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Returns: The first iterator i in the range [first1, last1) such that for 
  some iterator j in the range [first2, last2) ...</P></BLOCKQUOTE>
<HR>
<A name=151>
<H3>151.&nbsp;Can't currently clear() empty container</H3></A>
<P><B>Section:</B>&nbsp;23.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.sequence.reqmts">[lib.sequence.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Ed Brey&nbsp; <B>Date:</B>&nbsp;21 Jun 1999</P>
<P>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 (23.1.1,3 and 23.1.2,7). When 
the container is empty, a.begin() is not dereferenceable.<BR><BR>The requirement 
that q1 be unconditionally dereferenceable causes many operations to be 
intuitively undefined, of which clearing an empty container is probably the most 
dire.<BR><BR>Since q1 and q2 are only referenced in the range [q1, q2), and [q1, 
q2) is required to be a valid range, stating that q1 and q2 must be iterators or 
certain kinds of iterators is unnecessary. </P>
<P><B>Proposed resolution:</B></P>
<P>In 23.1.1, paragraph 3, change:</P>
<BLOCKQUOTE>
  <P>p and q2 denote valid iterators to a, q <U>and q1</U> denote valid 
  dereferenceable iterators to a, [q1, q2) denotes a valid range</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>p denotes a valid iterator to a, q denotes a valid dereferenceable iterator 
  to a, [q1, q2) denotes a valid range<U> in a</U></P></BLOCKQUOTE>
<P>In 23.1.2, paragraph 7, change:</P>
<BLOCKQUOTE>
  <P>p and q2 are valid iterators to a, q <U>and q1</U> are valid 
  dereferenceable iterators to a, [q1, q2) is a valid range</P></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
  <P>p is a valid iterator to a, q is a valid dereferenceable iterator to a, 
  [q1, q2) is a valid range <U>into a</U></P></BLOCKQUOTE>
<HR>
<A name=152>
<H3>152.&nbsp;Typo in <TT>scan_is()</TT> semantics</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.virtuals">[lib.locale.ctype.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The semantics of <TT>scan_is()</TT> (paragraphs 4 and 6) is not exactly 
described because there is no function <TT>is()</TT> which only takes a 
character as argument. Also, in the effects clause (paragraph 3), the semantic 
is also kept vague.</P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.virtuals">[lib.locale.ctype.virtuals]</A> 
paragraphs 4 and 6, change the returns clause from:</P>
<BLOCKQUOTE>
  <P>"... such that <TT>is(*p)</TT> would..."</P></BLOCKQUOTE>
<P>to:&nbsp; "... such that <TT>is(m, *p)</TT> would...."</P>
<HR>
<A name=153>
<H3>153.&nbsp;Typo in <TT>narrow()</TT> semantics</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.ctype.char.members">[lib.facet.ctype.char.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The description of the array version of <TT>narrow()</TT> (in paragraph 11) 
is flawed: There is no member <TT>do_narrow()</TT> which takes only three 
arguments because in addition to the range a default character is needed.</P>
<P>Additionally, for both <TT>widen</TT> and <TT>narrow</TT> we have two 
signatures followed by a <B>Returns</B> clause that only addresses one of 
them.</P>
<P><B>Proposed resolution:</B></P>
<P>Change the returns clause in 22.2.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.ctype.char.members">[lib.facet.ctype.char.members]</A> 
paragraph 10 from:</P>
<P>&nbsp;&nbsp;&nbsp; Returns: do_widen(low, high, to).</P>
<P>to:</P>
<P>&nbsp;&nbsp;&nbsp; Returns: do_widen(c) or do_widen(low, high, to), 
respectively.</P>
<P>Change 22.2.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.ctype.char.members">[lib.facet.ctype.char.members]</A> 
paragraph 10 and 11 from:</P><PRE>        char        narrow(char c, char /*dfault*/) const;
        const char* narrow(const char* low, const char* high,
                           char /*dfault*/, char* to) const;</PRE><PRE>        Returns: do_narrow(low, high, to).</PRE>
<P>to:</P><PRE>        char        narrow(char c, char dfault) const;
        const char* narrow(const char* low, const char* high,
                           char dfault, char* to) const;</PRE><PRE>        Returns: do_narrow(c, dfault) or
                 do_narrow(low, high, dfault, to), respectively.</PRE>
<P><I>[Kona: 1) the problem occurs in additional places, 2) a user defined 
version could be different.]</I></P>
<P><I>[Post-Tokyo: Dietmar provided the above wording at the request of the LWG. 
He could find no other places the problem occurred. He asks for clarification of 
the Kona "a user defined version..." comment above. Perhaps it was a circuitous 
way of saying "dfault" needed to be uncommented?]</I></P>
<P><I>[Post-Toronto: the issues list maintainer has merged in the proposed 
resolution from issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#207">207</A>, 
which addresses the same paragraphs.]</I></P>
<HR>
<A name=154>
<H3>154.&nbsp;Missing <TT>double</TT> specifier for <TT>do_get()</TT> </H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The table in paragraph 7 for the length modifier does not list the length 
modifier <TT>l</TT> to be applied if the type is <TT>double</TT>. Thus, the 
standard asks the implementation to do undefined things when using 
<TT>scanf()</TT> (the missing length modifier for <TT>scanf()</TT> when scanning 
<TT>double</TT>s is actually a problem I found quite often in production code, 
too).</P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>, 
paragraph 7, add a row in the Length Modifier table to say that for 
<TT>double</TT> a length modifier <TT>l</TT> is to be used.</P>
<P><B>Rationale:</B></P>
<P>The standard makes an embarrassing beginner's mistake.</P>
<HR>
<A name=155>
<H3>155.&nbsp;Typo in naming the class defining the class <TT>Init</TT> 
</H3></A>
<P><B>Section:</B>&nbsp;27.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostream.objects">[lib.iostream.objects]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>There are conflicting statements about where the class <TT>Init</TT> is 
defined. According to 27.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostream.objects">[lib.iostream.objects]</A> 
paragraph 2 it is defined as <TT>basic_ios::Init</TT>, according to 27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A> 
it is defined as <TT>ios_base::Init</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostream.objects">[lib.iostream.objects]</A> 
paragraph 2 from "<TT>basic_ios::Init"</TT> to "<TT>ios_base::Init"</TT>.</P>
<P><B>Rationale:</B></P>
<P>Although not strictly wrong, the standard was misleading enough to warrant 
the change.</P>
<HR>
<A name=156>
<H3>156.&nbsp;Typo in <TT>imbue()</TT> description</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.locales">[lib.ios.base.locales]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>There is a small discrepancy between the declarations of <TT>imbue()</TT>: in 
27.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base">[lib.ios.base]</A> 
the argument is passed as <TT>locale const&amp;</TT> (correct), in 27.4.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.locales">[lib.ios.base.locales]</A> 
it is passed as <TT>locale const</TT> (wrong).</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.4.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.locales">[lib.ios.base.locales]</A> 
change the <TT>imbue</TT> argument from "<TT>locale const" to "locale 
const&amp;".</TT></P>
<HR>
<A name=158>
<H3>158.&nbsp;Underspecified semantics for <TT>setbuf()</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.5.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.buffer">[lib.streambuf.virt.buffer]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The default behavior of <TT>setbuf()</TT> is described only for the situation 
that <TT>gptr() != 0 &amp;&amp; gptr() != egptr()</TT>: namely to do nothing. 
What has to be done in other situations&nbsp; is not described although there is 
actually only one reasonable approach, namely to do nothing, too.</P>
<P>Since changing the buffer would almost certainly mess up most buffer 
management of derived classes unless these classes do it themselves, the default 
behavior of <TT>setbuf()</TT> should always be to do nothing.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.5.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.buffer">[lib.streambuf.virt.buffer]</A>, 
paragraph 3, Default behavior, to: "Default behavior: Does nothing. Returns 
this."</P>
<HR>
<A name=159>
<H3>159.&nbsp;Strange use of <TT>underflow()</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.5.2.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.get">[lib.streambuf.virt.get]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The description of the meaning of the result of <TT>showmanyc()</TT> seems to 
be rather strange: It uses calls to <TT>underflow()</TT>. Using 
<TT>underflow()</TT> is strange because this function only reads the current 
character but does not extract it, <TT>uflow()</TT> would extract the current 
character. This should be fixed to use <TT>sbumpc()</TT> instead.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.5.2.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.get">[lib.streambuf.virt.get]</A> 
paragraph 1, <TT>showmanyc()</TT>returns clause, by replacing the word 
"supplied" with the words "extracted from the stream".</P>
<HR>
<A name=160>
<H3>160.&nbsp;Typo: Use of non-existing function <TT>exception()</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.6.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream">[lib.istream]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The paragraph 4 refers to the function <TT>exception()</TT> which is not 
defined. Probably, the referred function is 
<TT>basic_ios&lt;&gt;::exceptions()</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream">[lib.istream]</A>, 
27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>, 
paragraph 1, 27.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream">[lib.ostream]</A>, 
paragraph 3, and 27.6.2.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.formatted.reqmts">[lib.ostream.formatted.reqmts]</A>, 
paragraph 1, change "<TT>exception()" to "exceptions()"</TT>.</P>
<P><I>[Note to Editor: "exceptions" with an "s" is the correct 
spelling.]</I></P>
<HR>
<A name=161>
<H3>161.&nbsp;Typo: <TT>istream_iterator</TT> vs. <TT>istreambuf_iterator</TT> 
</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.arithmetic">[lib.istream.formatted.arithmetic]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The note in the second paragraph pretends that the first argument is an 
object of type <TT>istream_iterator</TT>. This is wrong: It is an object of type 
<TT>istreambuf_iterator</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.6.1.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.arithmetic">[lib.istream.formatted.arithmetic]</A> 
from:</P>
<BLOCKQUOTE>
  <P>The first argument provides an object of the istream_iterator 
class...</P></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
  <P>The first argument provides an object of the istreambuf_iterator 
  class...</P></BLOCKQUOTE>
<HR>
<A name=164>
<H3>164.&nbsp;do_put() has apparently unused fill argument</H3></A>
<P><B>Section:</B>&nbsp;22.2.5.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.put.virtuals">[lib.locale.time.put.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;23 Jul 1999</P>
<P>In 22.2.5.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.put.virtuals">[lib.locale.time.put.virtuals]</A> 
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 are accessible through the ios_base&amp; argument, such as the 
adjustment or the field width. Is strftime() supposed to use the fill character 
in any way? In any case, the specification of time_put.do_put() looks 
inconsistent to me.<BR><BR>Is the signature of do_put() wrong, or is the effects 
clause incomplete?</P>
<P><B>Proposed resolution:</B></P>
<P>Add the following note after 22.2.5.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.put.virtuals">[lib.locale.time.put.virtuals]</A> 
paragraph 2:</P>
<BLOCKQUOTE>
  <P>[Note: the <TT>fill</TT> argument may be used in the implementation-defined 
  formats, or by derivations. A space character is a reasonable default for this 
  argument. --end Note]</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG felt that while the normative text was correct, users need some 
guidance on what to pass for the <TT>fill</TT> argument since the standard 
doesn't say how it's used.</P>
<HR>
<A name=165>
<H3>165.&nbsp;<TT>xsputn()</TT>, <TT>pubsync()</TT> never called by 
<TT>basic_ostream</TT> members?</H3></A>
<P><B>Section:</B>&nbsp;27.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream">[lib.ostream]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>Paragraph 2 explicitly states that none of the <TT>basic_ostream</TT> 
functions falling into one of the groups "formatted output functions" and 
"unformatted output functions" calls any stream buffer function which might call 
a virtual function other than <TT>overflow()</TT>. Basically this is fine but 
this implies that <TT>sputn()</TT> (this function would call the virtual 
function <TT>xsputn()</TT>) is never called by any of the standard output 
functions. Is this really intended? At minimum it would be convenient to call 
<TT>xsputn()</TT> for strings... Also, the statement that <TT>overflow()</TT> is 
the only virtual member of <TT>basic_streambuf</TT> called is in conflict with 
the definition of <TT>flush()</TT> which calls <TT>rdbuf()-&gt;pubsync()</TT> 
and thereby the virtual function <TT>sync()</TT> (<TT>flush()</TT> is listed 
under "unformatted output functions").</P>
<P>In addition, I guess that the sentence starting with "They may use other 
public members of <TT>basic_ostream</TT> ..." probably was intended to start 
with "They may use other public members of <TT>basic_streamuf</TT>..." although 
the problem with the virtual members exists in both cases.</P>
<P>I see two obvious resolutions:</P>
<OL>
  <LI>state in a footnote that this means that <TT>xsputn()</TT> will never be 
  called by any ostream member and that this is intended. 
  <LI>relax the restriction and allow calling <TT>overflow()</TT> and 
  <TT>xsputn()</TT>. Of course, the problem with <TT>flush()</TT> has to be 
  resolved in some way. </LI></OL>
<P><B>Proposed resolution:</B></P>
<P>Change the last sentence of 27.6.2.1 (lib.ostream) paragraph 2 from:</P>
<BLOCKQUOTE>
  <P>They may use other public members of basic_ostream except that they do not 
  invoke any virtual members of rdbuf() except overflow().</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>They may use other public members of basic_ostream except that they shall 
  not invoke any virtual members of rdbuf() except overflow(), xsputn(), and 
  sync().</P></BLOCKQUOTE>
<P><I>[Kona: the LWG believes this is a problem. Wish to ask Jerry or PJP why 
the standard is written this way.]</I></P>
<P><I>[Post-Tokyo: Dietmar supplied wording at the request of the LWG. He 
comments: The rules can be made a little bit more specific if necessary be 
explicitly spelling out what virtuals are allowed to be called from what 
functions and eg to state specifically that flush() is allowed to call sync() 
while other functions are not.]</I></P>
<HR>
<A name=167>
<H3>167.&nbsp;Improper use of <TT>traits_type::length()</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.6.2.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.inserters.character">[lib.ostream.inserters.character]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>Paragraph 4 states that the length is determined using 
<TT>traits::length(s)</TT>. Unfortunately, this function is not defined for 
example if the character type is <TT>wchar_t</TT> and the type of <TT>s</TT> is 
<TT>char const*</TT>. Similar problems exist if the character type is 
<TT>char</TT> and the type of <TT>s</TT> is either <TT>signed char const*</TT> 
or <TT>unsigned char const*</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 27.6.2.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.inserters.character">[lib.ostream.inserters.character]</A> 
paragraph 4 from:</P>
<BLOCKQUOTE>
  <P>Effects: Behaves like an formatted inserter (as described in 
  lib.ostream.formatted.reqmts) of out. After a sentry object is constructed it 
  inserts characters. The number of characters starting at s to be inserted is 
  traits::length(s). Padding is determined as described in 
  lib.facet.num.put.virtuals. The traits::length(s) characters starting at s are 
  widened using out.widen (lib.basic.ios.members). The widened characters and 
  any required padding are inserted into out. Calls width(0).</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Effects: Behaves like a formatted inserter (as described in 
  lib.ostream.formatted.reqmts) of out. After a sentry object is constructed it 
  inserts <I>n</I> characters starting at <I>s</I>, where <I>n</I> is the number 
  that would be computed as if by:</P>
  <UL>
    <LI>traits::length(s) for the overload where the first argument is of type 
    basic_ostream&lt;charT, traits&gt;&amp; and the second is of type const 
    charT*, and also for the overload where the first argument is of type 
    basic_ostream&lt;char, traits&gt;&amp; and the second is of type const 
    char*. 
    <LI>std::char_traits&lt;char&gt;::length(s) for the overload where the first 
    argument is of type basic_ostream&lt;charT, traits&gt;&amp; and the second 
    is of type const char*. 
    <LI>traits::length(reinterpret_cast&lt;const char*&gt;(s)) for the other two 
    overloads. </LI></UL>
  <P>Padding is determined as described in lib.facet.num.put.virtuals. The 
  <I>n</I> characters starting at <I>s</I> are widened using out.widen 
  (lib.basic.ios.members). The widened characters and any required padding are 
  inserted into out. Calls width(0).</P></BLOCKQUOTE>
<P><I>[Santa Cruz: Matt supplied new wording]</I></P>
<P><I>[Kona: changed "where <I>n</I> is" to " where <I>n</I> is the number that 
would be computed as if by"]</I></P>
<P><B>Rationale:</B></P>
<P>We have five separate cases. In two of them we can use the user-supplied 
traits class without any fuss. In the other three we try to use something as 
close to that user-supplied class as possible. In two cases we've got a traits 
class that's appropriate for char and what we've got is a const signed char* or 
a const unsigned char*; that's close enough so we can just use a reinterpret 
cast, and continue to use the user-supplied traits class. Finally, there's one 
case where we just have to give up: where we've got a 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&lt;char&gt;</P>
<HR>
<A name=168>
<H3>168.&nbsp;Typo: formatted vs. unformatted</H3></A>
<P><B>Section:</B>&nbsp;27.6.2.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.unformatted">[lib.ostream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The first paragraph begins with a descriptions what has to be done in 
<I>formatted</I> output functions. Probably this is a typo and the paragraph 
really want to describe unformatted output functions...</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.2.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.unformatted">[lib.ostream.unformatted]</A> 
paragraph 1, the first and last sentences, change the word "formatted" to 
"unformatted":</P>
<BLOCKQUOTE>
  <P>"Each <B>unformatted </B>output function begins ..."<BR>"... value 
  specified for the <B>unformatted </B>output function."</P></BLOCKQUOTE>
<HR>
<A name=169>
<H3>169.&nbsp;Bad efficiency of <TT>overflow()</TT> mandated</H3></A>
<P><B>Section:</B>&nbsp;27.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.virtuals">[lib.stringbuf.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>Paragraph 8, Notes, of this section seems to mandate an extremely inefficient 
way of buffer handling for <TT>basic_stringbuf</TT>, especially in view of the 
restriction that <TT>basic_ostream</TT> member functions are not allowed to use 
<TT>xsputn()</TT> (see 27.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream">[lib.ostream]</A>): 
For each character to be inserted, a new buffer is to be created.</P>
<P>Of course, the resolution below requires some handling of simultaneous input 
and output since it is no longer possible to update <TT>egptr()</TT> whenever 
<TT>epptr()</TT> is changed. A possible solution is to handle this in 
<TT>underflow()</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.virtuals">[lib.stringbuf.virtuals]</A> 
paragraph 8, Notes, insert the words "at least" as in the following:</P>
<BLOCKQUOTE>
  <P>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 <B>at least</B> one additional write 
  position.</P></BLOCKQUOTE>
<HR>
<A name=170>
<H3>170.&nbsp;Inconsistent definition of <TT>traits_type</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.7.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringstream">[lib.stringstream]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>The classes <TT>basic_stringstream</TT> (27.7.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringstream">[lib.stringstream]</A>), 
<TT>basic_istringstream</TT> (27.7.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istringstream">[lib.istringstream]</A>), 
and <TT>basic_ostringstream</TT> (27.7.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostringstream">[lib.ostringstream]</A>) 
are inconsistent in their definition of the type <TT>traits_type</TT>: For 
<TT>istringstream</TT>, this type is defined, for the other two it is not. This 
should be consistent.</P>
<P><B>Proposed resolution:</B></P>
<P><B>Proposed resolution:</B></P>
<P>To the declarations of <TT>basic_ostringstream</TT> (27.7.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostringstream">[lib.ostringstream]</A>) 
and <TT>basic_stringstream</TT> (27.7.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringstream">[lib.stringstream]</A>) 
add:</P>
<BLOCKQUOTE><PRE>typedef traits traits_type;</PRE></BLOCKQUOTE>
<HR>
<A name=171>
<H3>171.&nbsp;Strange <TT>seekpos()</TT> semantics due to joint 
position</H3></A>
<P><B>Section:</B>&nbsp;27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Jul 1999</P>
<P>Overridden virtual functions, seekpos()</P>
<P>In 27.8.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf">[lib.filebuf]</A> 
paragraph 3, it is stated that a joint input and output position is maintained 
by <TT>basic_filebuf</TT>. Still, the description of <TT>seekpos()</TT> seems to 
talk about different file positions. In particular, it is unclear (at least to 
me) what is supposed to happen to the output buffer (if there is one) if only 
the input position is changed. The standard seems to mandate that the output 
buffer is kept and processed as if there was no positioning of the output 
position (by changing the input position). Of course, this can be exactly what 
you want if the flag <TT>ios_base::ate</TT> is set. However, I think, the 
standard should say something like this:</P>
<UL>
  <LI>If <TT>(which &amp; mode) == 0</TT> neither read nor write position is 
  changed and the call fails. Otherwise, the joint read and write position is 
  altered to correspond to <TT>sp</TT>. 
  <LI>If there is an output buffer, the output sequences is updated and any 
  unshift sequence is written before the position is altered. 
  <LI>If there is an input buffer, the input sequence is updated after the 
  position is altered. </LI></UL>
<P>Plus the appropriate error handling, that is...</P>
<P><B>Proposed resolution:</B></P>
<P>Change the unnumbered paragraph in 27.8.1.4 (lib.filebuf.virtuals) before 
paragraph 14 from:</P>
<BLOCKQUOTE>
  <P>pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | 
  ios_base::out);</P>
  <P>Alters the file position, if possible, to correspond to the position stored 
  in sp (as described below).</P>
  <P>- if (which&amp;ios_base::in)!=0, set the file position to sp, then update 
  the input sequence</P>
  <P>- if (which&amp;ios_base::out)!=0, then update the output sequence, write 
  any unshift sequence, and set the file position to sp.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | 
  ios_base::out);</P>
  <P>Alters the file position, if possible, to correspond to the position stored 
  in sp (as described below). Altering the file position performs as 
follows:</P>
  <P>1. if (om &amp; ios_base::out)!=0, then update the output sequence and 
  write any unshift sequence;</P>
  <P>2. set the file position to sp;</P>
  <P>3. if (om &amp; ios_base::in)!=0, then update the input sequence;</P>
  <P>where om is the open mode passed to the last call to open(). The operation 
  fails if is_open() returns false.</P></BLOCKQUOTE>
<P><I>[Kona: Dietmar is working on a proposed resolution.]</I></P>
<P><I>[Post-Tokyo: Dietmar supplied the above wording.]</I></P>
<HR>
<A name=172>
<H3>172.&nbsp;Inconsistent types for <TT>basic_istream::ignore()</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Greg Comeau, Dietmar Khl&nbsp; <B>Date:</B>&nbsp;23 Jul 
1999</P>
<P>In 27.6.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream">[lib.istream]</A> 
the function <TT>ignore()</TT> gets an object of type <TT>streamsize</TT> as 
first argument. However, in 27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A> 
paragraph 23 the first argument is of type <TT>int.</TT></P>
<P>As far as I can see this is not really a contradiction because everything is 
consistent if <TT>streamsize</TT> is typedef to be <TT>int</TT>. However, this 
is almost certainly not what was intended. The same thing happened to 
<TT>basic_filebuf::setbuf()</TT>, as described in issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#173">173</A>.</P>
<P>Darin Adler also submitted this issue, commenting: Either 27.6.1.1 should be 
modified 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&lt;streamsize&gt;::max.</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A> 
paragraph 23 and 24, change both uses of <TT>int</TT> in the description of 
<TT>ignore()</TT> to <TT>streamsize</TT>.</P>
<HR>
<A name=173>
<H3>173.&nbsp;Inconsistent types for <TT>basic_filebuf::setbuf()</TT> </H3></A>
<P><B>Section:</B>&nbsp;27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Greg Comeau, Dietmar Khl&nbsp; <B>Date:</B>&nbsp;23 Jul 
1999</P>
<P>In 27.8.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf">[lib.filebuf]</A> 
the function <TT>setbuf()</TT> gets an object of type <TT>streamsize</TT> as 
second argument. However, in 27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A> 
paragraph 9 the second argument is of type <TT>int</TT>. </P>
<P>As far as I can see this is not really a contradiction because everything is 
consistent if <TT>streamsize</TT> is typedef to be <TT>int</TT>. However, this 
is almost certainly not what was intended. The same thing happened to 
<TT>basic_istream::ignore()</TT>, as described in issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#172">172</A>. 
</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.8.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.filebuf.virtuals">[lib.filebuf.virtuals]</A> 
paragraph 9, change all uses of <TT>int</TT> in the description of 
<TT>setbuf()</TT> to <TT>streamsize</TT>.</P>
<HR>
<A name=174>
<H3>174.&nbsp;Typo: <TT>OFF_T</TT> vs. <TT>POS_T</TT> </H3></A>
<P><B>Section:</B>&nbsp;D.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ios.members">[depr.ios.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;23 Jul 1999</P>
<P>According to paragraph 1 of this section, <TT>streampos</TT> is the type 
<TT>OFF_T</TT>, the same type as <TT>streamoff</TT>. However, in paragraph 6 the 
<TT>streampos</TT> gets the type <TT>POS_T</TT></P>
<P><B>Proposed resolution:</B></P>
<P>Change D.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ios.members">[depr.ios.members]</A> 
paragraph 1 from "<TT>typedef OFF_T streampos;</TT>" to "<TT>typedef POS_T 
streampos;</TT>"</P>
<HR>
<A name=175>
<H3>175.&nbsp;Ambiguity for <TT>basic_streambuf::pubseekpos()</TT> and a few 
other functions.</H3></A>
<P><B>Section:</B>&nbsp;D.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ios.members">[depr.ios.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;23 Jul 1999</P>
<P>According to paragraph 8 of this section, the methods 
<TT>basic_streambuf::pubseekpos()</TT>, <TT>basic_ifstream::open()</TT>, and 
<TT>basic_ofstream::open</TT> "may" be overloaded by a version of this function 
taking the type <TT>ios_base::open_mode</TT> as last argument argument instead 
of <TT>ios_base::openmode</TT> (<TT>ios_base::open_mode</TT> is defined in this 
section to be an alias for one of the integral types). The clause specifies, 
that the last argument has a default argument in 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.</P>
<P><B>Proposed resolution:</B></P>
<P>In D.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ios.members">[depr.ios.members]</A> 
paragraph 8, remove the default arguments for 
<TT>basic_streambuf::pubseekpos()</TT>, <TT>basic_ifstream::open()</TT>, and 
<TT>basic_ofstream::open().</TT></P>
<HR>
<A name=176>
<H3>176.&nbsp;<TT>exceptions()</TT> in <TT>ios_base</TT>...?</H3></A>
<P><B>Section:</B>&nbsp;D.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ios.members">[depr.ios.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;23 Jul 1999</P>
<P>The "overload" for the function <TT>exceptions()</TT> in paragraph 8 gives 
the impression that there is another function of this function defined in class 
<TT>ios_base</TT>. 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.input.output">[lib.input.output]</A>."</P>
<P><B>Proposed resolution:</B></P>
<P>In D.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/future.html#depr.ios.members">[depr.ios.members]</A> 
paragraph 8, move the declaration of the function <TT>exceptions()</TT>into 
class <TT>basic_ios</TT>.</P>
<HR>
<A name=179>
<H3>179.&nbsp;Comparison of const_iterators to iterators doesn't work</H3></A>
<P><B>Section:</B>&nbsp;23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;2 Jul 1998</P>
<P>Currently the following will not compile on two well-known standard library 
implementations:</P>
<BLOCKQUOTE><PRE>#include &lt;set&gt;
using namespace std;

void f(const set&lt;int&gt; &amp;s)
{
  set&lt;int&gt;::iterator i;
  if (i==s.end()); // s.end() returns a const_iterator
}</PRE></BLOCKQUOTE>
<P>The reason this doesn't compile is because operator== was implemented as a 
member function of the nested classes set:iterator and set::const_iterator, and 
there is no conversion from const_iterator to iterator. Surprisingly, (s.end() 
== i) does work, though, because of the conversion from iterator to 
const_iterator. </P>
<P>I don't see a requirement anywhere in the standard that this must work. 
Should there be one? If so, I think the requirement would need to be added to 
the tables in section 24.1.1. I'm not sure about the wording. If this 
requirement existed in the standard, I would think that implementors would have 
to make the comparison operators non-member functions.</P>
<P>This issues was also raised on comp.std.c++ by Darin Adler.&nbsp; The example 
given was:</P>
<BLOCKQUOTE><PRE>bool check_equal(std::deque&lt;int&gt;::iterator i,
std::deque&lt;int&gt;::const_iterator ci)
{
return i == ci;
}</PRE></BLOCKQUOTE>
<P>Comment from John Potter:</P>
<BLOCKQUOTE>
  <P>In case nobody has noticed, accepting it will break reverse_iterator. </P>
  <P>The fix is to make the comparison operators templated on two types. </P><PRE>    template &lt;class Iterator1, class Iterator2&gt;
    bool operator== (reverse_iterator&lt;Iterator1&gt; const&amp; x,
                     reverse_iterator&lt;Iterator2&gt; const&amp; y);
    </PRE>
  <P>Obviously: return x.base() == y.base(); </P>
  <P>Currently, no reverse_iterator to const_reverse_iterator compares are 
  valid. </P>
  <P>BTW, I think the issue is in support of bad code. Compares should be 
  between two iterators of the same type. All std::algorithms require the begin 
  and end iterators to be of the same type. </P></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Insert this paragraph after 23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
paragraph 7:</P>
<BLOCKQUOTE>
  <P>In the expressions</P><PRE>    i == j
    i != j
    i &lt; j
    i &lt;= j
    i &gt;= j
    i &gt; j
    i - j
  </PRE>
  <P>Where i and j denote objects of a container's iterator type, either or both 
  may be replaced by an object of the container's const_iterator type referring 
  to the same element with no change in semantics.</P></BLOCKQUOTE>
<P><I>[post-Toronto: Judy supplied a proposed resolution saying that 
<TT>iterator</TT> and <TT>const_iterator</TT> could be freely mixed in iterator 
comparison and difference operations.]</I></P>
<P><I>[Redmond: Dave and Howard supplied a new proposed resolution which 
explicitly listed expressions; there was concern that the previous proposed 
resolution was too informal.]</I></P>
<P><B>Rationale:</B></P>
<P>The LWG believes it is clear that the above wording applies only to the 
nested types <TT>X::iterator</TT> and <TT>X::const_iterator</TT>, where 
<TT>X</TT> is a container. There is no requirement that 
<TT>X::reverse_iterator</TT> and <TT>X::const_reverse_iterator</TT> can be 
mixed. If mixing them is considered important, that's a separate issue. (Issue 
<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#280">280</A>.) 
</P>
<HR>
<A name=181>
<H3>181.&nbsp;make_pair() unintended behavior</H3></A>
<P><B>Section:</B>&nbsp;20.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.pairs">[lib.pairs]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrew Koenig&nbsp; <B>Date:</B>&nbsp;3 Aug 1999</P>
<P>The claim has surfaced in Usenet that expressions such 
as<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <TT>make_pair("abc", 
3)</TT><BR><BR>are illegal, notwithstanding their use in examples, because 
template instantiation tries to bind the first template parameter to <TT>const 
char (&amp;)[4]</TT>, which type is uncopyable.<BR><BR>I doubt anyone intended 
that behavior... </P>
<P><B>Proposed resolution:</B></P>
<P>In 20.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.utility">[lib.utility]</A>, 
paragraph 1 change the following declaration of make_pair():</P>
<BLOCKQUOTE><PRE>template &lt;class T1, class T2&gt; pair&lt;T1,T2&gt; make_pair(const T1&amp;, const T2&amp;);</PRE></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE><PRE>template &lt;class T1, class T2&gt; pair&lt;T1,T2&gt; make_pair(T1, T2);</PRE></BLOCKQUOTE>
<P>In 20.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.pairs">[lib.pairs]</A> 
paragraph 7 and the line before, change:</P>
<BLOCKQUOTE><PRE>template &lt;class T1, class T2&gt;
pair&lt;T1, T2&gt; make_pair(const T1&amp; x, const T2&amp; y);</PRE></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE><PRE>template &lt;class T1, class T2&gt;
pair&lt;T1, T2&gt; make_pair(T1 x, T2 y);</PRE></BLOCKQUOTE>
<P>and add the following footnote to the effects clause:</P>
<BLOCKQUOTE>
  <P>According to 12.8 [class.copy], an implementation is permitted to not 
  perform a copy of an argument, thus avoiding unnecessary 
copies.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Two potential fixes were suggested by Matt Austern and Dietmar Khl, 
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 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.</P>
<HR>
<A name=182>
<H3>182.&nbsp;Ambiguous references to size_t</H3></A>
<P><B>Section:</B>&nbsp;17 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.library">[lib.library]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Al Stevens&nbsp; <B>Date:</B>&nbsp;15 Aug 1999</P>
<P>Many references to <TT>size_t</TT> throughout the document omit the 
<TT>std::</TT> namespace qualification.</P>
<P>For example, 17.4.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.replacement.functions">[lib.replacement.functions]</A> 
paragraph 2:</P>
<BLOCKQUOTE><PRE> operator new(size_t)
 operator new(size_t, const std::nothrow_t&amp;)
 operator new[](size_t)
 operator new[](size_t, const std::nothrow_t&amp;)</PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>In 17.4.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.replacement.functions">[lib.replacement.functions]</A> 
paragraph 2: replace:</P>
<BLOCKQUOTE>
  <P><TT>- operator new(size_t)<BR>- operator new(size_t, const 
  std::nothrow_t&amp;)<BR>- operator new[](size_t)<BR>- operator new[](size_t, 
  const std::nothrow_t&amp;)</TT></P></BLOCKQUOTE>
<P>by:</P>
<BLOCKQUOTE><PRE>- operator new(std::size_t)
- operator new(std::size_t, const std::nothrow_t&amp;)
- operator new[](std::size_t)
- operator new[](std::size_t, const std::nothrow_t&amp;)</PRE></BLOCKQUOTE>
<P>In [lib.allocator.requirements] 20.1.5, paragraph 4: replace:</P>
<BLOCKQUOTE>
  <P>The typedef members pointer, const_pointer, size_type, and difference_type 
  are required to be T*, T const*, size_t, and ptrdiff_t, 
respectively.</P></BLOCKQUOTE>
<P>&nbsp;by:</P>
<BLOCKQUOTE>
  <P>The typedef members pointer, const_pointer, size_type, and difference_type 
  are required to be T*, T const*, std::size_t, and std::ptrdiff_t, 
  respectively.</P></BLOCKQUOTE>
<P>In [lib.allocator.members] 20.4.1.1, paragraphs 3 and 6: replace:</P>
<BLOCKQUOTE>
  <P>3 Notes: Uses ::operator new(size_t) (18.4.1).</P>
  <P>6 Note: the storage is obtained by calling ::operator new(size_t), but it 
  is unspecified when or how often this function is called. The use of hint is 
  unspecified, but intended as an aid to locality if an implementation so 
  desires.</P></BLOCKQUOTE>
<P>by:</P>
<BLOCKQUOTE>
  <P>3 Notes: Uses ::operator new(std::size_t) (18.4.1).</P>
  <P>6 Note: the storage is obtained by calling ::operator new(std::size_t), but 
  it is unspecified when or how often this function is called. The use of hint 
  is unspecified, but intended as an aid to locality if an implementation so 
  desires.</P></BLOCKQUOTE>
<P>In [lib.char.traits.require] 21.1.1, paragraph 1: replace:</P>
<BLOCKQUOTE>
  <P>In Table 37, X denotes a Traits class defining types and functions for the 
  character container type CharT; c and d denote values of type CharT; p and q 
  denote values of type const CharT*; s denotes a value of type CharT*; n, i and 
  j denote values of type size_t; e and f denote values of type X::int_type; pos 
  denotes a value of type X::pos_type; and state denotes a value of type 
  X::state_type.</P></BLOCKQUOTE>
<P>by:</P>
<BLOCKQUOTE>
  <P>In Table 37, X denotes a Traits class defining types and functions for the 
  character container type CharT; c and d denote values of type CharT; p and q 
  denote values of type const CharT*; s denotes a value of type CharT*; n, i and 
  j denote values of type std::size_t; e and f denote values of type 
  X::int_type; pos denotes a value of type X::pos_type; and state denotes a 
  value of type X::state_type.</P></BLOCKQUOTE>
<P>In [lib.char.traits.require] 21.1.1, table 37: replace the return type of 
X::length(p): "size_t" by "std::size_t".</P>
<P>In [lib.std.iterator.tags] 24.3.3, paragraph 2: 
replace:<BR>&nbsp;&nbsp;&nbsp; typedef ptrdiff_t 
difference_type;<BR>by:<BR>&nbsp;&nbsp;&nbsp; typedef std::ptrdiff_t 
difference_type;</P>
<P>In [lib.locale.ctype] 22.2.1.1 put namespace std { ...} around the 
declaration of template &lt;class charT&gt; class ctype.<BR><BR>In 
[lib.iterator.traits] 24.3.1, paragraph 2 put namespace std { ...} around the 
declaration of:<BR><BR>&nbsp;&nbsp;&nbsp; template&lt;class Iterator&gt; struct 
iterator_traits<BR>&nbsp;&nbsp;&nbsp; template&lt;class T&gt; struct 
iterator_traits&lt;T*&gt;<BR>&nbsp;&nbsp;&nbsp; template&lt;class T&gt; struct 
iterator_traits&lt;const T*&gt;</P>
<P><B>Rationale:</B></P>
<P>The LWG believes correcting names like <TT>size_t</TT> and <TT>ptrdiff_t</TT> 
to <TT>std::size_t</TT> and <TT>std::ptrdiff_t</TT> 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.extern.types">[lib.extern.types]</A>,</P>
<BLOCKQUOTE>For each type T from the Standard C library, the types ::T and 
  std::T are reserved to the implementation and, when defined, ::T shall be 
  identical to std::T. </BLOCKQUOTE>
<P>The issue is treated as a Defect Report to make explicit the Project Editor's 
authority to make this change.</P>
<P><I>[Post-Tokyo: Nico Josuttis provided the above wording at the request of 
the LWG.]</I></P>
<P><I>[Toronto: This is tangentially related to issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#229">229</A>, 
but only tangentially: the intent of this issue is to address use of the name 
<TT>size_t</TT> in contexts outside of namespace std, such as in the description 
of <TT>::operator new</TT>. The proposed changes should be reviewed to make sure 
they are correct.]</I></P>
<P><I>[pre-Copenhagen: Nico has reviewed the changes and believes them to be 
correct.]</I></P>
<HR>
<A name=183>
<H3>183.&nbsp;I/O stream manipulators don't work for wide character 
streams</H3></A>
<P><B>Section:</B>&nbsp;27.6.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.std.manip">[lib.std.manip]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andy Sawyer&nbsp; <B>Date:</B>&nbsp;7 Jul 1999</P>
<P>27.6.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.std.manip">[lib.std.manip]</A> 
paragraph 3 says (clause numbering added for exposition):</P>
<BLOCKQUOTE>
  <P>Returns: An object s of unspecified type such that if [1] out is an 
  (instance of) basic_ostream then the expression out&lt;&lt;s behaves as if 
  f(s) were called, and if [2] in is an (instance of) basic_istream then the 
  expression in&gt;&gt;s behaves as if f(s) were called. Where f can be defined 
  as: ios_base&amp; f(ios_base&amp; str, ios_base::fmtflags mask) { // reset 
  specified flags str.setf(ios_base::fmtflags(0), mask); return str; } [3] The 
  expression out&lt;&lt;s has type ostream&amp; and value out. [4] The 
  expression in&gt;&gt;s has type istream&amp; and value in.</P></BLOCKQUOTE>
<P>Given the definitions [1] and [2] for out and in, surely [3] should read: 
"The expression out &lt;&lt; s has type basic_ostream&amp; ..." and [4] should 
read: "The expression in &gt;&gt; s has type basic_istream&amp; ..."</P>
<P>If the wording in the standard is correct, I can see no way of implementing 
any of the manipulators so that they will work with wide character streams.</P>
<P>e.g. wcout &lt;&lt; setbase( 16 );</P>
<P>Must have value 'wcout' (which makes sense) and type 'ostream&amp;' (which 
doesn't).</P>
<P>The same "cut'n'paste" type also seems to occur in Paras 4,5,7 and 8. In 
addition, Para 6 [setfill] has a similar error, but relates only to 
ostreams.</P>
<P>I'd be happier if there was a better way of saying this, to make it clear 
that the value of the expression is "the same specialization of basic_ostream as 
out"&amp;</P>
<P><B>Proposed resolution:</B></P>
<P>Replace section 27.6.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.std.manip">[lib.std.manip]</A> 
except paragraph 1 with the following:</P>
<BLOCKQUOTE>
  <P>2- The type designated smanip in each of the following function 
  descriptions is implementation-specified and may be different for each 
  function.<BR><BR><TT>smanip resetiosflags(ios_base::fmtflags 
  mask);</TT><BR><BR>-3- Returns: An object s of unspecified type such that if 
  out is an instance of basic_ostream&lt;charT,traits&gt; then the expression 
  out&lt;&lt;s behaves as if f(s, mask) were called, or if in is an instance of 
  basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as 
  if f(s, mask) were called. The function f can be defined 
  as:*<BR><BR>[Footnote: The expression cin &gt;&gt; 
  resetiosflags(ios_base::skipws) clears ios_base::skipws in the format flags 
  stored in the basic_istream&lt;charT,traits&gt; object cin (the same as cin 
  &gt;&gt; noskipws), and the expression cout &lt;&lt; 
  resetiosflags(ios_base::showbase) clears ios_base::showbase in the format 
  flags stored in the basic_ostream&lt;charT,traits&gt; object cout (the same as 
  cout &lt;&lt; noshowbase). --- end footnote]<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  <TT>ios_base&amp; f(ios_base&amp; str, ios_base::fmtflags 
  mask)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp; // reset specified 
  flags<BR>&nbsp;&nbsp; str.setf(ios_base::fmtflags(0), mask);<BR>&nbsp;&nbsp; 
  return str;<BR>&nbsp;&nbsp; }<BR></TT><BR>The expression out&lt;&lt;s has type 
  basic_ostream&lt;charT,traits&gt;&amp; and value out. The expression 
  in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value 
  in.<BR><BR>&nbsp;<TT>smanip setiosflags(ios_base::fmtflags 
  mask);</TT><BR><BR>-4- Returns: An object s of unspecified type such that if 
  out is an instance of basic_ostream&lt;charT,traits&gt; then the expression 
  out&lt;&lt;s behaves as if f(s, mask) were called, or if in is an instance of 
  basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as 
  if f(s, mask) were called. The function f can be defined 
  as:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; <TT>ios_base&amp; f(ios_base&amp; str, 
  ios_base::fmtflags mask)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp; // set specified 
  flags<BR>&nbsp;&nbsp; str.setf(mask);<BR>&nbsp;&nbsp; return 
  str;<BR>&nbsp;&nbsp; }<BR></TT><BR>The expression out&lt;&lt;s has type 
  basic_ostream&lt;charT,traits&gt;&amp; and value out. The expression 
  in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value 
  in.<BR><BR><TT>smanip setbase(int base);</TT><BR><BR>-5- Returns: An object s 
  of unspecified type such that if out is an instance of 
  basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves as 
  if f(s, base) were called, or if in is an instance of 
  basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as 
  if f(s, base) were called. The function f can be defined 
  as:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; <TT>ios_base&amp; f(ios_base&amp; str, int 
  base)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp; // set basefield<BR>&nbsp;&nbsp; 
  str.setf(base == 8 ? ios_base::oct :<BR>&nbsp;&nbsp; base == 10 ? 
  ios_base::dec :<BR>&nbsp;&nbsp; base == 16 ? ios_base::hex :<BR>&nbsp;&nbsp; 
  ios_base::fmtflags(0), ios_base::basefield);<BR>&nbsp;&nbsp; return 
  str;<BR>&nbsp;&nbsp; }<BR></TT><BR>The expression out&lt;&lt;s has type 
  basic_ostream&lt;charT,traits&gt;&amp; and value out. The expression 
  in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value 
  in.<BR><BR><TT>smanip setfill(char_type c);<BR></TT><BR>-6- Returns: An object 
  s of unspecified type such that if out is (or is derived from) 
  basic_ostream&lt;charT,traits&gt; and c has type charT then the expression 
  out&lt;&lt;s behaves as if f(s, c) were called. The function f can be defined 
  as:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <TT>template&lt;class charT, class 
  traits&gt;<BR>&nbsp;&nbsp; basic_ios&lt;charT,traits&gt;&amp; 
  f(basic_ios&lt;charT,traits&gt;&amp; str, charT c)<BR>&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp; // set fill character<BR>&nbsp;&nbsp; 
  str.fill(c);<BR>&nbsp;&nbsp; return str;<BR>&nbsp;&nbsp; }<BR></TT><BR>The 
  expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and 
  value out.<BR><BR><TT>smanip setprecision(int n);</TT><BR><BR>-7- Returns: An 
  object s of unspecified type such that if out is an instance of 
  basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves as 
  if f(s, n) were called, or if in is an instance of 
  basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as 
  if f(s, n) were called. The function f can be defined 
  as:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <TT>ios_base&amp; f(ios_base&amp; 
  str, int n)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp; // set precision<BR>&nbsp;&nbsp; 
  str.precision(n);<BR>&nbsp;&nbsp; return str;<BR>&nbsp;&nbsp; 
  }<BR></TT><BR>The expression out&lt;&lt;s has type 
  basic_ostream&lt;charT,traits&gt;&amp; and value out. The expression 
  in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value 
  in<BR>.<BR><TT>smanip setw(int n);<BR></TT><BR>-8- Returns: An object s of 
  unspecified type such that if out is an instance of 
  basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves as 
  if f(s, n) were called, or if in is an instance of 
  basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as 
  if f(s, n) were called. The function f can be defined 
  as:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <TT>ios_base&amp; f(ios_base&amp; 
  str, int n)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp; // set width<BR>&nbsp;&nbsp; 
  str.width(n);<BR>&nbsp;&nbsp; return str;<BR>&nbsp;&nbsp; }<BR></TT><BR>The 
  expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and 
  value out. The expression in&gt;&gt;s has type 
  basic_istream&lt;charT,traits&gt;&amp; and value in. </P></BLOCKQUOTE>
<P><I>[Kona: Andy Sawyer and Beman Dawes will work to improve the wording of the 
proposed resolution.]</I></P>
<P><I>[Tokyo - The LWG noted that issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#216">216</A> 
involves the same paragraphs.]</I></P>
<P><I>[Post-Tokyo: The issues list maintainer combined the proposed resolution 
of this issue with the proposed resolution for issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#216">216</A> 
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.]</I></P>
<HR>
<A name=184>
<H3>184.&nbsp;numeric_limits&lt;bool&gt; wording problems</H3></A>
<P><B>Section:</B>&nbsp;18.2.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.numeric.special">[lib.numeric.special]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Gabriel Dos Reis&nbsp; <B>Date:</B>&nbsp;21 Jul 1999</P>
<P>bools are defined by the standard to be of integer types, as per 3.9.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/basic.html#basic.fundamental">[basic.fundamental]</A> 
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&lt;bool&gt; as evidenced below.</P>
<P>18.2.1.2/7 says numeric_limits&lt;&gt;::digits is, for built-in integer 
types, the number of non-sign bits in the representation.</P>
<P>4.5/4 states that a bool promotes to int ; whereas 4.12/1 says any non zero 
arithmetical value converts to true.</P>
<P>I don't think it makes sense at all to require 
numeric_limits&lt;bool&gt;::digits and numeric_limits&lt;bool&gt;::digits10 to 
be meaningful.</P>
<P>The standard defines what constitutes a signed (resp. unsigned) integer 
types. It doesn't categorize bool as being signed or unsigned. And the set of 
values of bool type has only two elements.</P>
<P>I don't think it makes sense to require numeric_limits&lt;bool&gt;::is_signed 
to be meaningful.</P>
<P>18.2.1.2/18 for numeric_limits&lt;integer_type&gt;::radix&nbsp; says:</P>
<BLOCKQUOTE>
  <P>For integer types, specifies the base of the 
representation.186)</P></BLOCKQUOTE>
<P>This disposition is at best misleading and confusing for the standard 
requires a "pure binary numeration system" for integer types as per 3.9.1/7</P>
<P>The footnote 186) says: "Distinguishes types with base other than 2 (e.g 
BCD)."&nbsp; This also erroneous as the standard never defines any integer types 
with base representation other than 2.</P>
<P>Furthermore, numeric_limits&lt;bool&gt;::is_modulo and 
numeric_limits&lt;bool&gt;::is_signed have similar problems.</P>
<P><B>Proposed resolution:</B></P>
<P>Append to the end of 18.2.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.numeric.special">[lib.numeric.special]</A>:</P>
<BLOCKQUOTE>
  <P>The specialization for bool shall be provided as follows:</P><PRE>    namespace std {
       template&lt;&gt; class numeric_limits&lt;bool&gt; {
       public:
         static const bool is_specialized = true;
         static bool min() throw() { return false; }
         static bool max() throw() { return true; }

         static const int  digits = 1;
         static const int  digits10 = 0;
         static const bool is_signed = false;
         static const bool is_integer = true;
         static const bool is_exact = true;
         static const int  radix = 2;
         static bool epsilon() throw() { return 0; }
         static bool round_error() throw() { return 0; }

         static const int  min_exponent = 0;
         static const int  min_exponent10 = 0;
         static const int  max_exponent = 0;
         static const int  max_exponent10 = 0;

         static const bool has_infinity = false;
         static const bool has_quiet_NaN = false;
         static const bool has_signaling_NaN = false;
         static const float_denorm_style has_denorm = denorm_absent;
         static const bool has_denorm_loss = false;
         static bool infinity() throw() { return 0; }
         static bool quiet_NaN() throw() { return 0; }
         static bool signaling_NaN() throw() { return 0; }
         static bool denorm_min() throw() { return 0; }

         static const bool is_iec559 = false;
         static const bool is_bounded = true;
         static const bool is_modulo = false;

         static const bool traps = false;
         static const bool tinyness_before = false;
         static const float_round_style round_style = round_toward_zero;
       };
     }</PRE></BLOCKQUOTE>
<P><I>[Tokyo:&nbsp; The LWG desires wording that specifies exact values rather 
than more general wording in the original proposed resolution.]</I></P>
<P><I>[Post-Tokyo:&nbsp; At the request of the LWG in Tokyo, Nico Josuttis 
provided the above wording.]</I></P>
<HR>
<A name=185>
<H3>185.&nbsp;Questionable use of term "inline"</H3></A>
<P><B>Section:</B>&nbsp;20.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.objects">[lib.function.objects]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;UK Panel&nbsp; <B>Date:</B>&nbsp;26 Jul 1999</P>
<P>Paragraph 4 of 20.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.objects">[lib.function.objects]</A> 
says:</P>
<BLOCKQUOTE>
  <P>&nbsp;[Example: To negate every element of a: transform(a.begin(), a.end(), 
  a.begin(), negate&lt;double&gt;()); The corresponding functions will inline 
  the addition and the negation. end example]</P></BLOCKQUOTE>
<P>(Note: The "addition" referred to in the above is in para 3) we can find no 
other wording, except this (non-normative) example which suggests that any 
"inlining" will take place in this case.</P>
<P>Indeed both:</P>
<BLOCKQUOTE>
  <P>17.4.4.3 Global Functions [lib.global.functions] 1 It is unspecified 
  whether any global functions in the C++ Standard Library are defined as inline 
  (7.1.2).</P></BLOCKQUOTE>
<P>and</P>
<BLOCKQUOTE>
  <P>17.4.4.4 Member Functions [lib.member.functions] 1 It is unspecified 
  whether any member functions in the C++ Standard Library are defined as inline 
  (7.1.2).</P></BLOCKQUOTE>
<P>take care to state that this may indeed NOT be the case.</P>
<P>Thus the example "mandates" behavior that is explicitly not required 
elsewhere.</P>
<P><B>Proposed resolution:</B></P>
<P>In 20.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.objects">[lib.function.objects]</A> 
paragraph 1, remove the sentence:</P>
<BLOCKQUOTE>
  <P>They are important for the effective use of the library.</P></BLOCKQUOTE>
<P>Remove 20.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.objects">[lib.function.objects]</A> 
paragraph 2, which reads:</P>
<BLOCKQUOTE>
  <P>Using function objects together with function templates increases the 
  expressive power of the library as well as making the resulting code much more 
  efficient.</P></BLOCKQUOTE>
<P>In 20.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.objects">[lib.function.objects]</A> 
paragraph 4, remove the sentence:</P>
<BLOCKQUOTE>
  <P>The corresponding functions will inline the addition and the 
negation.</P></BLOCKQUOTE>
<P><I>[Kona: The LWG agreed there was a defect.]</I></P>
<P><I>[Tokyo: The LWG crafted the proposed resolution.]</I></P>
<HR>
<A name=186>
<H3>186.&nbsp;bitset::set() second parameter should be bool</H3></A>
<P><B>Section:</B>&nbsp;23.3.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.bitset.members">[lib.bitset.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Darin Adler&nbsp; <B>Date:</B>&nbsp;13 Aug 1999</P>
<P>In section 23.3.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.bitset.members">[lib.bitset.members]</A>, 
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 be 
bool. For one thing, the intent is to specify a Boolean value. For another, the 
result type from test() is bool. In addition, it's 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.</P>
<P><B>Proposed resolution:</B></P>
<P>In 23.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.template.bitset">[lib.template.bitset]</A> 
Para 1 Replace:</P>
<BLOCKQUOTE><PRE>bitset&lt;N&gt;&amp; set(size_t pos, int val = true ); </PRE></BLOCKQUOTE>
<P>With:</P>
<BLOCKQUOTE><PRE>bitset&lt;N&gt;&amp; set(size_t pos, bool val = true );</PRE></BLOCKQUOTE>
<P>In 23.3.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.bitset.members">[lib.bitset.members]</A> 
Para 12(.5) Replace:</P>
<BLOCKQUOTE><PRE>bitset&lt;N&gt;&amp; set(size_t pos, int val = 1 );</PRE></BLOCKQUOTE>
<P>With:</P>
<BLOCKQUOTE><PRE>bitset&lt;N&gt;&amp; set(size_t pos, bool val = true );</PRE></BLOCKQUOTE>
<P><I>[Kona: The LWG agrees with the description.&nbsp; Andy Sawyer will work on 
better P/R wording.]</I></P>
<P><I>[Post-Tokyo: Andy provided the above wording.]</I></P>
<P><B>Rationale:</B></P>
<P><TT>bool</TT> is a better choice. It is believed that binary compatibility is 
not an issue, because this member function is usually implemented as 
<TT>inline</TT>, 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.</P>
<HR>
<A name=187>
<H3>187.&nbsp;iter_swap underspecified</H3></A>
<P><B>Section:</B>&nbsp;25.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.swap">[lib.alg.swap]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrew Koenig&nbsp; <B>Date:</B>&nbsp;14 Aug 1999</P>
<P>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.<BR><BR>What it doesn't 
say is whether it does so using swap or using the assignment operator and copy 
constructor.<BR><BR>This question is an important one to answer, because swap is 
specialized to work efficiently for standard containers.<BR>For example:</P>
<BLOCKQUOTE><PRE>vector&lt;int&gt; v1, v2;
iter_swap(&amp;v1, &amp;v2);</PRE></BLOCKQUOTE>
<P>Is this call to iter_swap equivalent to calling swap(v1, v2)?&nbsp; Or is it 
equivalent to</P>
<BLOCKQUOTE><PRE>{
vector&lt;int&gt; temp = v1;
v1 = v2;
v2 = temp;
}</PRE></BLOCKQUOTE>
<P>The first alternative is O(1); the second is O(n).</P>
<P>A LWG member, Dave Abrahams, comments:</P>
<BLOCKQUOTE>
  <P>Not an objection necessarily, but I want to point out the cost of that 
  requirement:</P>
  <BLOCKQUOTE>
    <P><TT>iter_swap(list&lt;T&gt;::iterator, 
  list&lt;T&gt;::iterator)</TT></P></BLOCKQUOTE>
  <P>can currently be specialized to be more efficient than iter_swap(T*,T*) for 
  many T (by using splicing). Your proposal would make that optimization 
  illegal.&nbsp;</P></BLOCKQUOTE>
<P><I>[Kona: The LWG notes the original need for iter_swap was proxy iterators 
which are no longer permitted.]</I></P>
<P><B>Proposed resolution:</B></P>
<P>Change the effect clause of iter_swap in 25.2.2 paragraph 7 from:</P>
<BLOCKQUOTE>
  <P>Exchanges the values pointed to by the two iterators a and 
b.</P></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
  <P><TT>swap(*a, *b)</TT>.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>It's useful to say just what <TT>iter_swap</TT> does. There may be some 
iterators for which we want to specialize <TT>iter_swap</TT>, but the fully 
general version should have a general specification.</P>
<P>Note that in the specific case of <TT>list&lt;T&gt;::iterator</TT>, iter_swap 
should not be specialized as suggested above. That would do 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.</P>
<HR>
<A name=189>
<H3>189.&nbsp;setprecision() not specified correctly</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fmtflags.state">[lib.fmtflags.state]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrew Koenig&nbsp; <B>Date:</B>&nbsp;25 Aug 1999</P>
<P>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.<BR><BR>This claim is not strictly correct. For example, in the 
default floating-point output format, setprecision sets the number of 
significant digits printed, not the number of digits after the decimal 
point.<BR><BR>I would like the committee to look at the definition carefully and 
correct the statement in 27.4.2.2</P>
<P><B>Proposed resolution:</B></P>
<P>Remove from 27.4.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fmtflags.state">[lib.fmtflags.state]</A>, 
paragraph 9, the text "(number of digits after the decimal point)".</P>
<HR>
<A name=193>
<H3>193.&nbsp;Heap operations description incorrect</H3></A>
<P><B>Section:</B>&nbsp;25.3.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.heap.operations">[lib.alg.heap.operations]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Markus Mauhart&nbsp; <B>Date:</B>&nbsp;24 Sep 1999</P>
<P>25.3.6 [lib.alg.heap.operations] states two key properties of a heap [a,b), 
the first of them is<BR><BR>&nbsp;&nbsp;&nbsp; `"(1) *a is the largest 
element"<BR><BR>I think this is incorrect and should be changed to the wording 
in the proposed resolution.</P>
<P>Actually there are two independent changes:</P>
<BLOCKQUOTE>
  <P>A-"part of largest equivalence class" instead of "largest", cause 25.3 
  [lib.alg.sorting] asserts "strict weak ordering" for all its sub clauses.</P>
  <P>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).</P></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Change 25.3.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.heap.operations">[lib.alg.heap.operations]</A> 
property (1) from:</P>
<BLOCKQUOTE>
  <P>(1) *a is the largest element</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>(1) There is no element greater than <TT>*a</TT></P></BLOCKQUOTE>
<HR>
<A name=195>
<H3>195.&nbsp;Should <TT>basic_istream::sentry</TT>'s constructor ever set 
eofbit?</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::sentry">[lib.istream::sentry]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;13 Oct 1999</P>
<P>Suppose that <TT>is.flags() &amp; ios_base::skipws</TT> is nonzero. What 
should <TT>basic_istream&lt;&gt;::sentry</TT>'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.</P>
<P>On the one hand, nothing in 27.6.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream::sentry">[lib.istream::sentry]</A> 
says that <TT>basic_istream&lt;&gt;::sentry</TT> should ever set eofbit. On the 
other hand, 27.6.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream">[lib.istream]</A> 
paragraph 4 says that if extraction from a <TT>streambuf</TT> "returns 
<TT>traits::eof()</TT>, then the input function, except as explicitly noted 
otherwise, completes its actions and does <TT>setstate(eofbit)"</TT>. So the 
question comes down to whether <TT>basic_istream&lt;&gt;::sentry</TT>'s 
constructor is an input function.</P>
<P>Comments from Jerry Schwarz:</P>
<BLOCKQUOTE>
  <P>It was always my intention that eofbit should be set any time that a 
  virtual returned something to indicate eof, no matter what reason iostream 
  code had for calling the virtual.</P>
  <P>The motivation for this is that I did not want to require streambufs to 
  behave consistently if their virtuals are called after they have signaled 
  eof.</P>
  <P>The classic case is a streambuf reading from a UNIX file. EOF isn't really 
  a state for UNIX file descriptors. The convention is that a read on UNIX 
  returns 0 bytes to indicate "EOF", but the file descriptor isn't shut down in 
  any way and future reads do not necessarily also return 0 bytes. In 
  particular, you can read from tty's on UNIX even after they have signaled 
  "EOF". (It isn't always understood that a ^D on UNIX is not an EOF indicator, 
  but an EOL indicator. By typing a "line" consisting solely of ^D you cause a 
  read to return 0 bytes, and by convention this is interpreted as end of 
  file.)</P></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Add a sentence to the end of 27.6.1.1.2 paragraph 2:</P>
<BLOCKQUOTE>
  <P>If <TT>is.rdbuf()-&gt;sbumpc()</TT> or <TT>is.rdbuf()-&gt;sgetc()</TT> 
  returns <TT>traits::eof()</TT>, the function calls <TT>setstate(failbit | 
  eofbit)</TT> (which may throw <TT>ios_base::failure</TT>). </P></BLOCKQUOTE>
<HR>
<A name=198>
<H3>198.&nbsp;Validity of pointers and references unspecified after iterator 
destruction</H3></A>
<P><B>Section:</B>&nbsp;24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Beman Dawes&nbsp; <B>Date:</B>&nbsp;3 Nov 1999</P>
<P>Is a pointer or reference obtained from an iterator still valid after 
destruction of the iterator? </P>
<P>Is a pointer or reference obtained from an iterator still valid after the 
value of the iterator changes? </P>
<BLOCKQUOTE><PRE>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;iterator&gt;

int main()
{
    typedef std::vector&lt;int&gt; vec_t;
    vec_t v;
    v.push_back( 1 );

    // Is a pointer or reference obtained from an iterator still
    // valid after destruction of the iterator?
    int * p = &amp;*v.begin();
    std::cout &lt;&lt; *p &lt;&lt; '\n';  // OK?

    // Is a pointer or reference obtained from an iterator still
    // valid after the value of the iterator changes?
    vec_t::iterator iter( v.begin() );
    p = &amp;*iter++;
    std::cout &lt;&lt; *p &lt;&lt; '\n';  // OK?

    return 0;
}
</PRE></BLOCKQUOTE>
<P>The standard doesn't appear to directly address these questions. The standard 
needs to be clarified. At least two real-world cases have been reported where 
library implementors wasted considerable effort because of the lack of clarity 
in the standard. The question is important because requiring pointers and 
references to remain valid has the effect for practical purposes of prohibiting 
iterators from pointing to cached rather than actual elements of containers.</P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.reverse.iter.op.star">[lib.reverse.iter.op.star]</A>, 
which returns a reference, defines effects:</P>
<BLOCKQUOTE><PRE>Iterator tmp = current;
return *--tmp;</PRE></BLOCKQUOTE>
<P>The definition of reverse_iterator::operator-&gt;(), 24.4.1.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.reverse.iter.opref">[lib.reverse.iter.opref]</A>, 
which returns a pointer, defines effects:</P>
<BLOCKQUOTE><PRE>return &amp;(operator*());</PRE></BLOCKQUOTE>
<P>Because the standard itself assumes pointers and references remain valid 
after iterator destruction or change, the standard should say so explicitly. 
This will also reduce the chance of user code breaking unexpectedly when porting 
to a different standard library implementation.</P>
<P><B>Proposed resolution:</B></P>
<P>Add a new paragraph to 24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>:</P>
<BLOCKQUOTE>Destruction of an iterator may invalidate pointers and references 
  previously obtained from that iterator. </BLOCKQUOTE>
<P>Replace paragraph 1 of 24.4.1.3.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.reverse.iter.op.star">[lib.reverse.iter.op.star]</A> 
with:</P>
<BLOCKQUOTE>
  <P><B>Effects:</B></P><PRE>  this-&gt;tmp = current;
  --this-&gt;tmp;
  return *this-&gt;tmp;
</PRE>
  <P>[<I>Note:</I> 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 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>.) 
  The name of this member variable is shown for exposition only. <I>--end 
  note</I>] </P></BLOCKQUOTE>
<P><I>[Post-Tokyo: The issue has been reformulated purely in terms of 
iterators.]</I></P>
<P><I>[Pre-Toronto: Steve Cleary pointed out the no-invalidation assumption by 
reverse_iterator. The issue and proposed resolution was reformulated yet again 
to reflect this reality.]</I></P>
<P><I>[Copenhagen: Steve Cleary pointed out that reverse_iterator 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#299">299</A>. 
If we decide it is intentional that <TT>p[n]</TT> may return by value instead of 
reference when <TT>p</TT> is a Random Access Iterator, other changes in 
reverse_iterator will be necessary.]</I></P>
<P><B>Rationale:</B></P>
<P>This issue has been discussed extensively. Note that it is <I>not</I> an 
issue about the behavior of predefined iterators. It is asking whether or not 
user-defined iterators are permitted to have transient pointers and references. 
Several people presented examples of useful user-defined iterators that have 
such a property; examples include a B-tree iterator, and an "iota iterator" that 
doesn't point to memory. Library implementors already seem to be able to cope 
with such iterators: they take pains to avoid forming references to memory that 
gets iterated past. The only place where this is a problem is 
<TT>reverse_iterator</TT>, so this issue changes <TT>reverse_iterator</TT> to 
make it work.</P>
<P>This resolution does not weaken any guarantees provided by predefined 
iterators like <TT>list&lt;int&gt;::iterator</TT>. Clause 23 should be reviewed 
to make sure that guarantees for predefined iterators are as strong as users 
expect.</P>
<HR>
<A name=199>
<H3>199.&nbsp;What does <TT>allocate(0)</TT> return?</H3></A>
<P><B>Section:</B>&nbsp;20.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;19 Nov 1999</P>
<P>Suppose that <TT>A</TT> is a class that conforms to the Allocator 
requirements of Table 32, and <TT>a</TT> is an object of class <TT>A</TT> What 
should be the return value of <TT>a.allocate(0)</TT>? Three reasonable 
possibilities: forbid the argument <TT>0</TT>, return a null pointer, or require 
that the return value be a unique non-null pointer. </P>
<P><B>Proposed resolution:</B></P>
<P>Add a note to the <TT>allocate</TT> row of Table 32: "[<I>Note:</I> If <TT>n 
== 0</TT>, the return value is unspecified. <I>--end note</I>]"</P>
<P><B>Rationale:</B></P>
<P>A key to understanding this issue is that the ultimate use of allocate() is 
to construct an iterator, and that iterator for zero length sequences must be 
the container's past-the-end representation. Since this already implies special 
case code, it would be over-specification to mandate the return value. </P>
<HR>
<A name=200>
<H3>200.&nbsp;Forward iterator requirements don't allow constant 
iterators</H3></A>
<P><B>Section:</B>&nbsp;24.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.forward.iterators">[lib.forward.iterators]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;19 Nov 1999</P>
<P>In table 74, the return type of the expression <TT>*a</TT> is given as 
<TT>T&amp;</TT>, where <TT>T</TT> is the iterator's value type. For constant 
iterators, however, this is wrong. ("Value type" is never defined very 
precisely, but it is clear that the value type of, say, 
<TT>std::list&lt;int&gt;::const_iterator</TT> is supposed to be <TT>int</TT>, 
not <TT>const int</TT>.) </P>
<P><B>Proposed resolution:</B></P>
<P>In table 74, in the <TT>*a</TT> and <TT>*r++</TT> rows, change the return 
type from "<TT>T&amp;</TT>" to "<TT>T&amp;</TT> if <TT>X</TT> is mutable, 
otherwise <TT>const T&amp;</TT>". In the <TT>a-&gt;m</TT> row, change the return 
type from "<TT>U&amp;</TT>" to "<TT>U&amp;</TT> if <TT>X</TT> is mutable, 
otherwise <TT>const U&amp;</TT>". </P>
<P><I>[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.&nbsp; Note that issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#180">180</A> 
has already been declared NAD Future for that very reason.]</I></P>
<P><I>[Redmond: the LWG thinks this is separable from other constness issues. 
This issue is just cleanup; it clarifies language that was written before we had 
iterator_traits. Proposed resolution was modified: the original version only 
discussed *a. It was pointed out that we also need to worry about *r++ and 
a-&gt;m.]</I></P>
<HR>
<A name=202>
<H3>202.&nbsp;unique() effects unclear when predicate not an equivalence 
relation</H3></A>
<P><B>Section:</B>&nbsp;25.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.unique">[lib.alg.unique]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrew Koenig&nbsp; <B>Date:</B>&nbsp;13 Jan 2000</P>
<P>What should unique() do if you give it a predicate that is not an equivalence 
relation? There are at least two plausible answers: </P>
<BLOCKQUOTE>
  <P>1. You can't, because 25.2.8 says that it it "eliminates all but the first 
  element from every consecutive group of equal elements..." and it wouldn't 
  make sense to interpret "equal" as meaning anything but an equivalence 
  relation. [It also doesn't make sense to interpret "equal" as meaning ==, 
  because then there would never be any sense in giving a predicate as an 
  argument at all.] </P>
  <P>2. The word "equal" should be interpreted to mean whatever the predicate 
  says, even if it is not an equivalence relation (and in particular, even if it 
  is not transitive). </P></BLOCKQUOTE>
<P>The example that raised this question is from Usenet: </P>
<BLOCKQUOTE><PRE>int f[] = { 1, 3, 7, 1, 2 };
int* z = unique(f, f+5, greater&lt;int&gt;());</PRE></BLOCKQUOTE>
<P>If one blindly applies the definition using the predicate greater&lt;int&gt;, 
and ignore the word "equal", you get: </P>
<BLOCKQUOTE>
  <P>Eliminates all but the first element from every consecutive group of 
  elements referred to by the iterator i in the range [first, last) for which *i 
  &gt; *(i - 1). </P></BLOCKQUOTE>
<P>The first surprise is the order of the comparison. If we wanted to allow for 
the predicate not being an equivalence relation, then we should surely compare 
elements the other way: pred(*(i - 1), *i). If we do that, then the description 
would seem to say: "Break the sequence into subsequences whose elements are in 
strictly increasing order, and keep only the first element of each subsequence". 
So the result would be 1, 1, 2. If we take the description at its word, it would 
seem to call for strictly DEcreasing order, in which case the result should be 
1, 3, 7, 2.<BR><BR>In fact, the SGI implementation of unique() does neither: It 
yields 1, 3, 7. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 25.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.unique">[lib.alg.unique]</A> 
paragraph 1 to:</P>
<BLOCKQUOTE>For a nonempty range, eliminates all but the first element from 
  every consecutive group of equivalent elements referred to by the iterator 
  <TT>i</TT> in the range [first+1, last) for which the following conditions 
  hold: <TT>*(i-1) == *i</TT> or <TT>pred(*(i-1), *i) != false</TT>. </BLOCKQUOTE>
<P>Also insert a new paragraph, paragraph 2a, that reads: "Requires: The 
comparison function must be an equivalence relation." </P>
<P><I>[Redmond: discussed arguments for and against requiring the comparison 
function to be an equivalence relation. Straw poll: 14-2-5. First number is to 
require that it be an equivalence relation, second number is to explicitly not 
require that it be an equivalence relation, third number is people who believe 
they need more time to consider the issue. A separate issue: Andy Sawyer 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.]</I></P>
<P><I>[Curaao: 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.]</I></P>
<P><B>Rationale:</B></P>
<P>The LWG also considered an alternative resolution: change 25.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.unique">[lib.alg.unique]</A> 
paragraph 1 to:</P>
<BLOCKQUOTE>For a nonempty range, eliminates all but the first element from 
  every consecutive group of elements referred to by the iterator <TT>i</TT> in 
  the range (first, last) for which the following conditions hold: <TT>*(i-1) == 
  *i</TT> or <TT>pred(*(i-1), *i) != false</TT>. </BLOCKQUOTE>
<P>Also insert a new paragraph, paragraph 1a, that reads: "Notes: The comparison 
function need not be an equivalence relation." </P>
<P>Informally: the proposed resolution imposes an explicit requirement that the 
comparison function be an equivalence relation. The alternative resolution does 
not, and it gives enough information so that the behavior of unique() for a 
non-equivalence relation is specified. Both resolutions are consistent with the 
behavior of existing implementations.</P>
<HR>
<A name=208>
<H3>208.&nbsp;Unnecessary restriction on past-the-end iterators</H3></A>
<P><B>Section:</B>&nbsp;24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Stephen Cleary&nbsp; <B>Date:</B>&nbsp;02 Feb 2000</P>
<P>In 24.1 paragraph 5, it is stated ". . . Dereferenceable and past-the-end 
values are always non-singular."</P>
<P>This places an unnecessary restriction on past-the-end iterators for 
containers with forward iterators (for example, a singly-linked list). If the 
past-the-end value on such a container was a well-known singular value, it would 
still satisfy all forward iterator requirements.</P>
<P>Removing this restriction would allow, for example, a singly-linked list 
without a "footer" node.</P>
<P>This would have an impact on existing code that expects past-the-end 
iterators obtained from different (generic) containers being not equal.</P>
<P><B>Proposed resolution:</B></P>
<P>Change 24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A> 
paragraph 5, the last sentence, from:</P>
<BLOCKQUOTE>
  <P>Dereferenceable and past-the-end values are always 
non-singular.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Dereferenceable values are always non-singular.&nbsp;</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>For some kinds of containers, including singly linked lists and zero-length 
vectors, null pointers are perfectly reasonable past-the-end iterators. Null 
pointers are singular. </P>
<HR>
<A name=209>
<H3>209.&nbsp;basic_string declarations inconsistent</H3></A>
<P><B>Section:</B>&nbsp;21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Igor Stauder&nbsp; <B>Date:</B>&nbsp;11 Feb 2000</P>
<P>In Section 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A> 
the basic_string member function declarations use a consistent style except for 
the following functions:</P>
<BLOCKQUOTE><PRE>void push_back(const charT);
basic_string&amp; assign(const basic_string&amp;);
void swap(basic_string&lt;charT,traits,Allocator&gt;&amp;);</PRE></BLOCKQUOTE>
<P>- push_back, assign, swap: missing argument name&nbsp;<BR>- push_back: use of 
const with charT (i.e. POD type passed by value not by reference - should be 
charT or const charT&amp; )<BR>- swap: redundant use of template parameters in 
argument basic_string&lt;charT,traits,Allocator&gt;&amp;</P>
<P><B>Proposed resolution:</B></P>
<P>In Section 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A> 
change the basic_string member function declarations push_back, assign, and swap 
to:</P>
<BLOCKQUOTE><PRE>void push_back(charT c); 

basic_string&amp; assign(const basic_string&amp; str);
void swap(basic_string&amp; str);</PRE></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Although the standard is in general not consistent in declaration style, the 
basic_string declarations are consistent other than the above. The LWG felt that 
this was sufficient reason to merit the change. </P>
<HR>
<A name=210>
<H3>210.&nbsp;distance first and last confused</H3></A>
<P><B>Section:</B>&nbsp;25 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.algorithms">[lib.algorithms]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Lisa Lippincott&nbsp; <B>Date:</B>&nbsp;15 Feb 2000</P>
<P>In paragraph 9 of section 25 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.algorithms">[lib.algorithms]</A>, 
it is written:</P>
<BLOCKQUOTE>
  <P>In the description of the algorithms operators + and - are used for some of 
  the iterator categories for which they do not have to be defined. In these 
  cases the semantics of [...] a-b is the same as 
  of<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; <TT>return distance(a, 
b);</TT></P></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>On the last line of paragraph 9 of section 25 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.algorithms">[lib.algorithms]</A> 
change <TT>"a-b"</TT> to <TT>"b-a".</TT></P>
<P><B>Rationale:</B></P>
<P>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.</P>
<HR>
<A name=211>
<H3>211.&nbsp;operator&gt;&gt;(istream&amp;, string&amp;) doesn't set 
failbit</H3></A>
<P><B>Section:</B>&nbsp;21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Scott Snyder&nbsp; <B>Date:</B>&nbsp;4 Feb 2000</P>
<P>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 
stream.</P>
<P>This implies that the typical construction</P>
<BLOCKQUOTE><PRE>std::istream is;
std::string str;
...
while (is &gt;&gt; str) ... ;</PRE></BLOCKQUOTE>
<P>(which tests failbit) is not required to terminate at EOF.</P>
<P>Furthermore, this is inconsistent with other extraction operators, which do 
include this requirement. (See sections 27.6.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted">[lib.istream.formatted]</A> 
and 27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>), 
where this requirement is present, either explicitly or implicitly, for the 
extraction operators. It is also present explicitly in the description of 
getline (istream&amp;, string&amp;, charT) in section 21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A> 
paragraph 8.)</P>
<P><B>Proposed resolution:</B></P>
<P>Insert new paragraph after paragraph 2 in section 21.3.7.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.io">[lib.string.io]</A>:</P>
<BLOCKQUOTE>
  <P>If the function extracts no characters, it calls is.setstate(ios::failbit) 
  which may throw ios_base::failure (27.4.4.3).</P></BLOCKQUOTE>
<HR>
<A name=212>
<H3>212.&nbsp;Empty range behavior unclear for several algorithms</H3></A>
<P><B>Section:</B>&nbsp;25.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.min.max">[lib.alg.min.max]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nico Josuttis&nbsp; <B>Date:</B>&nbsp;26 Feb 2000</P>
<P>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().</P>
<P><B>Proposed resolution:</B></P>
<P>In 25.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.min.max">[lib.alg.min.max]</A> 
- Minimum and maximum, paragraphs 7 and 9, append: Returns last if 
first==last.</P>
<P><B>Rationale:</B></P>
<P>The LWG looked in some detail at all of the above mentioned algorithms, but 
believes that except for min_element() and max_element() it is already clear 
that last is returned if first == last.</P>
<HR>
<A name=214>
<H3>214.&nbsp;set::find() missing const overload</H3></A>
<P><B>Section:</B>&nbsp;23.3.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.set">[lib.set]</A>, 
23.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.multiset">[lib.multiset]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;28 Feb 2000</P>
<P>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 container descriptions have two overloaded 
versions of find, but set and multiset do not, all they have is:</P>
<BLOCKQUOTE><PRE>iterator find(const key_type &amp; x) const;</PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Change the prototypes for find(), lower_bound(), upper_bound(), and 
equal_range() in section 23.3.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.set">[lib.set]</A> 
and section 23.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.multiset">[lib.multiset]</A> 
to each have two overloads:</P>
<BLOCKQUOTE><PRE>iterator find(const key_type &amp; x);
const_iterator find(const key_type &amp; x) const;</PRE><PRE>iterator lower_bound(const key_type &amp; x);
const_iterator lower_bound(const key_type &amp; x) const;</PRE><PRE>iterator upper_bound(const key_type &amp; x);
const_iterator upper_bound(const key_type &amp; x) const;</PRE><PRE>pair&lt;iterator, iterator&gt; equal_range(const key_type &amp; x);
pair&lt;const_iterator, const_iterator&gt; equal_range(const key_type &amp; x) const;</PRE></BLOCKQUOTE>
<P><I>[Tokyo: At the request of the LWG, Judy Ward provided wording extending 
the proposed resolution to lower_bound, upper_bound, and equal_range.]</I></P>
<HR>
<A name=217>
<H3>217.&nbsp;Facets example (Classifying Japanese characters) contains 
errors</H3></A>
<P><B>Section:</B>&nbsp;22.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facets.examples">[lib.facets.examples]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;29 Feb 2000</P>
<P>The example in 22.2.8, paragraph 11 contains the following errors:</P>
<P>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 
which which is what std::use_facet&lt;&gt;() returns).</P>
<P>2) In file filt.C, the definition of `JCtype::id' must be qualified with the 
name of the namespace `My'.</P>
<P>3) In the definition of `loc' and subsequently in the call to 
use_facet&lt;&gt;() in main(), the name of the facet is misspelled: it should 
read `My::JCtype' rather than `My::JCType'.</P>
<P><B>Proposed resolution:</B></P>
<P>Replace the "Classifying Japanese characters" example in 22.2.8, paragraph 11 
with the following:</P><PRE>#include &lt;locale&gt;</PRE><PRE>namespace My {
    using namespace std;
    class JCtype : public locale::facet {
    public:
        static locale::id id;     //  required for use as a new locale facet
        bool is_kanji (wchar_t c) const;
        JCtype() {}
    protected:
        ~JCtype() {}
    };
}</PRE><PRE>//  file:  filt.C
#include &lt;iostream&gt;
#include &lt;locale&gt;
#include "jctype"                 //  above
std::locale::id My::JCtype::id;   //  the static  JCtype  member
declared above.</PRE><PRE>int main()
{
    using namespace std;
    typedef ctype&lt;wchar_t&gt; wctype;
    locale loc(locale(""),              //  the user's preferred locale...
               new My::JCtype);         //  and a new feature ...
    wchar_t c = use_facet&lt;wctype&gt;(loc).widen('!');
    if (!use_facet&lt;My::JCtype&gt;(loc).is_kanji(c))
        cout &lt;&lt; "no it isn't!" &lt;&lt; endl;
    return 0;
}</PRE>
<HR>
<A name=220>
<H3>220.&nbsp;~ios_base() usage valid?</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios.base.cons">[lib.ios.base.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Jonathan Schilling, Howard Hinnant&nbsp; 
<B>Date:</B>&nbsp;13 Mar 2000</P>
<P>The pre-conditions for the ios_base destructor are described in 27.4.2.7 
paragraph 2:</P>
<BLOCKQUOTE>
  <P>Effects: Destroys an object of class ios_base. Calls each registered 
  callback pair (fn,index) (27.4.2.6) as (*fn)(erase_event,*this,index) at such 
  time that any ios_base member function called from within fn has well defined 
  results.</P></BLOCKQUOTE>
<P>But what is not clear is: If no callback functions were ever registered, does 
it matter whether the ios_base members were ever initialized?</P>
<P>For instance, does this program have defined behavior:</P>
<BLOCKQUOTE><PRE>#include &lt;ios&gt;</PRE><PRE>class D : public std::ios_base { };</PRE><PRE>int main() { D d; }</PRE></BLOCKQUOTE>
<P>It seems that registration of a callback function would surely affect the 
state of an ios_base. That is, when you register a callback function with an 
ios_base, the ios_base must record that fact somehow.</P>
<P>But if after construction the ios_base is in an indeterminate state, and that 
state is not made determinate before the destructor is called, then how would 
the destructor know if any callbacks had indeed been registered? And if the 
number of callbacks that had been registered is indeterminate, then is not the 
behavior of the destructor undefined?</P>
<P>By comparison, the basic_ios class description in 27.4.4.1 paragraph 2 makes 
it explicit that destruction before initialization results in undefined 
behavior.</P>
<P><B>Proposed resolution:</B></P>
<P>Modify 27.4.2.7 paragraph 1 from</P>
<BLOCKQUOTE>
  <P>Effects: Each ios_base member has an indeterminate value after 
  construction.</P></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
  <P>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.</P></BLOCKQUOTE>
<HR>
<A name=221>
<H3>221.&nbsp;num_get&lt;&gt;::do_get stage 2 processing broken</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;14 Mar 2000</P>
<P>Stage 2 processing of numeric conversion is broken.</P>
<P>Table 55 in 22.2.2.1.2 says that when basefield is 0 the integral conversion 
specifier is %i. A %i specifier determines a number's base by its prefix (0 for 
octal, 0x for hex), so the intention is clearly that a 0x prefix is allowed. 
Paragraph 8 in the same section, however, describes very precisely how 
characters are processed. (It must be done "as if" by a specified code 
fragment.) That description does not allow a 0x prefix to be recognized.</P>
<P>Very roughly, stage 2 processing reads a char_type ct. It converts ct to a 
char, not by using narrow but by looking it up in a translation table that was 
created by widening the string literal "0123456789abcdefABCDEF+-". The character 
"x" is not found in that table, so it can't be recognized by stage 2 
processing.</P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.1.2 paragraph 8, replace the line:</P>
<BLOCKQUOTE><PRE>static const char src[] = "0123456789abcdefABCDEF+-";</PRE></BLOCKQUOTE>
<P>with the line:</P>
<BLOCKQUOTE><PRE>static const char src[] = "0123456789abcdefxABCDEFX+-";</PRE></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>If we're using the technique of widening a string literal, the string literal 
must contain every character we wish to recognize. 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.</P>
<HR>
<A name=222>
<H3>222.&nbsp;Are throw clauses necessary if a throw is already implied by the 
effects clause?</H3></A>
<P><B>Section:</B>&nbsp;17.3.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.structure.specifications">[lib.structure.specifications]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;17 Mar 2000</P>
<P>Section 21.3.6.8 describes the basic_string::compare function this way:</P>
<BLOCKQUOTE><PRE>21.3.6.8 - basic_string::compare [lib.string::compare]

int compare(size_type pos1, size_type n1,
                const basic_string&lt;charT,traits,Allocator&gt;&amp;  str ,
                size_type  pos2 , size_type  n2 ) const;

-4- Returns: 

    basic_string&lt;charT,traits,Allocator&gt;(*this,pos1,n1).compare(
                 basic_string&lt;charT,traits,Allocator&gt;(str,pos2,n2)) .</PRE></BLOCKQUOTE>
<P>and the constructor that's implicitly called by the above is defined to throw 
an out-of-range exception if pos &gt; str.size(). See section 21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A> 
paragraph 4.</P>
<P>On the other hand, the compare function descriptions themselves don't have 
"Throws: " clauses and according to 17.3.1.3, paragraph 3, elements that do not 
apply to a function are omitted.</P>
<P>So it seems there is an inconsistency in the standard -- are the "Effects" 
clauses correct, or are the "Throws" clauses missing?</P>
<P><B>Proposed resolution:</B></P>
<P>In 17.3.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.structure.specifications">[lib.structure.specifications]</A> 
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:</P>
<BLOCKQUOTE>
  <P>To save space, items that do not apply to a function are omitted. For 
  example, if a function does not specify any further preconditions, there will 
  be no "Requires" paragraph.</P></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The standard is somewhat inconsistent, but a failure to note a throw 
condition in a throws clause does not grant permission not to throw. The 
inconsistent wording is in a footnote, and thus non-normative. The proposed 
resolution from the LWG clarifies the footnote.</P>
<HR>
<A name=223>
<H3>223.&nbsp;reverse algorithm should use iter_swap rather than swap</H3></A>
<P><B>Section:</B>&nbsp;25.2.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.reverse">[lib.alg.reverse]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dave Abrahams&nbsp; <B>Date:</B>&nbsp;21 Mar 2000</P>
<P>Shouldn't the effects say "applies iter_swap to all pairs..."?</P>
<P><B>Proposed resolution:</B></P>
<P>In 25.2.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.reverse">[lib.alg.reverse]</A>, 
replace:</P>
<BLOCKQUOTE>Effects: For each non-negative integer i &lt;= (last - first)/2, 
  applies swap to all pairs of iterators first + i, (last - i) - 1. </BLOCKQUOTE>
<P>with:</P>
<BLOCKQUOTE>Effects: For each non-negative integer i &lt;= (last - first)/2, 
  applies iter_swap to all pairs of iterators first + i, (last - i) - 1. 
</BLOCKQUOTE>
<HR>
<A name=224>
<H3>224.&nbsp;clear() complexity for associative containers refers to undefined 
N</H3></A>
<P><B>Section:</B>&nbsp;23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Ed Brey&nbsp; <B>Date:</B>&nbsp;23 Mar 2000</P>
<P>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.</P>
<P><B>Proposed resolution:</B></P>
<P>In the associative container requirements table in 23.1.2 paragraph 7, the 
complexity of a.clear(), change "log(size()) + N" to "linear in 
<TT>size()</TT>".</P>
<P><B>Rationale:</B></P>
<P>It's the "log(size())", not the "N", that is in error: there's no difference 
between <I>O(N)</I> and <I>O(N + log(N))</I>. The text in the standard is 
probably an incorrect cut-and-paste from the range version of 
<TT>erase</TT>.</P>
<HR>
<A name=225>
<H3>225.&nbsp;std:: algorithms use of other unqualified algorithms</H3></A>
<P><B>Section:</B>&nbsp;17.4.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.global.functions">[lib.global.functions]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dave Abrahams&nbsp; <B>Date:</B>&nbsp;01 Apr 2000</P>
<P>Are algorithms in std:: allowed to use other algorithms without 
qualification, so functions in user namespaces might be found through Koenig 
lookup?</P>
<P>For example, a popular standard library implementation includes this 
implementation of std::unique:</P>
<BLOCKQUOTE><PRE>namespace std {
    template &lt;class _ForwardIter&gt;
    _ForwardIter unique(_ForwardIter __first, _ForwardIter __last) {
      __first = adjacent_find(__first, __last);
      return unique_copy(__first, __last, __first);
    }
    }</PRE></BLOCKQUOTE>
<P>Imagine two users on opposite sides of town, each using unique on his own 
sequences bounded by my_iterators . User1 looks at his standard library 
implementation and says, "I know how to implement a more efficient unique_copy 
for my_iterators", and writes:</P>
<BLOCKQUOTE><PRE>namespace user1 {
    class my_iterator;
    // faster version for my_iterator
    my_iterator unique_copy(my_iterator, my_iterator, my_iterator);
    }</PRE></BLOCKQUOTE>
<P>user1::unique_copy() is selected by Koenig lookup, as he intended.</P>
<P>User2 has other needs, and writes:</P>
<BLOCKQUOTE><PRE>namespace user2 {
    class my_iterator;
    // Returns true iff *c is a unique copy of *a and *b.
    bool unique_copy(my_iterator a, my_iterator b, my_iterator c);
    }</PRE></BLOCKQUOTE>
<P>User2 is shocked to find later that his fully-qualified use of 
std::unique(user2::my_iterator, user2::my_iterator, user2::my_iterator) fails to 
compile (if he's lucky). Looking in the standard, he sees the following Effects 
clause for unique():</P>
<BLOCKQUOTE>
  <P>Effects: Eliminates all but the first element from every consecutive group 
  of equal elements referred to by the iterator i in the range [first, last) for 
  which the following corresponding conditions hold: *i == *(i - 1) or pred(*i, 
  *(i - 1)) != false</P></BLOCKQUOTE>
<P>The standard gives user2 absolutely no reason to think he can interfere with 
std::unique by defining names in namespace user2. His standard library has been 
built with the template export feature, so he is unable to inspect the 
implementation. User1 eventually compiles his code with another compiler, and 
his version of unique_copy silently stops being called. Eventually, he realizes 
that he was depending on an implementation detail of his library and had no 
right to expect his unique_copy() to be called portably.</P>
<P>On the face of it, and given above scenario, it may seem obvious that the 
implementation of unique() shown is non-conforming because it uses unique_copy() 
rather than ::std::unique_copy(). Most standard library implementations, 
however, seem to disagree with this notion.</P>
<P><I>[Tokyo:&nbsp; Steve Adamczyk from the core working group indicates that 
"std::" is sufficient;&nbsp; leading "::" qualification is not required because 
any namespace qualification is sufficient to suppress Koenig lookup.]</I></P>
<P><B>Proposed resolution:</B></P>
<P>Add a paragraph and a note at the end of 17.4.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.global.functions">[lib.global.functions]</A>:</P>
<BLOCKQUOTE>
  <P>Unless otherwise specified, no global or non-member function in the 
  standard library shall use a function from another namespace which is found 
  through <I>argument-dependent name lookup</I> (3.4.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/basic.html#basic.lookup.koenig">[basic.lookup.koenig]</A>).</P>
  <P>[Note: the phrase "unless otherwise specified" is intended to allow Koenig 
  lookup in cases like that of ostream_iterators:<BR><BR>Effects:</P>
  <BLOCKQUOTE>
    <P>*out_stream &lt;&lt; value;<BR>if(delim != 0) *out_stream &lt;&lt; 
    delim;<BR>return (*this);</P>
    <P>--end note]</P></BLOCKQUOTE></BLOCKQUOTE>
<P><I>[Tokyo: The LWG agrees that this is a defect in the standard, but 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#229">229</A> 
accordingly. Any resolution of issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#225">225</A> 
should be coordinated with the resolution of issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#229">229</A>.]</I></P>
<P><I>[Toronto: The LWG is not sure if this is a defect in the standard. Most 
LWG members believe that an implementation of <TT>std::unique</TT> like the one 
quoted in this issue is already illegal, since, under certain circumstances, its 
semantics are not those specified in the standard. The standard's description of 
<TT>unique</TT> does not say that overloading <TT>adjacent_find</TT> should have 
any effect.]</I></P>
<P><I>[Curaao: 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 (separate) discussions of this plan the next day. 
The proposed resolution for this issue is in accordance with Howard's 
paper.]</I></P>
<P><B>Rationale:</B></P>
<P>It could be argued that this proposed isn't strictly necessary, that the 
Standard doesn't grant implementors license to write a standard function that 
behaves differently than specified in the Standard just because of an unrelated 
user-defined name in some 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#226">226</A> 
deals with the question of when it is appropriate for the standard to explicitly 
specify otherwise.</P>
<HR>
<A name=226>
<H3>226.&nbsp;User supplied specializations or overloads of namespace std 
function templates</H3></A>
<P><B>Section:</B>&nbsp;17.4.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.reserved.names">[lib.reserved.names]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dave Abrahams&nbsp; <B>Date:</B>&nbsp;01 Apr 2000</P>
<P>The issues are:&nbsp;</P>
<P>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?&nbsp;</P>
<P>2. How can another library implementor (lib2) write a generic algorithm which 
will take advantage of the specialized algorithm in lib1?</P>
<P>This appears to be the only viable answer under current language rules:</P>
<BLOCKQUOTE><PRE>namespace lib1
{
    // arbitrary-precision numbers using T as a basic unit
    template &lt;class T&gt;
    class big_num { //...
    };
    </PRE><PRE>    // defining this in namespace std is illegal (it would be an
    // overload), so we hope users will rely on Koenig lookup
    template &lt;class T&gt;
    void swap(big_int&lt;T&gt;&amp;, big_int&lt;T&gt;&amp;);
}</PRE><PRE>#include &lt;algorithm&gt;
namespace lib2
{
    template &lt;class T&gt;
    void generic_sort(T* start, T* end)
    {
            ...
        // using-declaration required so we can work on built-in types
        using std::swap;
        // use Koenig lookup to find specialized algorithm if available
        swap(*x, *y);
    }
}</PRE></BLOCKQUOTE>
<P>This answer has some drawbacks. First of all, it makes writing lib2 difficult 
and somewhat slippery. The implementor needs to remember to write the 
using-declaration, or generic_sort will fail to compile when T is a built-in 
type. The second drawback is that the use of this style in lib2 effectively 
"reserves" names in any namespace which defines types which may 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#225">225</A>).</P>
<P>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:</P>
<BLOCKQUOTE><PRE>namespace std
{
    template &lt;class T&gt;
    void swap(lib1::big_int&lt;T&gt;&amp;, lib1::big_int&lt;T&gt;&amp;);
}</PRE></BLOCKQUOTE>
<P>You have just overloaded std::swap, which is illegal under the current 
language rules. On the other hand, the following full specialization is 
legal:</P>
<BLOCKQUOTE><PRE>namespace std
{
    template &lt;&gt;
    void swap(lib1::other_type&amp;, lib1::other_type&amp;);
}</PRE></BLOCKQUOTE>
<P>This issue reflects concerns raised by the "Namespace issue with specialized 
swap" thread on comp.lang.c++.moderated. A similar set of concerns was earlier 
raised on the boost.org mailing list and the ACCU-general mailing list. Also see 
library reflector message c++std-lib-7354.</P>
<P>J. C. van Winkel points out (in c++std-lib-9565) another unexpected fact: 
it's impossible to output a container of std::pair's using copy and an 
ostream_iterator, as long as both pair-members are built-in or std:: types. 
That's because a user-defined operator&lt;&lt; for (for example) 
std::pair&lt;const std::string, int&gt; will not be found: lookup for 
operator&lt;&lt; will be performed only in namespace std. Opinions differed on 
whether or not this was a defect, and, if so, whether the defect is that 
something is wrong with user-defined functionality and std, or whether it's that 
the standard library does not provide an operator&lt;&lt; for std::pair&lt;&gt;. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Adopt the wording proposed in Howard Hinnant's paper N1523=03-0106, "Proposed 
Resolution To LWG issues 225, 226, 229".</P>
<P><I>[Tokyo: Summary, "There is no conforming way to extend std::swap for user 
defined templates."&nbsp; The LWG agrees that there is a problem. Would like 
more information before proceeding. This may be a core issue. Core issue 229 has 
been opened to discuss the core aspects of this problem. It was also noted that 
submissions regarding this issue have been received from several sources, but 
too late to be integrated into the issues list. ]</I></P>
<P><I>[Post-Tokyo: A paper with several proposed resolutions, 
J16/00-0029==WG21/N1252, "Shades of namespace std functions " by Alan Griffiths, 
is in the Post-Tokyo mailing. It should be considered a part of this 
issue.]</I></P>
<P><I>[Toronto: Dave Abrahams and Peter Dimov have proposed a resolution that 
involves core changes: it would add partial specialization of function template. 
The Core Working Group is reluctant to add partial specialization of function 
templates. It is viewed as a large change, CWG believes that proposal presented 
leaves some syntactic issues unanswered; if the CWG does add partial 
specialization of function templates, it wishes to develop its own proposal. The 
LWG continues to believe that there is a serious problem: there is no good way 
for users to force the library to use user specializations of generic standard 
library functions, and in certain cases (e.g. transcendental functions called by 
<TT>valarray</TT> and <TT>complex</TT>) this is important. Koenig lookup isn't 
adequate, since names within the library must be qualified with <TT>std</TT> 
(see issue 225), specialization doesn't work (we don't have partial 
specialization of function templates), and users aren't permitted to add 
overloads within namespace std. ]</I></P>
<P><I>[Copenhagen: Discussed at length, with no consensus. Relevant papers in 
the pre-Copenhagen mailing: N1289, N1295, N1296. Discussion focused on four 
options. (1) Relax restrictions on overloads within namespace std. (2) Mandate 
that the standard library use unqualified calls for <TT>swap</TT> and possibly 
other functions. (3) Introduce helper class templates for <TT>swap</TT> and 
possibly other functions. (4) Introduce partial specialization of function 
templates. Every option had both support and opposition. Straw poll (first 
number is support, second is strongly opposed): (1) 6, 4; (2) 6, 7; (3) 3, 8; 
(4) 4, 4.]</I></P>
<P><I>[Redmond: Discussed, again no consensus. Herb presented an argument that a 
user who is defining a type <TT>T</TT> with an associated <TT>swap</TT> should 
not be expected to put that <TT>swap</TT> in namespace std, either by 
overloading or by partial specialization. The argument is that <TT>swap</TT> is 
part of <TT>T</TT>'s interface, and thus should to in the same namespace as 
<TT>T</TT> and only in that namespace. If we accept this argument, the 
consequence is that standard library functions should use unqualified call of 
<TT>swap</TT>. (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.]</I></P>
<P><I>[Curaao: 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 (separate) discussions of this plan the next day. 
The proposed resolution is the one proposed by Howard.]</I></P>
<P><I>[Santa Cruz: the LWG agreed with the general direction of Howard's paper, 
N1387. (Roughly: Koenig lookup is disabled unless we say otherwise; this issue 
is about when we do say otherwise.) However, there were concerns about wording. 
Howard will provide new wording. Bill and Jeremy will review it.]</I></P>
<P><I>[Kona: Howard proposed the new wording. The LWG accepted his proposed 
resolution.]</I></P>
<P><B>Rationale:</B></P>
<P>Informally: introduce a Swappable concept, and specify that the value types 
of the iterators passed to certain standard algorithms (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 <TT>swap</TT>. Also, in 26.3.3.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.valarray.transcend">[lib.valarray.transcend]</A> 
paragraph 1, state that the valarray transcendentals use unqualified lookup.</P>
<HR>
<A name=227>
<H3>227.&nbsp;std::swap() should require CopyConstructible or 
DefaultConstructible arguments</H3></A>
<P><B>Section:</B>&nbsp;25.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.swap">[lib.alg.swap]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#TC">TC</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dave Abrahams&nbsp; <B>Date:</B>&nbsp;09 Apr 2000</P>
<P>25.2.2 reads:</P>
<BLOCKQUOTE>
  <P><TT>template&lt;class T&gt; void swap(T&amp; a, T&amp; 
  b);</TT><BR><BR>Requires: Type T is Assignable 
  (_lib.container.requirements_).<BR>Effects: Exchanges values stored in two 
  locations.</P></BLOCKQUOTE>
<P>The only reasonable** generic implementation of swap requires construction of 
a new temporary copy of one of its arguments:</P>
<BLOCKQUOTE><PRE>template&lt;class T&gt; void swap(T&amp; a, T&amp; b);
  {
      T tmp(a);
      a = b;
      b = tmp;
  }</PRE></BLOCKQUOTE>
<P>But a type which is only Assignable cannot be swapped by this 
implementation.</P>
<P>**Yes, there's also an unreasonable implementation which would require T to 
be DefaultConstructible instead of CopyConstructible. I don't think this is 
worthy of consideration:</P>
<BLOCKQUOTE><PRE>template&lt;class T&gt; void swap(T&amp; a, T&amp; b);
{
    T tmp;
    tmp = a;
    a = b;
    b = tmp;
}</PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Change 25.2.2 paragraph 1 from:</P>
<BLOCKQUOTE>
  <P>Requires: Type T is Assignable (23.1).</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Requires: Type T is CopyConstructible (20.1.3) and Assignable 
(23.1)</P></BLOCKQUOTE>
<HR>
<A name=228>
<H3>228.&nbsp;Incorrect specification of "..._byname" facets</H3></A>
<P><B>Section:</B>&nbsp;22.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.categories">[lib.locale.categories]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;20 Apr 2000</P>
<P>The sections 22.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname">[lib.locale.ctype.byname]</A>, 
22.2.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname.special">[lib.locale.ctype.byname.special]</A>, 
22.2.1.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.byname">[lib.locale.codecvt.byname]</A>, 
22.2.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.numpunct.byname">[lib.locale.numpunct.byname]</A>, 
22.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.collate.byname">[lib.locale.collate.byname]</A>, 
22.2.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.time.put.byname">[lib.locale.time.put.byname]</A>, 
22.2.6.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.moneypunct.byname">[lib.locale.moneypunct.byname]</A>, 
and 22.2.7.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.messages.byname">[lib.locale.messages.byname]</A> 
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 functions because the 
functional part of the facets is actually implemented in the corresponding base 
classes and the constructor of the "..._byname" version just provides suitable 
date used by these implementations. For example, the 'numpunct' methods just 
return values from a struct. The base class uses a statically initialized struct 
while the derived version reads the contents of this struct from a table. 
However, no virtual function is defined in 'numpunct_byname'.</P>
<P>For most classes this does not impose a problem but specifically for 'ctype' 
it does: The specialization for 'ctype_byname&lt;char&gt;' is required because 
otherwise the semantics would change due to the virtual functions defined in the 
general version for 'ctype_byname': In 'ctype&lt;char&gt;' the method 'do_is()' 
is not virtual but it is made virtual in both 'ctype&lt;cT&gt;' and 
'ctype_byname&lt;cT&gt;'. Thus, a class derived from 'ctype_byname&lt;char&gt;' 
can tell whether this class is specialized or not under the current 
specification: Without the specialization, 'do_is()' is virtual while with 
specialization it is not virtual.</P>
<P><B>Proposed resolution:</B></P>
<P>&nbsp; Change section 22.2.1.2 (lib.locale.ctype.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT&gt;
       class ctype_byname : public ctype&lt;charT&gt; {
       public:
         typedef ctype&lt;charT&gt;::mask mask;
         explicit ctype_byname(const char*, size_t refs = 0);
       protected:
        ~ctype_byname();             //  virtual
       };
     }</PRE>
<P>&nbsp; Change section 22.2.1.6 (lib.locale.codecvt.byname) to become:</P><PRE>    namespace std {
      template &lt;class internT, class externT, class stateT&gt;
      class codecvt_byname : public codecvt&lt;internT, externT, stateT&gt; {
      public:
       explicit codecvt_byname(const char*, size_t refs = 0);
      protected:
      ~codecvt_byname();             //  virtual
       };
     }
</PRE>
<P>&nbsp; Change section 22.2.3.2 (lib.locale.numpunct.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT&gt;
       class numpunct_byname : public numpunct&lt;charT&gt; {
     //  this class is specialized for  char  and  wchar_t.
       public:
         typedef charT                char_type;
         typedef basic_string&lt;charT&gt;  string_type;
         explicit numpunct_byname(const char*, size_t refs = 0);
       protected:
        ~numpunct_byname();          //  virtual
       };
     }</PRE>
<P>&nbsp; Change section 22.2.4.2 (lib.locale.collate.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT&gt;
       class collate_byname : public collate&lt;charT&gt; {
       public:
         typedef basic_string&lt;charT&gt; string_type;
         explicit collate_byname(const char*, size_t refs = 0);
       protected:
        ~collate_byname();           //  virtual
       };
     }</PRE>
<P>&nbsp; Change section 22.2.5.2 (lib.locale.time.get.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT, class InputIterator = istreambuf_iterator&lt;charT&gt; &gt;
       class time_get_byname : public time_get&lt;charT, InputIterator&gt; {
       public:
         typedef time_base::dateorder dateorder;
         typedef InputIterator        iter_type</PRE><PRE>         explicit time_get_byname(const char*, size_t refs = 0);
       protected:
        ~time_get_byname();          //  virtual
       };
     }</PRE>
<P>&nbsp; Change section 22.2.5.4 (lib.locale.time.put.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT, class OutputIterator = ostreambuf_iterator&lt;charT&gt; &gt;
       class time_put_byname : public time_put&lt;charT, OutputIterator&gt;
       {
       public:
         typedef charT          char_type;
         typedef OutputIterator iter_type;</PRE><PRE>         explicit time_put_byname(const char*, size_t refs = 0);
       protected:
        ~time_put_byname();          //  virtual
       };
     }"</PRE>
<P>&nbsp; Change section 22.2.6.4 (lib.locale.moneypunct.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT, bool Intl = false&gt;
       class moneypunct_byname : public moneypunct&lt;charT, Intl&gt; {
       public:
         typedef money_base::pattern pattern;
         typedef basic_string&lt;charT&gt; string_type;</PRE><PRE>         explicit moneypunct_byname(const char*, size_t refs = 0);
       protected:
        ~moneypunct_byname();        //  virtual
       };
     }</PRE>
<P>&nbsp; Change section 22.2.7.2 (lib.locale.messages.byname) to become:</P><PRE>     namespace std {
       template &lt;class charT&gt;
       class messages_byname : public messages&lt;charT&gt; {
       public:
         typedef messages_base::catalog catalog;
         typedef basic_string&lt;charT&gt;    string_type;</PRE><PRE>         explicit messages_byname(const char*, size_t refs = 0);
       protected:
        ~messages_byname();          //  virtual
       };
     }</PRE>
<P>Remove section 22.2.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.byname.special">[lib.locale.ctype.byname.special]</A> 
completely (because in this case only those members are defined to be virtual 
which are defined to be virtual in 'ctype&lt;cT&gt;'.)</P>
<P><I>[Post-Tokyo: Dietmar Khl submitted this issue at the request of the LWG 
to solve the underlying problems raised by issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#138">138</A>.]</I></P>
<P><I>[Copenhagen: proposed resolution was revised slightly, to remove three 
last virtual functions from <TT>messages_byname</TT>.]</I></P>
<HR>
<A name=229>
<H3>229.&nbsp;Unqualified references of other library entities</H3></A>
<P><B>Section:</B>&nbsp;17.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.contents">[lib.contents]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;19 Apr 2000</P>
<P>Throughout the library chapters, the descriptions of library entities refer 
to other library entities without necessarily qualifying the names.</P>
<P>For example, section 25.2.2 "Swap" describes the effect of swap_ranges in 
terms of the unqualified name "swap". This section could reasonably be 
interpreted to mean that the library must be implemented so as to do a lookup of 
the unqualified name "swap", allowing users to override any ::std::swap function 
when Koenig lookup applies.</P>
<P>Although it would have been best to use explicit qualification with "::std::" 
throughout, too many lines in the standard would have to be adjusted to make 
that change in a Technical Corrigendum.</P>
<P>Issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#182">182</A>, 
which addresses qualification of <TT>size_t</TT>, is a special case of this. 
</P>
<P><B>Proposed resolution:</B></P>
<P>To section 17.4.1.1 "Library contents" Add the following paragraph:</P>
<BLOCKQUOTE>
  <P>Whenever a name x defined in the standard library is mentioned, the name x 
  is assumed to be fully qualified as ::std::x, unless explicitly described 
  otherwise. For example, if the Effects section for library function F is 
  described as calling library function G, the function ::std::G is 
meant.</P></BLOCKQUOTE>
<P><I>[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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#225">225</A>. 
Any resolution of issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#225">225</A> 
should be coordinated with the resolution of this issue.]</I></P>
<P><I>[post-Toronto: Howard is undecided about whether it is appropriate for all 
standard library function names referred to in other standard library functions 
to be explicitly qualified by <TT>std</TT>: it is common advice that users 
should define global functions that operate on their class in the same namespace 
as the class, and this requires argument-dependent lookup if those functions are 
intended to be called by library code. Several LWG members are 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".]</I></P>
<P><I>[Curaao: 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 (separate) discussions of this plan the next day. 
This paper resolves issues 225 and 226. In light of that resolution, the 
proposed resolution for the current issue makes sense.]</I></P>
<HR>
<A name=230>
<H3>230.&nbsp;Assignable specified without also specifying 
CopyConstructible</H3></A>
<P><B>Section:</B>&nbsp;17 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.library">[lib.library]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Beman Dawes&nbsp; <B>Date:</B>&nbsp;26 Apr 2000</P>
<P>Issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#227">227</A> 
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.</P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.accumulate">[lib.accumulate]</A>.</P>
<P><B>Proposed resolution:</B></P>
<P>In 23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
table 65 for value_type: change "T is Assignable" to "T is CopyConstructible and 
Assignable" </P>
<P>In 23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A> 
table 69 X::key_type; change "Key is Assignable" to "Key is CopyConstructible 
and Assignable"<BR></P>
<P>In 24.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.output.iterators">[lib.output.iterators]</A> 
paragraph 1, change: </P>
<BLOCKQUOTE>
  <P>A class or a built-in type X satisfies the requirements of an output 
  iterator if X is an Assignable type (23.1) and also the following expressions 
  are valid, as shown in Table 73: </P></BLOCKQUOTE>
<P>to: </P>
<BLOCKQUOTE>
  <P>A class or a built-in type X satisfies the requirements of an output 
  iterator if X is a CopyConstructible (20.1.3) and Assignable type (23.1) and 
  also the following expressions are valid, as shown in Table 73: 
</P></BLOCKQUOTE>
<P><I>[Post-Tokyo: Beman Dawes submitted this issue at the request of the LWG. 
He asks that the 25.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.replace">[lib.alg.replace]</A> 
and 25.2.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.fill">[lib.alg.fill]</A> 
changes be studied carefully, as it is not clear that CopyConstructible is 
really a requirement and may be overspecification.]</I></P>
<P><I>[Portions of the resolution for issue 230 have been superceded by the 
resolution of issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#276">276</A>.]</I></P>
<P><B>Rationale:</B></P>
<P>The original proposed resolution also included changes to input iterator, 
fill, and replace. The LWG believes that those changes are not necessary. The 
LWG considered some blanket statement, where an 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.</P>
<HR>
<A name=231>
<H3>231.&nbsp;Precision in iostream?</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;James Kanze, Stephen Clamage&nbsp; <B>Date:</B>&nbsp; 25 
Apr 2000</P>
<P>What is the following program supposed to output?</P><PRE>#include &lt;iostream&gt;

    int
    main()
    {
        std::cout.setf( std::ios::scientific , std::ios::floatfield ) ;
        std::cout.precision( 0 ) ;
        std::cout &lt;&lt; 1.00 &lt;&lt; '\n' ;
        return 0 ;
    }</PRE>
<P>From my C experience, I would expect "1e+00"; this is what <TT>printf("%.0e" 
, 1.00 );</TT> does. G++ outputs "1.000000e+00".</P>
<P>The only indication I can find in the standard is 22.2.2.2.2/11, where it 
says "For conversion from a floating-point type, if (flags &amp; fixed) != 0 or 
if str.precision() &gt; 0, then str.precision() is specified in the conversion 
specification." This is an obvious error, however, fixed is not a mask for a 
field, but a value that a multi-bit field may take -- the results of and'ing 
fmtflags with ios::fixed are not defined, at least not if ios::scientific has 
been set. G++'s behavior corresponds to what might happen if you do use (flags 
&amp; fixed) != 0 with a typical implementation (floatfield == 3 &lt;&lt; 
something, fixed == 1 &lt;&lt; something, and scientific == 2 &lt;&lt; 
something).</P>
<P>Presumably, the intent is either (flags &amp; floatfield) != 0, or (flags 
&amp; floatfield) == fixed; the first gives something more or less like the 
effect of precision in a printf floating point conversion. Only more or less, of 
course. In order to implement printf formatting correctly, you must know whether 
the precision was explicitly set or not. Say by initializing it to -1, instead 
of 6, and stating that for floating point conversions, if precision &lt; -1, 6 
will be used, for fixed point, if precision &lt; -1, 1 will be used, etc. Plus, 
of course, if precision == 0 and flags &amp; floatfield == 0, 1 should be = 
used. But it probably isn't necessary to emulate all of the anomalies of 
printf:-).</P>
<P><B>Proposed resolution:</B></P>
<P>Replace 22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>, 
paragraph 11, with the following sentence: </P>
<BLOCKQUOTE>For conversion from a floating-point type, 
  <TT><I>str</I>.precision()</TT> is specified in the conversion specification. 
</BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The floatfield determines whether numbers are formatted as if with %f, %e, or 
%g. If the <TT>fixed</TT> bit is set, it's %f, if <TT>scientific</TT> it's %e, 
and if both bits are set, or neither, it's %g.</P>
<P>Turning to the C standard, a precision of 0 is meaningful for %f and %e. For 
%g, precision 0 is taken to be the same as precision 1.</P>
<P>The proposed resolution has the effect that if neither <TT>fixed</TT> nor 
<TT>scientific</TT> is set we'll be specifying a precision of 0, which will be 
internally turned into 1. There's no need to call it out as a special case.</P>
<P>The output of the above program will be "1e+00".</P>
<P><I>[Post-Curaao: Howard provided improved wording covering the case where 
precision is 0 and mode is %g.]</I></P>
<HR>
<A name=232>
<H3>232.&nbsp;"depends" poorly defined in 17.4.3.1</H3></A>
<P><B>Section:</B>&nbsp;17.4.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.reserved.names">[lib.reserved.names]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Peter Dimov&nbsp; <B>Date:</B>&nbsp;18 Apr 2000</P>
<P>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."</P>
<P>This term, however, is not adequately defined, making it possible to 
construct a specialization that is, I believe, technically legal according to 
17.4.3.1/1, but that specializes a standard template for a built-in type such as 
'int'.</P>
<P>The following code demonstrates the problem:</P>
<BLOCKQUOTE><PRE>#include &lt;algorithm&gt;</PRE><PRE>template&lt;class T&gt; struct X
{
 typedef T type;
};</PRE><PRE>namespace std
{
 template&lt;&gt; void swap(::X&lt;int&gt;::type&amp; i, ::X&lt;int&gt;::type&amp; j);
}</PRE></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Change "user-defined name" to "user-defined type".</P>
<P><B>Rationale:</B></P>
<P>This terminology is used in section 2.5.2 and 4.1.1 of <I>The C++ Programming 
Language</I>. It disallows the example in the issue, since the underlying type 
itself is not user-defined. The only possible problem I can see is for non-type 
templates, but there's no 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?</P>
<P><I>[Toronto: this may be related to issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#120">120</A>.]</I></P>
<P><I>[post-Toronto: Judy provided the above proposed resolution and 
rationale.]</I></P>
<HR>
<A name=234>
<H3>234.&nbsp;Typos in allocator definition</H3></A>
<P><B>Section:</B>&nbsp;20.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.members">[lib.allocator.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;24 Apr 2000</P>
<P>In paragraphs 12 and 13 the effects of <TT>construct()</TT> and 
<TT>destruct()</TT> are described as returns but the functions actually return 
<TT>void</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>Substitute "Returns" by "Effect".</P>
<HR>
<A name=235>
<H3>235.&nbsp;No specification of default ctor for reverse_iterator</H3></A>
<P><B>Section:</B>&nbsp;24.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.reverse.iterator">[lib.reverse.iterator]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;24 Apr 2000</P>
<P>The declaration of <TT>reverse_iterator</TT> lists a default constructor. 
However, no specification is given what this constructor should do.</P>
<P><B>Proposed resolution:</B></P>
<P>In section 24.4.1.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.reverse.iter.cons">[lib.reverse.iter.cons]</A> 
add the following paragraph:</P>
<BLOCKQUOTE>
  <P><TT>reverse_iterator()</TT></P>
  <P>Default initializes <TT>current</TT>. Iterator operations applied to the 
  resulting iterator have defined behavior if and only if the corresponding 
  operations are defined on a default constructed iterator of type 
  <TT>Iterator</TT>.</P></BLOCKQUOTE>
<P><I>[pre-Copenhagen: Dietmar provide wording for proposed resolution.]</I></P>
<HR>
<A name=237>
<H3>237.&nbsp;Undefined expression in complexity specification</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.cons">[lib.list.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;24 Apr 2000</P>
<P>The complexity specification in paragraph 6 says that the complexity is 
linear in <TT>first - last</TT>. Even if <TT>operator-()</TT> is defined on 
iterators this term is in general undefined because it would have to be <TT>last 
- first</TT>.</P>
<P><B>Proposed resolution:</B></P>
<P>Change paragraph 6 from</P>
<BLOCKQUOTE>Linear in <I>first - last</I>.</BLOCKQUOTE>
<P>to become</P>
<BLOCKQUOTE>Linear in <I>distance(first, last)</I>.</BLOCKQUOTE>
<HR>
<A name=238>
<H3>238.&nbsp;Contradictory results of stringbuf initialization.</H3></A>
<P><B>Section:</B>&nbsp;27.7.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.cons">[lib.stringbuf.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dietmar Khl&nbsp; <B>Date:</B>&nbsp;11 May 2000</P>
<P>In 27.7.1.1 paragraph 4 the results of calling the constructor of 
'basic_stringbuf' are said to be <TT>str() == str</TT>. This is fine that far 
but consider this code:</P><PRE>  std::basic_stringbuf&lt;char&gt; sbuf("hello, world", std::ios_base::openmode(0));
  std::cout &lt;&lt; "'" &lt;&lt; sbuf.str() &lt;&lt; "'\n";
</PRE>
<P>Paragraph 3 of 27.7.1.1 basically says that in this case neither the output 
sequence nor the input sequence is initialized and paragraph 2 of 27.7.1.2 
basically says that <TT>str()</TT> either returns the input or the output 
sequence. None of them is initialized, ie. both are empty, in which case the 
return from <TT>str()</TT> is defined to be 
<TT>basic_string&lt;cT&gt;()</TT>.</P>
<P>However, probably only test cases in some testsuites will detect this 
"problem"...</P>
<P><B>Proposed resolution:</B></P>
<P>Remove 27.7.1.1 paragraph 4.</P>
<P><B>Rationale:</B></P>
<P>We could fix 27.7.1.1 paragraph 4, but there would be no point. If we fixed 
it, it would say just the same thing as text that's already in the standard.</P>
<HR>
<A name=239>
<H3>239.&nbsp;Complexity of unique() and/or unique_copy incorrect</H3></A>
<P><B>Section:</B>&nbsp;25.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.unique">[lib.alg.unique]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;May 15 2000</P>
<P>The complexity of unique and unique_copy are inconsistent with each other and 
inconsistent with the implementations.&nbsp; The standard specifies:</P>
<P>for unique():</P>
<BLOCKQUOTE>-3- Complexity: If the range (last - first) is not empty, exactly 
  (last - first) - 1 applications of the corresponding predicate, otherwise no 
  applications of the predicate.</BLOCKQUOTE>
<P>for unique_copy():</P>
<BLOCKQUOTE>-7- Complexity: Exactly last - first applications of the 
  corresponding predicate.</BLOCKQUOTE>
<P>The implementations do it the other way round: unique() applies the predicate 
last-first times and unique_copy() applies it last-first-1 times.</P>
<P>As both algorithms use the predicate for pair-wise comparison of sequence 
elements I don't see a justification for unique_copy() applying the predicate 
last-first times, especially since it is not specified to which pair in the 
sequence the predicate is applied twice.</P>
<P><B>Proposed resolution:</B></P>
<P>Change both complexity sections in 25.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.unique">[lib.alg.unique]</A> 
to:</P>
<BLOCKQUOTE>Complexity: For nonempty ranges, exactly last - first - 1 
  applications of the corresponding predicate.</BLOCKQUOTE>
<HR>
<A name=240>
<H3>240.&nbsp;Complexity of adjacent_find() is meaningless</H3></A>
<P><B>Section:</B>&nbsp;25.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.adjacent.find">[lib.alg.adjacent.find]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;May 15 2000</P>
<P>The complexity section of adjacent_find is defective:</P>
<BLOCKQUOTE><PRE>template &lt;class ForwardIterator&gt;
ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last
                              BinaryPredicate pred);
</PRE>
  <P>-1- Returns: The first iterator i such that both i and i + 1 are in the 
  range [first, last) for which the following corresponding conditions hold: *i 
  == *(i + 1), pred(*i, *(i + 1)) != false. Returns last if no such iterator is 
  found.</P>
  <P>-2- Complexity: Exactly find(first, last, value) - first applications of 
  the corresponding predicate. </P></BLOCKQUOTE>
<P>In the Complexity section, it is not defined what "value" is supposed to 
mean. My best guess is that "value" means an object for which one of the 
conditions pred(*i,value) or pred(value,*i) is true, where i is the iterator 
defined in the Returns section. However, the value type of the input sequence 
need not be equality-comparable and for this reason the term find(first, last, 
value) - first is meaningless.</P>
<P>A term such as find_if(first, last, bind2nd(pred,*i)) - first or 
find_if(first, last, bind1st(pred,*i)) - first might come closer to the intended 
specification. Binders can only be applied to function objects that have the 
function call operator declared const, which is 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.</P>
<P><B>Proposed resolution:</B></P>
<P>Change the complexity section in 25.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.adjacent.find">[lib.alg.adjacent.find]</A> 
to:</P>
<BLOCKQUOTE>For a nonempty range, exactly <TT>min((<I>i</I> - <I>first</I>) + 
  1, (<I>last</I> - <I>first</I>) - 1)</TT> applications of the corresponding 
  predicate, where <I>i</I> is <TT>adjacent_find</TT>'s return value. 
</BLOCKQUOTE>
<P><I>[Copenhagen: the original resolution specified an upper bound. The LWG 
preferred an exact count.]</I></P>
<HR>
<A name=241>
<H3>241.&nbsp;Does unique_copy() require CopyConstructible and 
Assignable?</H3></A>
<P><B>Section:</B>&nbsp;25.2.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.unique">[lib.alg.unique]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;May 15 2000</P>
<P>Some popular implementations of unique_copy() create temporary copies of 
values in the input sequence, at least if the input iterator is a pointer. Such 
an implementation is built on the assumption that the value type is 
CopyConstructible and Assignable.</P>
<P>It is common practice in the standard that algorithms explicitly 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.accumulate">[lib.accumulate]</A>.</P>
<P>Since the specifications of unique() and unique_copy() do not require 
CopyConstructible and Assignable of the InputIterator's value type the above 
mentioned implementations are not standard-compliant. I cannot judge whether 
this is a defect in the standard or a defect in the implementations.</P>
<P><B>Proposed resolution:</B></P>
<P>In 25.2.8 change:</P>
<BLOCKQUOTE>-4- Requires: The ranges [first, last) and [result, 
  result+(last-first)) shall not overlap. </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>-4- Requires: The ranges [first, last) and [result, result+(last-first)) 
  shall not overlap. The expression *result = *first must be valid. If neither 
  InputIterator nor OutputIterator meets the requirements of forward iterator 
  then the value type of InputIterator must be copy constructible. Otherwise 
  copy constructible is not required. </P></BLOCKQUOTE>
<P><I>[Redmond: the original proposed resolution didn't impose an explicit 
requirement that the iterator's value type must be copy constructible, on the 
grounds that an input iterator's value type must always be copy constructible. 
Not everyone in the LWG thought that this requirement was clear from table 72. 
It has been suggested that it might be possible to implement 
<TT>unique_copy</TT> without requiring assignability, although current 
implementations do impose that requirement. Howard provided new 
wording.]</I></P>
<P><I>[ Curaao: 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. ]</I></P>
<HR>
<A name=242>
<H3>242.&nbsp;Side effects of function objects</H3></A>
<P><B>Section:</B>&nbsp;25.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.transform">[lib.alg.transform]</A>, 
26.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.numeric.ops">[lib.numeric.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Angelika Langer&nbsp; <B>Date:</B>&nbsp;May 15 2000</P>
<P>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.</P>
<P>The standard defines a side effect in 1.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/intro.html#intro.execution">[intro.execution]</A> 
as:</P>
<BLOCKQUOTE>-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 in the state of the execution environment.</BLOCKQUOTE>
<P>As a consequence, the function call operator of a function object supplied to 
any of the algorithms listed above cannot modify data members, cannot invoke any 
function that has a side effect, and cannot even create and modify temporary 
objects.&nbsp; It is difficult to imagine a function object that is still useful 
under these severe limitations. For instance, any non-trivial transformator 
supplied to transform() might involve creation and modification of temporaries, 
which is prohibited according to the current wording of the standard.</P>
<P>On the other hand, popular implementations of these algorithms exhibit 
uniform and predictable behavior when invoked with a side-effect-producing 
function objects. It looks like the strong requirement is not needed for 
efficient implementation of these algorithms.</P>
<P>The requirement of&nbsp; side-effect-free function objects could be replaced 
by a more relaxed basic requirement (which would hold for all function objects 
supplied to any algorithm in the standard library):</P>
<BLOCKQUOTE>A function objects supplied to an algorithm shall not invalidate 
  any iterator or sequence that is used by the algorithm. Invalidation of the 
  sequence includes destruction of the sorting order if the algorithm relies on 
  the sorting order (see section 25.3 - Sorting and related operations 
  [lib.alg.sorting]).</BLOCKQUOTE>
<P>I can't judge whether it is intended that the function objects supplied to 
transform(), accumulate(), inner_product(), partial_sum(), or 
adjacent_difference() shall not modify sequence elements through dereferenced 
iterators.</P>
<P>It is debatable whether this issue is a defect or a change request. Since the 
consequences for user-supplied function objects are drastic and limit the 
usefulness of the algorithms significantly I would consider it a defect.</P>
<P><B>Proposed resolution:</B></P>
<P><I>Things to notice about these changes:</I></P>
<OL>
  <LI><I>The fully-closed ("[]" as opposed to half-closed "[)" ranges are 
  intentional. we want to prevent side-effects from invalidating the end 
  iterators.</I> 
  <LI><I>That has the unintentional side-effect of prohibiting modification of 
  the end element as a side-effect. This could conceivably be significant in 
  some cases.</I> 
  <LI><I>The wording also prevents side-effects from modifying elements of the 
  output sequence. I can't imagine why anyone would want to do this, but it is 
  arguably a restriction that implementors don't need to place on users.</I> 
  <LI><I>Lifting the restrictions imposed in #2 and #3 above is possible and 
  simple, but would require more verbiage.</I> </LI></OL>
<P>Change 25.2.3/2 from:</P>
<BLOCKQUOTE>-2- Requires: op and binary_op shall not have any side effects. 
</BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-2- Requires: in the ranges [first1, last1], [first2, first2 + 
  (last1 - first1)] and [result, result + (last1- first1)], op and binary_op 
  shall neither modify elements nor invalidate iterators or subranges. 
  [Footnote: The use of fully closed ranges is intentional --end footnote] 
</BLOCKQUOTE>
<P>Change 25.2.3/2 from:</P>
<BLOCKQUOTE>-2- Requires: op and binary_op shall not have any side effects. 
</BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-2- Requires: op and binary_op shall not invalidate iterators or 
  subranges, or modify elements in the ranges [first1, last1], [first2, first2 + 
  (last1 - first1)], and [result, result + (last1 - first1)]. [Footnote: The use 
  of fully closed ranges is intentional --end footnote] </BLOCKQUOTE>
<P>Change 26.4.1/2 from:</P>
<BLOCKQUOTE>-2- Requires: T must meet the requirements of CopyConstructible 
  (lib.copyconstructible) and Assignable (lib.container.requirements) types. 
  binary_op shall not cause side effects. </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-2- Requires: T must meet the requirements of CopyConstructible 
  (lib.copyconstructible) and Assignable (lib.container.requirements) types. In 
  the range [first, last], binary_op shall neither modify elements nor 
  invalidate iterators or subranges. [Footnote: The use of a fully closed range 
  is intentional --end footnote] </BLOCKQUOTE>
<P>Change 26.4.2/2 from:</P>
<BLOCKQUOTE>-2- Requires: T must meet the requirements of CopyConstructible 
  (lib.copyconstructible) and Assignable (lib.container.requirements) types. 
  binary_op1 and binary_op2 shall not cause side effects. </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-2- Requires: T must meet the requirements of CopyConstructible 
  (lib.copyconstructible) and Assignable (lib.container.requirements) types. In 
  the ranges [first, last] and [first2, first2 + (last - first)], binary_op1 and 
  binary_op2 shall neither modify elements nor invalidate iterators or 
  subranges. [Footnote: The use of fully closed ranges is intentional --end 
  footnote] </BLOCKQUOTE>
<P>Change 26.4.3/4 from:</P>
<BLOCKQUOTE>-4- Requires: binary_op is expected not to have any side effects. 
</BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-4- Requires: In the ranges [first, last] and [result, result + 
  (last - first)], binary_op shall neither modify elements nor invalidate 
  iterators or subranges. [Footnote: The use of fully closed ranges is 
  intentional --end footnote] </BLOCKQUOTE>
<P>Change 26.4.4/2 from:</P>
<BLOCKQUOTE>-2- Requires: binary_op shall not have any side effects. 
</BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-2- Requires: In the ranges [first, last] and [result, result + 
  (last - first)], binary_op shall neither modify elements nor invalidate 
  iterators or subranges. [Footnote: The use of fully closed ranges is 
  intentional --end footnote] </BLOCKQUOTE>
<P><I>[Toronto: Dave Abrahams supplied wording.]</I></P>
<P><I>[Copenhagen: Proposed resolution was modified slightly. Matt added 
footnotes pointing out that the use of closed ranges was intentional.]</I></P>
<HR>
<A name=243>
<H3>243.&nbsp;<TT>get</TT> and <TT>getline</TT> when sentry reports 
failure</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;May 15 2000</P>
<P>basic_istream&lt;&gt;::get(), and basic_istream&lt;&gt;::getline(), are 
unclear with respect to the behavior and side-effects of the named functions in 
case of an error.</P>
<P>27.6.1.3, p1 states that "... If the sentry object returns true, when 
converted to a value of type bool, the function endeavors to obtain the 
requested input..." It is not clear from this (or the rest of the paragraph) 
what precisely the behavior should be when the sentry ctor exits by throwing an 
exception or when the sentry object returns false. In particular, what is the 
number of characters extracted that gcount() returns supposed to be?</P>
<P>27.6.1.3 p8 and p19 say about the effects of get() and getline(): "... In any 
case, it then stores a null character (using charT()) into the next successive 
location of the array." Is not clear whether this sentence applies if either of 
the conditions above holds (i.e., when sentry fails).</P>
<P><B>Proposed resolution:</B></P>
<P>Add to 27.6.1.3, p1 after the sentence</P>
<BLOCKQUOTE>"... If the sentry object returns true, when converted to a value 
  of type bool, the function endeavors to obtain the requested input." 
</BLOCKQUOTE>
<P>the following</P>
<BLOCKQUOTE>"Otherwise, if the sentry constructor exits by throwing an 
  exception or if the sentry object returns false, when converted to a value of 
  type bool, the function returns without attempting to obtain any input. In 
  either case the number of extracted characters is set to 0; unformatted input 
  functions taking a character array of non-zero size as an argument shall also 
  store a null character (using charT()) in the first location of the array." 
</BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Although the general philosophy of the input functions is that the argument 
should not be modified upon failure, <TT>getline</TT> historically added a 
terminating null unconditionally. Most implementations still do that. Earlier 
versions of the draft standard 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.</P>
<HR>
<A name=248>
<H3>248.&nbsp;time_get fails to set eofbit</H3></A>
<P><B>Section:</B>&nbsp;22.2.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.category.time">[lib.category.time]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;22 June 2000</P>
<P>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 do so (22.2.2.1.2, and 
22.2.6.1.2, respectively), time_get members should follow the same requirement 
for consistency.</P>
<P><B>Proposed resolution:</B></P>
<P>Add paragraph 2 to section 22.2.5.1 with the following text:</P>
<BLOCKQUOTE>If the end iterator is reached during parsing by any of the get() 
  member functions, the member sets ios_base::eofbit in err. </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>Two alternative resolutions were proposed. The LWG chose this one because it 
was more consistent with the way eof is described for other input facets.</P>
<HR>
<A name=250>
<H3>250.&nbsp;splicing invalidates iterators</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Brian Parker &nbsp; <B>Date:</B>&nbsp;14 Jul 2000</P>
<P>Section 23.2.2.4 [lib.list.ops] states that </P><PRE>  void splice(iterator position, list&lt;T, Allocator&gt;&amp; x);
</PRE>
<P><I>invalidates</I> all iterators and references to list <TT>x</TT>. </P>
<P>This is unnecessary and defeats an important feature of splice. In fact, the 
SGI STL guarantees that iterators to <TT>x</TT> remain valid after 
<TT>splice</TT>. </P>
<P><B>Proposed resolution:</B></P>
<P>Add a footnote to 23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
paragraph 1:</P>
<BLOCKQUOTE>[<I>Footnote:</I> As specified in 20.1.5 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A>, 
  paragraphs 4-5, the semantics described in this clause applies only to the 
  case where allocators compare equal. --end footnote] </BLOCKQUOTE>
<P>In 23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
replace paragraph 4 with:</P>
<BLOCKQUOTE>Effects: Inserts the contents of x before position and x becomes 
  empty. Pointers and references to the moved elements of x now refer to those 
  same elements but as members of *this. Iterators referring to the moved 
  elements will continue to refer to their elements, but they now behave as 
  iterators into *this, not into x. </BLOCKQUOTE>
<P>In 23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
replace paragraph 7 with:</P>
<BLOCKQUOTE>Effects: Inserts an element pointed to by i from list x before 
  position and removes the element from x. The result is unchanged if position 
  == i or position == ++i. Pointers and references to *i continue to refer to 
  this same element but as a member of *this. Iterators to *i (including i 
  itself) continue to refer to the same element, but now behave as iterators 
  into *this, not into x. </BLOCKQUOTE>
<P>In 23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
replace paragraph 12 with:</P>
<BLOCKQUOTE>Requires: [first, last) is a valid range in x. The result is 
  undefined if position is an iterator in the range [first, last). Pointers and 
  references to the moved elements of x now refer to those same elements but as 
  members of *this. Iterators referring to the moved elements will continue to 
  refer to their elements, but they now behave as iterators into *this, not into 
  x. </BLOCKQUOTE>
<P><I>[pre-Copenhagen: Howard provided wording.]</I></P>
<P><B>Rationale:</B></P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A> 
paragraph 4, the behavior of list when allocators compare nonequal is outside 
the scope of the standard.</P>
<HR>
<A name=251>
<H3>251.&nbsp;basic_stringbuf missing allocator_type</H3></A>
<P><B>Section:</B>&nbsp;27.7.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf">[lib.stringbuf]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;28 Jul 2000</P>
<P>The synopsis for the template class <TT>basic_stringbuf</TT> doesn't list a 
typedef for the template parameter <TT>Allocator</TT>. This makes it impossible 
to determine the type of the allocator at compile time. It's also inconsistent 
with all other template classes in the library that do provide a typedef for the 
<TT>Allocator</TT> parameter.</P>
<P><B>Proposed resolution:</B></P>
<P>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:</P><PRE>  typedef Allocator allocator_type;
</PRE>
<HR>
<A name=252>
<H3>252.&nbsp;missing casts/C-style casts used in iostreams</H3></A>
<P><B>Section:</B>&nbsp;27.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.string.streams">[lib.string.streams]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;28 Jul 2000</P>
<P>27.7.2.2, p1 uses a C-style cast rather than the more appropriate 
const_cast&lt;&gt; in the Returns clause for 
basic_istringstream&lt;&gt;::rdbuf(). The same C-style cast is being used in 
27.7.3.2, p1, D.7.2.2, p1, and D.7.3.2, p1, and perhaps elsewhere. 27.7.6, p1 
and D.7.2.2, p1 are missing the cast altogether.</P>
<P>C-style casts have not been deprecated, so the first part of this issue is 
stylistic rather than a matter of correctness.</P>
<P><B>Proposed resolution:</B></P>
<P>In 27.7.2.2, p1 replace </P><PRE>  -1- Returns: (basic_stringbuf&lt;charT,traits,Allocator&gt;*)&amp;sb.</PRE>
<P>with</P><PRE>  -1- Returns: const_cast&lt;basic_stringbuf&lt;charT,traits,Allocator&gt;*&gt;(&amp;sb).</PRE>
<P>In 27.7.3.2, p1 replace</P><PRE>  -1- Returns: (basic_stringbuf&lt;charT,traits,Allocator&gt;*)&amp;sb.</PRE>
<P>with</P><PRE>  -1- Returns: const_cast&lt;basic_stringbuf&lt;charT,traits,Allocator&gt;*&gt;(&amp;sb).</PRE>
<P>In 27.7.6, p1, replace</P><PRE>  -1- Returns: &amp;sb</PRE>
<P>with</P><PRE>  -1- Returns: const_cast&lt;basic_stringbuf&lt;charT,traits,Allocator&gt;*&gt;(&amp;sb).</PRE>
<P>In D.7.2.2, p1 replace</P><PRE>  -2- Returns: &amp;sb. </PRE>
<P>with</P><PRE>  -2- Returns: const_cast&lt;strstreambuf*&gt;(&amp;sb).</PRE>
<HR>
<A name=253>
<H3>253.&nbsp;valarray helper functions are almost entirely useless</H3></A>
<P><B>Section:</B>&nbsp;26.3.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.valarray.cons">[lib.valarray.cons]</A>, 
26.3.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.valarray.assign">[lib.valarray.assign]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Robert Klarer&nbsp; <B>Date:</B>&nbsp;31 Jul 2000</P>
<P>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.</P>
<P>These valarray constructors can never be called:</P><PRE>   template &lt;class T&gt;
         valarray&lt;T&gt;::valarray(const slice_array&lt;T&gt; &amp;);
   template &lt;class T&gt;
         valarray&lt;T&gt;::valarray(const gslice_array&lt;T&gt; &amp;);
   template &lt;class T&gt;
         valarray&lt;T&gt;::valarray(const mask_array&lt;T&gt; &amp;);
   template &lt;class T&gt;
         valarray&lt;T&gt;::valarray(const indirect_array&lt;T&gt; &amp;);
</PRE>
<P>Similarly, these valarray assignment operators cannot be called:</P><PRE>     template &lt;class T&gt;
     valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const slice_array&lt;T&gt; &amp;);
     template &lt;class T&gt;
     valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const gslice_array&lt;T&gt; &amp;);
     template &lt;class T&gt;
     valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const mask_array&lt;T&gt; &amp;);
     template &lt;class T&gt;
     valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const indirect_array&lt;T&gt; &amp;);
</PRE>
<P>Please consider the following example:</P><PRE>   #include &lt;valarray&gt;
   using namespace std;

   int main()
   {
       valarray&lt;double&gt; va1(12);
       valarray&lt;double&gt; va2(va1[slice(1,4,3)]); // line 1
   }
</PRE>
<P>Since the valarray va1 is non-const, the result of the sub-expression 
va1[slice(1,4,3)] at line 1 is an rvalue of type const 
std::slice_array&lt;double&gt;. This slice_array rvalue is then used to 
construct va2. The constructor that is used to construct va2 is declared like 
this:</P><PRE>     template &lt;class T&gt;
     valarray&lt;T&gt;::valarray(const slice_array&lt;T&gt; &amp;);
</PRE>
<P>Notice the constructor's const reference parameter. When the constructor is 
called, a slice_array must be bound to this reference. The rules for binding an 
rvalue to a const reference are in 8.5.3, paragraph 5 (see also 13.3.3.1.4). 
Specifically, paragraph 5 indicates that a second slice_array rvalue is 
constructed (in this case copy-constructed) from the first one; it is this 
second rvalue that is bound to the reference parameter. Paragraph 5 also 
requires that the constructor that is used for this purpose be callable, 
regardless of whether the second rvalue is elided. The copy-constructor in this 
case is not callable, however, because it is private. Therefore, the compiler 
should report an error.</P>
<P>Since slice_arrays are always rvalues, the valarray constructor that has a 
parameter of type const slice_array&lt;T&gt; &amp; can never be called. The same 
reasoning applies to the three other constructors and the four assignment 
operators that are listed at the beginning of this post. Furthermore, since 
these functions cannot be called, the valarray helper classes are almost 
entirely useless.</P>
<P><B>Proposed resolution:</B></P>
<P>slice_array:</P>
<UL>
  <LI>Make the copy constructor and copy-assignment operator declarations public 
  in the slice_array class template definition in 26.3.5 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.slice.array">[lib.template.slice.array]</A> 

  <LI>remove paragraph 3 of 26.3.5 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.slice.array">[lib.template.slice.array]</A> 

  <LI>remove the copy constructor declaration from 26.3.5.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.cons.slice.arr">[lib.cons.slice.arr]</A> 

  <LI>change paragraph 1 of 26.3.5.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.cons.slice.arr">[lib.cons.slice.arr]</A> 
  to read "This constructor is declared to be private. This constructor need not 
  be defined." 
  <LI>remove the first sentence of paragraph 1 of 26.3.5.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.slice.arr.assign">[lib.slice.arr.assign]</A> 

  <LI>Change the first three words of the second sentence of paragraph 1 of 
  26.3.5.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.slice.arr.assign">[lib.slice.arr.assign]</A> 
  to "These assignment operators have" </LI></UL>
<P>gslice_array:</P>
<UL>
  <LI>Make the copy constructor and copy-assignment operator declarations public 
  in the gslice_array class template definition in 26.3.7 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.gslice.array">[lib.template.gslice.array]</A> 

  <LI>remove the note in paragraph 3 of 26.3.7 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.gslice.array">[lib.template.gslice.array]</A> 

  <LI>remove the copy constructor declaration from 26.3.7.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.gslice.array.cons">[lib.gslice.array.cons]</A> 

  <LI>change paragraph 1 of 26.3.7.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.gslice.array.cons">[lib.gslice.array.cons]</A> 
  to read "This constructor is declared to be private. This constructor need not 
  be defined." 
  <LI>remove the first sentence of paragraph 1 of 26.3.7.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.gslice.array.assign">[lib.gslice.array.assign]</A> 

  <LI>Change the first three words of the second sentence of paragraph 1 of 
  26.3.7.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.gslice.array.assign">[lib.gslice.array.assign]</A> 
  to "These assignment operators have" </LI></UL>
<P>mask_array:</P>
<UL>
  <LI>Make the copy constructor and copy-assignment operator declarations public 
  in the mask_array class template definition in 26.3.8 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.mask.array">[lib.template.mask.array]</A> 

  <LI>remove the note in paragraph 2 of 26.3.8 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.mask.array">[lib.template.mask.array]</A> 

  <LI>remove the copy constructor declaration from 26.3.8.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.mask.array.cons">[lib.mask.array.cons]</A> 

  <LI>change paragraph 1 of 26.3.8.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.mask.array.cons">[lib.mask.array.cons]</A> 
  to read "This constructor is declared to be private. This constructor need not 
  be defined." 
  <LI>remove the first sentence of paragraph 1 of 26.3.8.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.mask.array.assign">[lib.mask.array.assign]</A> 

  <LI>Change the first three words of the second sentence of paragraph 1 of 
  26.3.8.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.mask.array.assign">[lib.mask.array.assign]</A> 
  to "These assignment operators have" </LI></UL>
<P>indirect_array:</P>
<UL>
  <LI>Make the copy constructor and copy-assignment operator declarations public 
  in the indirect_array class definition in 26.3.9 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.indirect.array">[lib.template.indirect.array]</A> 

  <LI>remove the note in paragraph 2 of 26.3.9 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.indirect.array">[lib.template.indirect.array]</A> 

  <LI>remove the copy constructor declaration from 26.3.9.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.indirect.array.cons">[lib.indirect.array.cons]</A> 

  <LI>change the descriptive text in 26.3.9.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.indirect.array.cons">[lib.indirect.array.cons]</A> 
  to read "This constructor is declared to be private. This constructor need not 
  be defined." 
  <LI>remove the first sentence of paragraph 1 of 26.3.9.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.indirect.array.assign">[lib.indirect.array.assign]</A> 

  <LI>Change the first three words of the second sentence of paragraph 1 of 
  26.3.9.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.indirect.array.assign">[lib.indirect.array.assign]</A> 
  to "These assignment operators have" </LI></UL>
<P><I>[Proposed resolution was modified in Santa Cruz: explicitly make copy 
constructor and copy assignment operators public, instead of removing 
them.]</I></P>
<P><B>Rationale:</B></P>
<P>Keeping the valarray constructors private is untenable. Merely making 
valarray a friend of the helper classes isn't good enough, because access to the 
copy constructor is checked in the user's environment.</P>
<P>Making the assignment operator public is not strictly necessary to solve this 
problem. A majority of the LWG <I>(straw poll: 13-4)</I> believed we should make 
the assignment operators public, in addition to the copy constructors, for 
reasons of symmetry and user expectation.</P>
<HR>
<A name=256>
<H3>256.&nbsp;typo in 27.4.4.2, p17: copy_event does not exist</H3></A>
<P><B>Section:</B>&nbsp;27.4.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.members">[lib.basic.ios.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;21 Aug 2000</P>
<P>27.4.4.2, p17 says </P>
<BLOCKQUOTE>-17- Before copying any parts of rhs, calls each registered 
  callback pair (fn,index) as (*fn)(erase_event,*this,index). After all parts 
  but exceptions() have been replaced, calls each callback pair that was copied 
  from rhs as (*fn)(copy_event,*this,index). </BLOCKQUOTE>
<P>The name copy_event isn't defined anywhere. The intended name was 
copyfmt_event. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace copy_event with copyfmt_event in the named paragraph.</P>
<HR>
<A name=259>
<H3>259.&nbsp;<TT>basic_string::operator[]</TT> and const correctness</H3></A>
<P><B>Section:</B>&nbsp;21.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.access">[lib.string.access]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Chris Newton &nbsp; <B>Date:</B>&nbsp;27 Aug 2000</P>
<P><I>Paraphrased from a message that Chris Newton posted to comp.std.c++:</I> 
</P>
<P>The standard's description of <TT>basic_string&lt;&gt;::operator[]</TT> seems 
to violate const correctness. </P>
<P>The standard (21.3.4/1) says that "If <TT>pos &lt; size()</TT>, returns 
<TT>data()[pos]</TT>." The types don't work. The return value of <TT>data()</TT> 
is <TT>const charT*</TT>, but <TT>operator[]</TT> has a non-const version whose 
return type is <TT>reference</TT>. </P>
<P><B>Proposed resolution:</B></P>
<P>In section 21.3.4, paragraph 1, change "<TT>data()[<I>pos</I>]</TT>" to 
"<TT>*(begin() + <I>pos</I>)</TT>". </P>
<HR>
<A name=260>
<H3>260.&nbsp;Inconsistent return type of 
<TT>istream_iterator::operator++(int)</TT> </H3></A>
<P><B>Section:</B>&nbsp;24.5.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istream.iterator.ops">[lib.istream.iterator.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;27 Aug 2000</P>
<P>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 given the Effects clause 
below (since a temporary is returned). The `&amp;' is probably just a typo.</P>
<P><B>Proposed resolution:</B></P>
<P>Change the declaration in 24.5.1.2, p5 from</P><PRE> istream_iterator&lt;T,charT,traits,Distance&gt;&amp; operator++(int);
 </PRE>
<P>to</P><PRE> istream_iterator&lt;T,charT,traits,Distance&gt; operator++(int);
 </PRE>
<P>(that is, remove the `&amp;').</P>
<HR>
<A name=261>
<H3>261.&nbsp;Missing description of <TT>istream_iterator::operator!=</TT> 
</H3></A>
<P><B>Section:</B>&nbsp;24.5.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.istream.iterator.ops">[lib.istream.iterator.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;27 Aug 2000</P>
<P>24.5.1, p3 lists the synopsis for </P><PRE>   template &lt;class T, class charT, class traits, class Distance&gt;
        bool operator!=(const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; x,
                        const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; y);
</PRE>
<P>but there is no description of what the operator does (i.e., no Effects or 
Returns clause) in 24.5.1.2. </P>
<P><B>Proposed resolution:</B></P>
<P>Add paragraph 7 to the end of section 24.5.1.2 with the following text: </P><PRE>   template &lt;class T, class charT, class traits, class Distance&gt;
        bool operator!=(const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; x,
                        const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; y);
</PRE>
<P>-7- Returns: !(x == y).</P>
<HR>
<A name=262>
<H3>262.&nbsp;Bitmask operator ~ specified incorrectly</H3></A>
<P><B>Section:</B>&nbsp;17.3.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.bitmask.types">[lib.bitmask.types]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Beman Dawes&nbsp; <B>Date:</B>&nbsp;03 Sep 2000</P>
<P>The ~ operation should be applied after the cast to int_type. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 17.3.2.1.2 [lib.bitmask.types] operator~ from: </P><PRE>   bitmask operator~ ( bitmask X )
     { return static_cast&lt; bitmask&gt;(static_cast&lt;int_type&gt;(~ X)); }
</PRE>
<P>to: </P><PRE>   bitmask operator~ ( bitmask X )
     { return static_cast&lt; bitmask&gt;(~static_cast&lt;int_type&gt;(X)); }
</PRE>
<HR>
<A name=263>
<H3>263.&nbsp;Severe restriction on <TT>basic_string</TT> reference 
counting</H3></A>
<P><B>Section:</B>&nbsp;21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Kevlin Henney&nbsp; <B>Date:</B>&nbsp;04 Sep 2000</P>
<P>The note in paragraph 6 suggests that the invalidation rules for references, 
pointers, and iterators in paragraph 5 permit a reference- counted 
implementation (actually, according to paragraph 6, they permit a "reference 
counted implementation", but this is a minor editorial fix). </P>
<P>However, the last sub-bullet is so worded as to make a reference-counted 
implementation unviable. In the following example none of the conditions for 
iterator invalidation are satisfied: </P><PRE>    // first example: "*******************" should be printed twice
    string original = "some arbitrary text", copy = original;
    const string &amp; alias = original;

    string::const_iterator i = alias.begin(), e = alias.end();
    for(string::iterator j = original.begin(); j != original.end(); ++j)
        *j = '*';
    while(i != e)
        cout &lt;&lt; *i++;
    cout &lt;&lt; endl;
    cout &lt;&lt; original &lt;&lt; endl;
</PRE>
<P>Similarly, in the following example: </P><PRE>    // second example: "some arbitrary text" should be printed out
    string original = "some arbitrary text", copy = original;
    const string &amp; alias = original;

    string::const_iterator i = alias.begin();
    original.begin();
    while(i != alias.end())
        cout &lt;&lt; *i++;
</PRE>
<P>I have tested this on three string implementations, two of which were 
reference counted. The reference-counted implementations gave "surprising 
behavior" because they invalidated iterators on the first call to non-const 
begin since construction. The current wording does not permit such invalidation 
because it does not take into account the first call since construction, only 
the first call since various member and non-member function calls. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the following sentence in 21.3 paragraph 5 from </P>
<BLOCKQUOTE>Subsequent to any of the above uses except the forms of insert() 
  and erase() which return iterators, the first call to non-const member 
  functions operator[](), at(), begin(), rbegin(), end(), or rend(). </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>Following construction or any of the above uses, except the forms 
  of insert() and erase() that return iterators, the first call to non- const 
  member functions operator[](), at(), begin(), rbegin(), end(), or rend(). 
</BLOCKQUOTE>
<HR>
<A name=264>
<H3>264.&nbsp;Associative container <TT>insert(i, j)</TT> complexity 
requirements are not feasible.</H3></A>
<P><B>Section:</B>&nbsp;23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;John Potter&nbsp; <B>Date:</B>&nbsp;07 Sep 2000</P>
<P>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&lt;int&gt; containing the odd integers in the same range. </P>
<P><I>Related issue: <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#102">102</A></I></P>
<P><B>Proposed resolution:</B></P>
<P>In Table 69, in section 23.1.2, change the complexity clause for insertion of 
a range from "N log(size() + N) (N is the distance from i to j) in general; 
linear if [i, j) is sorted according to value_comp()" to "N log(size() + N), 
where N is the distance from i to j". </P>
<P><I>[Copenhagen: Minor fix in proposed resolution: fixed unbalanced parens in 
the revised wording.]</I></P>
<P><B>Rationale:</B></P>
<P>Testing for valid insertions could be less efficient than simply inserting 
the elements when the range is not both sorted and between two adjacent existing 
elements; this could be a QOI issue. </P>
<P>The LWG considered two other options: (a) specifying that the complexity was 
linear if [i, j) is sorted according to value_comp() and between two adjacent 
existing elements; or (b) changing to Klog(size() + N) + (N - K) (N is the 
distance from i to j and K is the number of elements which do not insert 
immediately after the previous element from [i, j) including the first). The LWG 
felt that, since we can't guarantee linear time complexity whenever the range to 
be inserted is sorted, it's more trouble than it's worth to say that it's linear 
in some special cases. </P>
<HR>
<A name=265>
<H3>265.&nbsp;std::pair::pair() effects overly restrictive</H3></A>
<P><B>Section:</B>&nbsp;20.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.pairs">[lib.pairs]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;11 Sep 2000</P>
<P>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 functions it appears 
that they must at least satisfy the requirements of 20.1.3 
[lib.copyconstructible] and 20.1.4 [lib.default.con.req], and in the case of the 
[in]equality operators also the requirements of 20.1.1 [lib.equalitycomparable] 
and 20.1.2 [lib.lessthancomparable]. </P>
<P>I believe that the the CopyConstructible requirement is unnecessary in the 
case of 20.2.2, p2. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the Effects clause in 20.2.2, p2 from</P>
<BLOCKQUOTE>-2- <B>Effects</B>: Initializes its members as if implemented: 
  <TT>pair() : first(T1()), second(T2()) {} </TT></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>-2- <B>Effects</B>: Initializes its members as if implemented: 
  <TT>pair() : first(), second() {} </TT></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The existing specification of pair's constructor appears to be a historical 
artifact: there was concern that pair's members be properly zero-initialized 
when they are built-in types. At one time there was uncertainty about whether 
they would be zero-initialized if the 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.</P>
<HR>
<A name=266>
<H3>266.&nbsp;bad_exception::~bad_exception() missing Effects clause</H3></A>
<P><B>Section:</B>&nbsp;18.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.bad.exception">[lib.bad.exception]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;24 Sep 2000</P>
<P>The synopsis for std::bad_exception lists the function ~bad_exception() but 
there is no description of what the function does (the Effects clause is 
missing). </P>
<P><B>Proposed resolution:</B></P>
<P>Remove the destructor from the class synopses of <TT>bad_alloc</TT> (18.4.2.1 
<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.bad.alloc">[lib.bad.alloc]</A>), 
<TT>bad_cast</TT> (18.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.bad.cast">[lib.bad.cast]</A>), 
<TT>bad_typeid</TT> (18.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.bad.typeid">[lib.bad.typeid]</A>), 
and <TT>bad_exception</TT> (18.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.bad.exception">[lib.bad.exception]</A>). 
</P>
<P><B>Rationale:</B></P>
<P>This is a general problem with the exception classes in clause 18. The 
proposed resolution is to remove the destructors from the class synopses, rather 
than to document the destructors' behavior, because removing them is more 
consistent with how exception classes are described in clause 19. </P>
<HR>
<A name=268>
<H3>268.&nbsp;Typo in locale synopsis</H3></A>
<P><B>Section:</B>&nbsp;22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;5 Oct 2000</P>
<P>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&amp;) are missing.</P>
<P><B>Proposed resolution:</B></P>
<P>Add the missing semicolons, i.e., change</P><PRE>    //  construct/copy/destroy:
        locale() throw()
        locale(const locale&amp; other) throw()
</PRE>
<P>in the synopsis in 22.1.1 to</P><PRE>    //  construct/copy/destroy:
        locale() throw();
        locale(const locale&amp; other) throw();
</PRE>
<HR>
<A name=270>
<H3>270.&nbsp;Binary search requirements overly strict</H3></A>
<P><B>Section:</B>&nbsp;25.3.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.binary.search">[lib.alg.binary.search]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;18 Oct 2000</P>
<P>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 comparison 
function object. According to 25.3, paragraph 2, that comparison function object 
has to be a strict weak ordering. </P>
<P>This requirement is slightly too strict. Suppose we are searching through a 
sequence containing objects of type X, where X is some 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: </P><PRE>    struct key_comp {
      bool operator()(const X&amp; x, int n) const {
        return x.key() &lt; n;
      }
    }

    std::lower_bound(first, last, 47, key_comp());
</PRE>
<P>key_comp is not a strict weak ordering, but there is no reason to prohibit 
its use in lower_bound. </P>
<P>There's no difficulty in implementing lower_bound so that it allows the use 
of something like key_comp. (It will probably work unless an implementor takes 
special pains to forbid it.) What's difficult is formulating language in the 
standard to specify what kind of comparison function is acceptable. We need a 
notion that's slightly more general than that of a strict weak ordering, one 
that can encompass a comparison function that involves different types. 
Expressing that notion may be complicated. </P>
<P><I>Additional questions raised at the Toronto meeting:</I></P>
<UL>
  <LI>Do we really want to specify what ordering the implementor must use when 
  calling the function object? The standard gives specific expressions when 
  describing these algorithms, but it also says that other expressions (with 
  different argument order) are equivalent. 
  <LI>If we are specifying ordering, note that the standard uses both orderings 
  when describing <TT>equal_range</TT>. 
  <LI>Are we talking about requiring these algorithms to work properly when 
  passed a binary function object whose two argument types are not the same, or 
  are we talking about requirements when they are passed a binary function 
  object with several overloaded versions of <TT>operator()</TT>? 
  <LI>The definition of a strict weak ordering does not appear to give any 
  guidance on issues of overloading; it only discusses expressions, and all of 
  the values in these expressions are of the same type. Some clarification would 
  seem to be in order. </LI></UL>
<P><I>Additional discussion from Copenhagen:</I></P>
<UL>
  <LI>It was generally agreed that there is a real defect here: if the predicate 
  is merely required to be a Strict Weak Ordering, then it's possible to pass in 
  a function object with an overloaded operator(), where the version that's 
  actually called does something completely inappropriate. (Such as returning a 
  random value.) 
  <LI>An alternative formulation was presented in a paper distributed by David 
  Abrahams at the meeting, "Binary Search with Heterogeneous Comparison", 
  J16-01/0027 = WG21 N1313: Instead of viewing the predicate as a Strict Weak 
  Ordering acting on a sorted sequence, view the predicate/value pair as 
  something that partitions a sequence. This is almost equivalent to saying that 
  we should view binary search as if we are given a unary predicate and a 
  sequence, such that f(*p) is true for all p below a specific point and false 
  for all p above it. The proposed resolution is based on that alternative 
  formulation. </LI></UL>
<P><B>Proposed resolution:</B></P>
<P>Change 25.3 [lib.alg.sorting] paragraph 3 from:</P>
<BLOCKQUOTE>3 For all algorithms that take Compare, there is a version that 
  uses operator&lt; instead. That is, comp(*i, *j) != false defaults to *i &lt; 
  *j != false. For the algorithms to work correctly, comp has to induce a strict 
  weak ordering on the values. </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>3 For all algorithms that take Compare, there is a version that 
  uses operator&lt; instead. That is, comp(*i, *j) != false defaults to *i &lt; 
  *j != false. For algorithms other than those described in 
  lib.alg.binary.search (25.3.3) to work correctly, comp has to induce a strict 
  weak ordering on the values. </BLOCKQUOTE>
<P>Add the following paragraph after 25.3 [lib.alg.sorting] paragraph 5:</P>
<BLOCKQUOTE>-6- A sequence [start, finish) is partitioned with respect to an 
  expression f(e) if there exists an integer n such that for all 0 &lt;= i &lt; 
  distance(start, finish), f(*(begin+i)) is true if and only if i &lt; n. 
</BLOCKQUOTE>
<P>Change 25.3.3 [lib.alg.binary.search] paragraph 1 from:</P>
<BLOCKQUOTE>-1- All of the algorithms in this section are versions of binary 
  search and assume that the sequence being searched is in order according to 
  the implied or explicit comparison function. They work on non-random access 
  iterators minimizing the number of comparisons, which will be logarithmic for 
  all types of iterators. They are especially appropriate for random access 
  iterators, because these algorithms do a logarithmic number of steps through 
  the data structure. For non-random access iterators they execute a linear 
  number of steps. </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-1- All of the algorithms in this section are versions of binary 
  search and assume that the sequence being searched is partitioned with respect 
  to an expression formed by binding the search key to an argument of the 
  implied or explicit comparison function. They work on non-random access 
  iterators minimizing the number of comparisons, which will be logarithmic for 
  all types of iterators. They are especially appropriate for random access 
  iterators, because these algorithms do a logarithmic number of steps through 
  the data structure. For non-random access iterators they execute a linear 
  number of steps. </BLOCKQUOTE>
<P>Change 25.3.3.1 [lib.lower.bound] paragraph 1 from:</P>
<BLOCKQUOTE>-1- Requires: Type T is LessThanComparable 
  (lib.lessthancomparable). </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-1- Requires: The elements e of [first, last) are partitioned with 
  respect to the expression e &lt; value or comp(e, value) </BLOCKQUOTE>
<P>Remove 25.3.3.1 [lib.lower.bound] paragraph 2:</P>
<BLOCKQUOTE>-2- Effects: Finds the first position into which value can be 
  inserted without violating the ordering. </BLOCKQUOTE>
<P>Change 25.3.3.2 [lib.upper.bound] paragraph 1 from:</P>
<BLOCKQUOTE>-1- Requires: Type T is LessThanComparable 
  (lib.lessthancomparable). </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-1- Requires: The elements e of [first, last) are partitioned with 
  respect to the expression !(value &lt; e) or !comp(value, e) </BLOCKQUOTE>
<P>Remove 25.3.3.2 [lib.upper.bound] paragraph 2:</P>
<BLOCKQUOTE>-2- Effects: Finds the furthermost position into which value can 
  be inserted without violating the ordering. </BLOCKQUOTE>
<P>Change 25.3.3.3 [lib.equal.range] paragraph 1 from:</P>
<BLOCKQUOTE>-1- Requires: Type T is LessThanComparable 
  (lib.lessthancomparable). </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-1- Requires: The elements e of [first, last) are partitioned with 
  respect to the expressions e &lt; value and !(value &lt; e) or comp(e, value) 
  and !comp(value, e). Also, for all elements e of [first, last), e &lt; value 
  implies !(value &lt; e) or comp(e, value) implies !comp(value, e) </BLOCKQUOTE>
<P>Change 25.3.3.3 [lib.equal.range] paragraph 2 from:</P>
<BLOCKQUOTE>-2- Effects: Finds the largest subrange [i, j) such that the value 
  can be inserted at any iterator k in it without violating the ordering. k 
  satisfies the corresponding conditions: !(*k &lt; value) &amp;&amp; !(value 
  &lt; *k) or comp(*k, value) == false &amp;&amp; comp(value, *k) == false. 
</BLOCKQUOTE>
<P>to:</P><PRE>   -2- Returns: 
         make_pair(lower_bound(first, last, value),
                   upper_bound(first, last, value))
       or
         make_pair(lower_bound(first, last, value, comp),
                   upper_bound(first, last, value, comp))
</PRE>
<P>Change 25.3.3.3 [lib.binary.search] paragraph 1 from:</P>
<BLOCKQUOTE>-1- Requires: Type T is LessThanComparable 
  (lib.lessthancomparable). </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-1- Requires: The elements e of [first, last) are partitioned with 
  respect to the expressions e &lt; value and !(value &lt; e) or comp(e, value) 
  and !comp(value, e). Also, for all elements e of [first, last), e &lt; value 
  implies !(value &lt; e) or comp(e, value) implies !comp(value, e) </BLOCKQUOTE>
<P><I>[Copenhagen: Dave Abrahams provided this wording]</I></P>
<P><I>[Redmond: Minor changes in wording. (Removed "non-negative", and changed 
the "other than those described in" wording.) Also, the LWG decided to accept 
the "optional" part.]</I></P>
<P><B>Rationale:</B></P>
<P>The proposed resolution reinterprets binary search. Instead of thinking about 
searching for a value in a sorted range, we view that as an important special 
case of a more general algorithm: searching for the partition point in a 
partitioned range.</P>
<P>We also add a guarantee that the old wording did not: we ensure 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.</P>
<HR>
<A name=271>
<H3>271.&nbsp;basic_iostream missing typedefs</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostreamclass">[lib.iostreamclass]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;02 Nov 2000</P>
<P>Class template basic_iostream has no typedefs. The typedefs it inherits from 
its base classes can't be used, since (for example) 
basic_iostream&lt;T&gt;::traits_type is ambiguous. </P>
<P><B>Proposed resolution:</B></P>
<P>Add the following to basic_iostream's class synopsis in 27.6.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostreamclass">[lib.iostreamclass]</A>, 
immediately after <TT>public</TT>:</P><PRE>  // types:
  typedef charT                     char_type;
  typedef typename traits::int_type int_type;
  typedef typename traits::pos_type pos_type;
  typedef typename traits::off_type off_type;
  typedef traits                    traits_type;
</PRE>
<HR>
<A name=272>
<H3>272.&nbsp;Missing parentheses around subexpression</H3></A>
<P><B>Section:</B>&nbsp;27.4.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.iostate.flags">[lib.iostate.flags]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;02 Nov 2000</P>
<P>27.4.4.3, p4 says about the postcondition of the function: If rdbuf()!=0 then 
state == rdstate(); otherwise rdstate()==state|ios_base::badbit. </P>
<P>The expression on the right-hand-side of the operator==() needs to be 
parenthesized in order for the whole expression to ever evaluate to anything but 
non-zero. </P>
<P><B>Proposed resolution:</B></P>
<P>Add parentheses like so: rdstate()==(state|ios_base::badbit). </P>
<HR>
<A name=273>
<H3>273.&nbsp;Missing ios_base qualification on members of a dependent 
class</H3></A>
<P><B>Section:</B>&nbsp;27 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.input.output">[lib.input.output]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;02 Nov 2000</P>
<P>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 class (14.6.2 [temp.dep]) and thus not 
visible.</P>
<P><B>Proposed resolution:</B></P>
<P>Qualify the names with the name of the class of which they are members, i.e., 
ios_base.</P>
<HR>
<A name=274>
<H3>274.&nbsp;a missing/impossible allocator requirement</H3></A>
<P><B>Section:</B>&nbsp;20.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;02 Nov 2000</P>
<P>I see that table 31 in 20.1.5, p3 allows T in std::allocator&lt;T&gt; to be 
of any type. But the synopsis in 20.4.1 calls for allocator&lt;&gt;::address() 
to be overloaded on reference and const_reference, which is ill-formed for all T 
= const U. In other words, this won't work: </P>
<P>template class std::allocator&lt;const int&gt;; </P>
<P>The obvious solution is to disallow specializations of allocators on const 
types. However, while containers' elements are required to be assignable (which 
rules out specializations on const T's), I think that allocators might perhaps 
be potentially useful for const values in other contexts. So if allocators are 
to allow const types a partial specialization of std::allocator&lt;const T&gt; 
would probably have to be provided. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the text in row 1, column 2 of table 32 in 20.1.5, p3 from</P>
<BLOCKQUOTE>any type </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>any non-const, non-reference type </BLOCKQUOTE>
<P><I>[Redmond: previous proposed resolution was "any non-const, non-volatile, 
non-reference type". Got rid of the "non-volatile".]</I></P>
<P><B>Rationale:</B></P>
<P>Two resolutions were originally proposed: one that partially specialized 
std::allocator for const types, and one that said an allocator's value type may 
not be const. The LWG chose the second. The first wouldn't be appropriate, 
because allocators are intended for use by containers, and const value types 
don't work in containers. Encouraging the use of allocators with const value 
types would only lead to unsafe code. </P>
<P>The original text for proposed resolution 2 was modified so that it also 
forbids volatile types and reference types. </P>
<P><I>[Curaao: LWG double checked and believes volatile is correctly excluded 
from the PR.]</I></P>
<HR>
<A name=275>
<H3>275.&nbsp;Wrong type in num_get::get() overloads</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.members">[lib.facet.num.get.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;02 Nov 2000</P>
<P>In 22.2.2.1.1, we have a list of overloads for num_get&lt;&gt;::get(). There 
are eight overloads, all of which are identical except for the last parameter. 
The overloads are: </P>
<UL>
  <LI>long&amp; 
  <LI>unsigned short&amp; 
  <LI>unsigned int&amp; 
  <LI>unsigned long&amp; 
  <LI>short&amp; 
  <LI>double&amp; 
  <LI>long double&amp; 
  <LI>void*&amp; </LI></UL>
<P>There is a similar list, in 22.2.2.1.2, of overloads for 
num_get&lt;&gt;::do_get(). In this list, the last parameter has the types: </P>
<UL>
  <LI>long&amp; 
  <LI>unsigned short&amp; 
  <LI>unsigned int&amp; 
  <LI>unsigned long&amp; 
  <LI>float&amp; 
  <LI>double&amp; 
  <LI>long double&amp; 
  <LI>void*&amp; </LI></UL>
<P>These two lists are not identical. They should be, since <TT>get</TT> is 
supposed to call <TT>do_get</TT> with exactly the arguments it was given. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.members">[lib.facet.num.get.members]</A>, 
change</P><PRE>  iter_type get(iter_type in, iter_type end, ios_base&amp; str,
                ios_base::iostate&amp; err, short&amp; val) const;
</PRE>
<P>to</P><PRE>  iter_type get(iter_type in, iter_type end, ios_base&amp; str,
                ios_base::iostate&amp; err, float&amp; val) const;
</PRE>
<HR>
<A name=276>
<H3>276.&nbsp;Assignable requirement for container value type overly 
strict</H3></A>
<P><B>Section:</B>&nbsp;23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Peter Dimov&nbsp; <B>Date:</B>&nbsp;07 Nov 2000</P>
<P>23.1/3 states that the objects stored in a container must be Assignable. 
23.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.map">[lib.map]</A>, 
paragraph 2, states that map satisfies all requirements for a container, while 
in the same time defining value_type as pair&lt;const Key, T&gt; - a type that 
is not Assignable. </P>
<P>It should be noted that there exists a valid and non-contradictory 
interpretation of the current text. The wording in 23.1/3 avoids mentioning 
value_type, referring instead to "objects stored in a container." One might 
argue that map does not store objects of type map::value_type, but of 
map::mapped_type instead, and that the Assignable requirement applies to 
map::mapped_type, not map::value_type. </P>
<P>However, this makes map a special case (other containers store objects of 
type value_type) and the Assignable requirement is needlessly restrictive in 
general. </P>
<P>For example, the proposed resolution of active library issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#103">103</A> 
is to make set::iterator a constant iterator; this means that no set operations 
can exploit the fact that the stored objects are Assignable. </P>
<P>This is related to, but slightly broader than, closed issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#140">140</A>. 
</P>
<P><B>Proposed resolution:</B></P>
<P>23.1/3: Strike the trailing part of the sentence:</P>
<BLOCKQUOTE>, and the additional requirements of Assignable types from 23.1/3 
</BLOCKQUOTE>
<P>so that it reads:</P>
<BLOCKQUOTE>-3- The type of objects stored in these components must meet the 
  requirements of CopyConstructible types (lib.copyconstructible). </BLOCKQUOTE>
<P>23.1/4: Modify to make clear that this requirement is not for all containers. 
Change to:</P>
<BLOCKQUOTE>-4- Table 64 defines the Assignable requirement. Some containers 
  require this property of the types to be stored in the container. T is the 
  type used to instantiate the container. t is a value of T, and u is a value of 
  (possibly const) T. </BLOCKQUOTE>
<P>23.1, Table 65: in the first row, change "T is Assignable" to "T is 
CopyConstructible".</P>
<P>23.2.1/2: Add sentence for Assignable requirement. Change to:</P>
<BLOCKQUOTE>-2- A deque satisfies all of the requirements of a container and 
  of a reversible container (given in tables in lib.container.requirements) and 
  of a sequence, including the optional sequence requirements 
  (lib.sequence.reqmts). In addition to the requirements on the stored object 
  described in 23.1[lib.container.requirements], the stored object must also 
  meet the requirements of Assignable. Descriptions are provided here only for 
  operations on deque that are not described in one of these tables or for 
  operations where there is additional semantic information. </BLOCKQUOTE>
<P>23.2.2/2: Add Assignable requirement to specific methods of list. Change 
to:</P>
<BLOCKQUOTE>
  <P>-2- A list satisfies all of the requirements of a container and of a 
  reversible container (given in two tables in lib.container.requirements) and 
  of a sequence, including most of the the optional sequence requirements 
  (lib.sequence.reqmts). The exceptions are the operator[] and at member 
  functions, which are not provided. [Footnote: These member functions are only 
  provided by containers whose iterators are random access iterators. --- end 
  foonote] </P>
  <P>list does not require the stored type T to be Assignable unless the 
  following methods are instantiated: [Footnote: Implementors are permitted but 
  not required to take advantage of T's Assignable properties for these methods. 
  -- end foonote] </P><PRE>     list&lt;T,Allocator&gt;&amp; operator=(const list&lt;T,Allocator&gt;&amp;  x );
     template &lt;class InputIterator&gt;
       void assign(InputIterator first, InputIterator last);
     void assign(size_type n, const T&amp; t);
</PRE>
  <P>Descriptions are provided here only for operations on list that are not 
  described in one of these tables or for operations where there is additional 
  semantic information.</P></BLOCKQUOTE>
<P>23.2.4/2: Add sentence for Assignable requirement. Change to:</P>
<BLOCKQUOTE>-2- A vector satisfies all of the requirements of a container and 
  of a reversible container (given in two tables in lib.container.requirements) 
  and of a sequence, including most of the optional sequence requirements 
  (lib.sequence.reqmts). The exceptions are the push_front and pop_front member 
  functions, which are not provided. In addition to the requirements on the 
  stored object described in 23.1[lib.container.requirements], the stored object 
  must also meet the requirements of Assignable. Descriptions are provided here 
  only for operations on vector that are not described in one of these tables or 
  for operations where there is additional semantic information. </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>list, set, multiset, map, multimap are able to store non-Assignables. 
However, there is some concern about <TT>list&lt;T&gt;</TT>: although in general 
there's no reason for T to be Assignable, some implementations of the member 
functions <TT>operator=</TT> and <TT>assign</TT> do rely on that requirement. 
The LWG does not want to forbid such implementations.</P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#274">274</A> 
for more details. </P>
<P>In principle we could also relax the "Assignable" requirement for individual 
<TT>vector</TT> member functions, such as <TT>push_back</TT>. However, the LWG 
did not see great value in such selective relaxation. Doing so would remove 
implementors' freedom to implement <TT>vector::push_back</TT> in terms of 
<TT>vector::insert</TT>.</P>
<HR>
<A name=278>
<H3>278.&nbsp;What does iterator validity mean?</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;P.J. Plauger&nbsp; <B>Date:</B>&nbsp;27 Nov 2000</P>
<P>Section 23.2.2.4 [lib.list.ops] states that </P><PRE>  void splice(iterator position, list&lt;T, Allocator&gt;&amp; x);
</PRE>
<P><I>invalidates</I> all iterators and references to list <TT>x</TT>. </P>
<P>But what does the C++ Standard mean by "invalidate"? You can still 
dereference the iterator to a spliced list element, but you'd better not use it 
to delimit a range within the original list. For the latter operation, it has 
definitely lost some of its validity. </P>
<P>If we accept the proposed resolution to issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#250">250</A>, 
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 iterator, as when a vector or string 
grows by reallocation. Clearly, such an iterator has a different kind of 
validity. Perhaps we should introduce separate terms for the two kinds of 
"validity." </P>
<P><B>Proposed resolution:</B></P>
<P>Add the following text to the end of section 24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>, 
after paragraph 5:</P>
<BLOCKQUOTE>An <I>invalid</I> iterator is an iterator that may be singular. 
  [Footnote: This definition applies to pointers, since pointers are iterators. 
  The effect of dereferencing an iterator that has been invalidated is 
  undefined.] </BLOCKQUOTE>
<P><I>[post-Copenhagen: Matt provided wording.]</I></P>
<P><I>[Redmond: General agreement with the intent, some objections to the 
wording. Dave provided new wording.]</I></P>
<P><B>Rationale:</B></P>
<P>This resolution simply defines a term that the Standard uses but never 
defines, "invalid", in terms of a term that is defined, "singular".</P>
<P>Why do we say "may be singular", instead of "is singular"? That's becuase a 
valid iterator is one that is known to be nonsingular. Invalidating an iterator 
means changing it in such a way that it's no longer known to be nonsingular. An 
example: inserting an element into the middle of a vector is correctly said to 
invalidate all iterators pointing into the vector. That doesn't necessarily mean 
they all become singular.</P>
<HR>
<A name=281>
<H3>281.&nbsp;std::min() and max() requirements overly restrictive</H3></A>
<P><B>Section:</B>&nbsp;25.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.min.max">[lib.alg.min.max]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;02 Dec 2000</P>
<P>The requirements in 25.3.7, p1 and 4 call for T to satisfy the requirements 
of <TT>LessThanComparable</TT> (20.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.lessthancomparable">[lib.lessthancomparable]</A>) 
and <TT>CopyConstructible</TT> (20.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.copyconstructible">[lib.copyconstructible]</A>). 
Since the functions take and return their arguments and result by const 
reference, I believe the <TT>CopyConstructible</TT> requirement is unnecessary. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Remove the <TT>CopyConstructible</TT> requirement. Specifically, replace 
25.3.7, p1 with</P>
<P><B>-1- Requires:</B> Type T is <TT>LessThanComparable</TT> (20.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.lessthancomparable">[lib.lessthancomparable]</A>). 
</P>
<P>and replace 25.3.7, p4 with</P>
<P><B>-4- Requires:</B> Type T is <TT>LessThanComparable</TT> (20.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.lessthancomparable">[lib.lessthancomparable]</A>). 
</P>
<HR>
<A name=282>
<H3>282.&nbsp;What types does numpunct grouping refer to?</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;5 Dec 2000</P>
<P>Paragraph 16 mistakenly singles out integral types for inserting 
thousands_sep() characters. This conflicts with the syntax for floating point 
numbers described under 22.2.3.1/2. </P>
<P><B>Proposed resolution:</B></P>
<P>Change paragraph 16 from:</P>
<BLOCKQUOTE>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 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.numpunct.virtuals">[lib.facet.numpunct.virtuals]</A>. 
</BLOCKQUOTE>
<P>To:</P>
<BLOCKQUOTE>For arithmetic 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 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.numpunct.virtuals">[lib.facet.numpunct.virtuals]</A>. 
</BLOCKQUOTE>
<P><I>[ Copenhagen: Opinions were divided about whether this is actually an 
inconsistency, but at best it seems to have been unintentional. This is only an 
issue for floating-point output: The standard is unambiguous that 
implementations must parse thousands_sep characters when performing 
floating-point. The standard is also unambiguous that this requirement does not 
apply to the "C" locale. ]</I></P>
<P><I>[ A survey of existing practice is needed; it is believed that some 
implementations do insert thousands_sep characters for floating-point output and 
others fail to insert thousands_sep characters for floating-point input even 
though this is unambiguously required by the standard. ]</I></P>
<P><I>[Post-Curaao: the above proposed resolution is the consensus of Howard, 
Bill, Pete, Benjamin, Nathan, Dietmar, Boris, and Martin.]</I></P>
<HR>
<A name=283>
<H3>283.&nbsp;std::replace() requirement incorrect/insufficient</H3></A>
<P><B>Section:</B>&nbsp;25.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.replace">[lib.alg.replace]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;15 Dec 2000</P>
<P>(revision of the further discussion) There are a number of problems with the 
requires clauses for the algorithms in 25.1 and 25.2. The requires clause of 
each algorithm should describe the necessary and sufficient requirements on the 
inputs to the algorithm such that the algorithm compiles and runs properly. Many 
of the requires clauses fail to do this. Here is a summary of the kinds of 
mistakes: </P>
<OL>
  <LI>Use of EqualityComparable, which only puts requirements on a single type, 
  when in fact an equality operator is required between two different types, 
  typically either T and the iterator's value type or between the value types of 
  two different iterators. 
  <LI>Use of Assignable for T when in fact what was needed is Assignable for the 
  value_type of the iterator, and convertability from T to the value_type of the 
  iterator. Or for output iterators, the requirement should be that T is 
  writable to the iterator (output iterators do not have value types). </LI></OL>
<P>Here is the list of algorithms that contain mistakes: </P>
<UL>
  <LI>25.1.2 std::find 
  <LI>25.1.6 std::count 
  <LI>25.1.8 std::equal 
  <LI>25.1.9 std::search, std::search_n 
  <LI>25.2.4 std::replace, std::replace_copy 
  <LI>25.2.5 std::fill 
  <LI>25.2.7 std::remove, std::remove_copy </LI></UL>
<P>Also, in the requirements for EqualityComparable, the requirement that the 
operator be defined for const objects is lacking. </P>
<P><B>Proposed resolution:</B></P>
<P>20.1.1 Change p1 from</P>
<P>In Table 28, <TT>T</TT> is a type to be supplied by a C++ program 
instantiating a template, <TT>a</TT>, <TT>b</TT>, and <TT>c</TT> are values of 
type <TT>T</TT>. </P>
<P>to</P>
<P>In Table 28, <TT>T</TT> is a type to be supplied by a C++ program 
instantiating a template, <TT>a</TT>, <TT>b</TT>, and <TT>c</TT> are values of 
type <TT>const T</TT>. </P>
<P>25 Between p8 and p9</P>
<P>Add the following sentence:</P>
<P>When the description of an algorithm gives an expression such as <TT>*first 
== value</TT> for a condition, it is required that the expression evaluate to 
either true or false in boolean contexts.</P>
<P>25.1.2 Change p1 by deleting the requires clause.</P>
<P>25.1.6 Change p1 by deleting the requires clause.</P>
<P>25.1.9</P>
<P>Change p4 from</P>
<P>-4- Requires: Type <TT>T</TT> is <TT>EqualityComparable</TT> (20.1.1), type 
Size is convertible to integral type (4.7.12.3). </P>
<P>to</P>
<P>-4- Requires: The type <TT>Size</TT> is convertible to integral type 
(4.7.12.3).</P>
<P>25.2.4 Change p1 from</P>
<P>-1- Requires: Type <TT>T</TT> is <TT>Assignable</TT> (23.1 ) (and, for 
<TT>replace()</TT>, <TT>EqualityComparable</TT> (20.1.1 )).</P>
<P>to</P>
<P>-1- Requires: The expression <TT>*first = new_value</TT> must be valid.</P>
<P>and change p4 from</P>
<P>-4- Requires: Type <TT>T</TT> is <TT>Assignable</TT> (23.1) (and, for 
<TT>replace_copy()</TT>, <TT>EqualityComparable</TT> (20.1.1)). The ranges 
<TT>[first, last)</TT> and <TT>[result, result + (last - first))</TT> shall not 
overlap.</P>
<P>to</P>
<P>-4- Requires: The results of the expressions <TT>*first</TT> and 
<TT>new_value</TT> must be writable to the result output iterator. The ranges 
<TT>[first, last)</TT> and <TT>[result, result + (last - first))</TT> shall not 
overlap.</P>
<P>25.2.5 Change p1 from</P>
<P>-1- Requires: Type <TT>T</TT> is <TT>Assignable</TT> (23.1). The type 
<TT>Size</TT> is convertible to an integral type (4.7.12.3).</P>
<P>to</P>
<P>-1- Requires: The expression <TT>value</TT> must be is writable to the output 
iterator. The type <TT>Size</TT> is convertible to an integral type 
(4.7.12.3).</P>
<P>25.2.7 Change p1 from</P>
<P>-1- Requires: Type <TT>T</TT> is <TT>EqualityComparable</TT> (20.1.1).</P>
<P>to</P>
<P>-1- Requires: The value type of the iterator must be <TT>Assignable</TT> 
(23.1). </P>
<P><B>Rationale:</B></P>
<P>The general idea of the proposed solution is to remove the faulty requires 
clauses and let the returns and effects clauses speak for themselves. That is, 
the returns clauses contain expressions that must be valid, and therefore 
already imply the correct requirements. In addition, a sentence is added at the 
beginning of chapter 25 saying that expressions given as conditions must 
evaluate to true or false in a boolean context. An alternative would be to say 
that the type of these condition expressions must be literally bool, but that 
would be imposing a greater restriction that what the standard currently says 
(which is convertible to bool). </P>
<HR>
<A name=284>
<H3>284.&nbsp;unportable example in 20.3.7, p6</H3></A>
<P><B>Section:</B>&nbsp;20.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.pointer.adaptors">[lib.function.pointer.adaptors]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;26 Dec 2000</P>
<P>The example in 20.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.pointer.adaptors">[lib.function.pointer.adaptors]</A>, 
p6 shows how to use the C library function <TT>strcmp()</TT> with the function 
pointer adapter <TT>ptr_fun()</TT>. But since it's unspecified whether the C 
library functions have <TT>extern "C"</TT> or <TT>extern "C++"</TT> linkage 
[17.4.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.using.linkage">[lib.using.linkage]</A>], 
and since function pointers with different the language linkage specifications 
(7.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/dcl.html#dcl.link">[dcl.link]</A>) 
are incompatible, whether this example is well-formed is unspecified. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 20.3.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.function.pointer.adaptors">[lib.function.pointer.adaptors]</A> 
paragraph 6 from:</P>
<BLOCKQUOTE>
  <P>[<I>Example:</I></P><PRE>    replace_if(v.begin(), v.end(), not1(bind2nd(ptr_fun(strcmp), "C")), "C++");
  </PRE>
  <P>replaces each <TT>C</TT> with <TT>C++</TT> in sequence 
<TT>v</TT>.</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>[<I>Example:</I></P><PRE>    int compare(const char*, const char*);
    replace_if(v.begin(), v.end(),
               not1(bind2nd(ptr_fun(compare), "abc")), "def");
  </PRE>
  <P>replaces each <TT>abc</TT> with <TT>def</TT> in sequence 
<TT>v</TT>.</P></BLOCKQUOTE>
<P>Also, remove footnote 215 in that same paragraph.</P>
<P><I>[Copenhagen: Minor change in the proposed resolution. Since this issue 
deals in part with C and C++ linkage, it was believed to be too confusing for 
the strings in the example to be "C" and "C++". ]</I></P>
<P><I>[Redmond: More minor changes. Got rid of the footnote (which seems to make 
a sweeping normative requirement, even though footnotes aren't normative), and 
changed the sentence after the footnote so that it corresponds to the new code 
fragment.]</I></P>
<HR>
<A name=285>
<H3>285.&nbsp;minor editorial errors in fstream ctors</H3></A>
<P><B>Section:</B>&nbsp;27.8.1.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ifstream.cons">[lib.ifstream.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;31 Dec 2000</P>
<P>27.8.1.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ifstream.cons">[lib.ifstream.cons]</A>, 
p2, 27.8.1.9 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ofstream.cons">[lib.ofstream.cons]</A>, 
p2, and 27.8.1.12 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fstream.cons">[lib.fstream.cons]</A>, 
p2 say about the effects of each constructor: </P>
<P>... If that function returns a null pointer, calls <TT>setstate(failbit)</TT> 
(which may throw <TT>ios_base::failure</TT>). </P>
<P>The parenthetical note doesn't apply since the ctors cannot throw an 
exception due to the requirement in 27.4.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.cons">[lib.basic.ios.cons]</A>, 
p3 that <TT>exceptions()</TT> be initialized to <TT>ios_base::goodbit</TT>. </P>
<P><B>Proposed resolution:</B></P>
<P>Strike the parenthetical note from the Effects clause in each of the 
paragraphs mentioned above. </P>
<HR>
<A name=286>
<H3>286.&nbsp;&lt;cstdlib&gt; requirements missing size_t typedef</H3></A>
<P><B>Section:</B>&nbsp;25.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.c.library">[lib.alg.c.library]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;30 Dec 2000</P>
<P>The &lt;cstdlib&gt; header file contains prototypes for bsearch and qsort 
(C++ Standard section 25.4 paragraphs 3 and 4) and other prototypes (C++ 
Standard section 21.4 paragraph 1 table 49) that require the typedef size_t. Yet 
size_t is not listed in the &lt;cstdlib&gt; synopsis table 78 in section 25.4. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Add the type size_t to Table 78 (section 25.4) and add the type size_t 
&lt;cstdlib&gt; to Table 97 (section C.2). </P>
<P><B>Rationale:</B></P>
<P>Since size_t is in &lt;stdlib.h&gt;, it must also be in &lt;cstdlib&gt;.</P>
<HR>
<A name=288>
<H3>288.&nbsp;&lt;cerrno&gt; requirements missing macro EILSEQ</H3></A>
<P><B>Section:</B>&nbsp;19.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-diagnostics.html#lib.errno">[lib.errno]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Judy Ward&nbsp; <B>Date:</B>&nbsp;30 Dec 2000</P>
<P>ISO/IEC 9899:1990/Amendment1:1994 Section 4.3 States: "The list of macros 
defined in &lt;errno.h&gt; is adjusted to include a new macro, EILSEQ" </P>
<P>ISO/IEC 14882:1998(E) section 19.3 does not refer to the above amendment. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Update Table 26 (section 19.3) "Header &lt;cerrno&gt; synopsis" and Table 95 
(section C.2) "Standard Macros" to include EILSEQ. </P>
<HR>
<A name=291>
<H3>291.&nbsp;Underspecification of set algorithms</H3></A>
<P><B>Section:</B>&nbsp;25.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.set.operations">[lib.alg.set.operations]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;03 Jan 2001</P>
<P>The standard library contains four algorithms that compute set operations on 
sorted ranges: <TT>set_union</TT>, <TT>set_intersection</TT>, 
<TT>set_difference</TT>, and <TT>set_symmetric_difference</TT>. Each of these 
algorithms takes two sorted ranges as inputs, and writes the output of the 
appropriate set operation to an output range. The elements in the output range 
are sorted. </P>
<P>The ordinary mathematical definitions are generalized so that they apply to 
ranges containing multiple copies of a given element. Two elements are 
considered to be "the same" if, according to an ordering relation provided by 
the user, neither one is less than the other. So, for example, if one input 
range contains five copies of an element and another contains three, the output 
range of <TT>set_union</TT> will contain five copies, the output range of 
<TT>set_intersection</TT> will contain three, the output range of 
<TT>set_difference</TT> will contain two, and the output range of 
<TT>set_symmetric_difference</TT> will contain two. </P>
<P>Because two elements can be "the same" for the purposes of these set 
algorithms, without being identical in other respects (consider, for example, 
strings under case-insensitive comparison), this raises a number of unanswered 
questions: </P>
<UL>
  <LI>If we're copying an element that's present in both of the input ranges, 
  which one do we copy it from? 
  <LI>If there are <I>n</I> copies of an element in the relevant input range, 
  and the output range will contain fewer copies (say <I>m</I>) which ones do we 
  choose? The first <I>m</I>, or the last <I>m</I>, or something else? 
  <LI>Are these operations stable? That is, does a run of equivalent elements 
  appear in the output range in the same order as as it appeared in the input 
  range(s)? </LI></UL>
<P>The standard should either answer these questions, or explicitly say that the 
answers are unspecified. I prefer the former option, since, as far as I know, 
all existing implementations behave the same way. </P>
<P><B>Proposed resolution:</B></P>
<P>Add the following to the end of 25.3.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.set.union">[lib.set.union]</A> 
paragraph 5:</P>
<BLOCKQUOTE>If [first1, last1) contains <I>m</I> elements that are equivalent 
  to each other and [first2, last2) contains <I>n</I> elements that are 
  equivalent to them, then max(<I>m</I>, <I>n</I>) of these elements will be 
  copied to the output range: all <I>m</I> of these elements from [first1, 
  last1), and the last max(<I>n-m</I>, 0) of them from [first2, last2), in that 
  order. </BLOCKQUOTE>
<P>Add the following to the end of 25.3.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.set.intersection">[lib.set.intersection]</A> 
paragraph 5:</P>
<BLOCKQUOTE>If [first1, last1) contains <I>m</I> elements that are equivalent 
  to each other and [first2, last2) contains <I>n</I> elements that are 
  equivalent to them, the first min(<I>m</I>, <I>n</I>) of those elements from 
  [first1, last1) are copied to the output range. </BLOCKQUOTE>
<P>Add a new paragraph, <B>Notes</B>, after 25.3.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.set.difference">[lib.set.difference]</A> 
paragraph 4:</P>
<BLOCKQUOTE>If [first1, last1) contains <I>m</I> elements that are equivalent 
  to each other and [first2, last2) contains <I>n</I> elements that are 
  equivalent to them, the last max(<I>m-n</I>, 0) elements from [first1, last1) 
  are copied to the output range. </BLOCKQUOTE>
<P>Add a new paragraph, <B>Notes</B>, after 25.3.5.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.set.symmetric.difference">[lib.set.symmetric.difference]</A> 
paragraph 4:</P>
<BLOCKQUOTE>If [first1, last1) contains <I>m</I> elements that are equivalent 
  to each other and [first2, last2) contains <I>n</I> elements that are 
  equivalent to them, then |<I>m - n</I>| of those elements will be copied to 
  the output range: the last <I>m - n</I> of these elements from [first1, last1) 
  if <I>m</I> &gt; <I>n</I>, and the last <I>n - m</I> of these elements from 
  [first2, last2) if <I>m</I> &lt; <I>n</I>. </BLOCKQUOTE>
<P><I>[Santa Cruz: it's believed that this language is clearer than what's in 
the Standard. However, it's also believed that the Standard may already make 
these guarantees (although not quite in these words). Bill and Howard will check 
and see whether they think that some or all of these changes may be redundant. 
If so, we may close this issue as NAD.]</I></P>
<P><B>Rationale:</B></P>
<P>For simple cases, these descriptions are equivalent to what's already in the 
Standard. For more complicated cases, they describe the behavior of existing 
implementations.</P>
<HR>
<A name=292>
<H3>292.&nbsp;effects of a.copyfmt (a)</H3></A>
<P><B>Section:</B>&nbsp;27.4.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.basic.ios.members">[lib.basic.ios.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;05 Jan 2001</P>
<P>The Effects clause of the member function <TT>copyfmt()</TT> 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 <TT>(this == &amp;rhs)</TT>. If the two 
arguments are identical there is no need to copy any of the data members or call 
any callbacks registered with <TT>register_callback()</TT>. Also, as Howard 
Hinnant points out in message c++std-lib-8149 it appears to be incorrect to 
allow the object to fire <TT>erase_event</TT> followed by <TT>copyfmt_event</TT> 
since the callback handling the latter event may inadvertently attempt to access 
memory freed by the former. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the Effects clause in 27.4.4.2, p15 from</P>
<BLOCKQUOTE><B>-15- Effects:</B>Assigns to the member objects of 
  <TT>*this</TT> the corresponding member objects of <TT>rhs</TT>, except 
  that... </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE><B>-15- Effects:</B>If <TT>(this == &amp;rhs)</TT> does nothing. 
  Otherwise assigns to the member objects of <TT>*this</TT> the corresponding 
  member objects of <TT>rhs</TT>, except that... </BLOCKQUOTE>
<HR>
<A name=295>
<H3>295.&nbsp;Is abs defined in &lt;cmath&gt;?</H3></A>
<P><B>Section:</B>&nbsp;26.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.c.math">[lib.c.math]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Jens Maurer&nbsp; <B>Date:</B>&nbsp;12 Jan 2001</P>
<P>Table 80 lists the contents of the &lt;cmath&gt; header. It does not list 
<TT>abs()</TT>. However, 26.5, paragraph 6, which lists added signatures present 
in &lt;cmath&gt;, does say that several overloads of <TT>abs()</TT> should be 
defined in &lt;cmath&gt;. </P>
<P><B>Proposed resolution:</B></P>
<P>Add <TT>abs</TT> to Table 80. Also, remove the parenthetical list of 
functions "(abs(), div(), rand(), srand())" from 26.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.c.math">[lib.c.math]</A>, 
paragraph 1. </P>
<P><I>[Copenhagen: Modified proposed resolution so that it also gets rid of that 
vestigial list of functions in paragraph 1.]</I></P>
<P><B>Rationale:</B></P>
<P>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 &lt;cmath&gt; 
that we aren't also putting in &lt;cstdlib&gt;. That's issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#323">323</A>.</P>
<HR>
<A name=297>
<H3>297.&nbsp;const_mem_fun_t&lt;&gt;::argument_type should be const T*</H3></A>
<P><B>Section:</B>&nbsp;20.3.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.member.pointer.adaptors">[lib.member.pointer.adaptors]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;6 Jan 2001</P>
<P>The class templates <TT>const_mem_fun_t</TT> in 20.3.8, p8 and 
<TT>const_mem_fun1_t</TT> in 20.3.8, p9 derive from <TT>unary_function&lt;T*, 
S&gt;</TT>, and <TT>binary_function&lt;T*, A, S&gt;</TT>, respectively. 
Consequently, their <TT>argument_type</TT>, and <TT>first_argument_type</TT> 
members, respectively, are both defined to be <TT>T*</TT> (non-const). However, 
their function call member operator takes a <TT>const T*</TT> argument. It is my 
opinion that <TT>argument_type</TT> should be <TT>const T*</TT> instead, so that 
one can easily refer to it in generic code. The example below derived from 
existing code fails to compile due to the discrepancy: </P>
<P><TT>template &lt;class T&gt;</TT> <BR><TT>void foo (typename T::argument_type 
arg)&nbsp;&nbsp; // #1</TT> <BR><TT>{</TT> <BR><TT>&nbsp;&nbsp;&nbsp; typename 
T::result_type (T::*pf) (typename T::argument_type) const =&nbsp;&nbsp; // 
#2</TT> <BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&amp;T::operator();</TT> <BR><TT>}</TT> </P>
<P><TT>struct X { /* ... */ };</TT></P>
<P><TT>int main ()</TT> <BR><TT>{</TT> <BR><TT>&nbsp;&nbsp;&nbsp; const X 
x;</TT> <BR><TT>&nbsp;&nbsp;&nbsp; foo&lt;std::const_mem_fun_t&lt;void, X&gt; 
&gt;(&amp;x);&nbsp;&nbsp; // #3</TT> <BR><TT>}</TT> </P>
<P>#1 <TT>foo()</TT> takes a plain unqualified <TT>X*</TT> as an argument <BR>#2 
the type of the pointer is incompatible with the type of the member function 
<BR>#3 the address of a constant being passed to a function taking a non-const 
<TT>X*</TT> </P>
<P><B>Proposed resolution:</B></P>
<P>Replace the top portion of the definition of the class template 
const_mem_fun_t in 20.3.8, p8 </P>
<P><TT>template &lt;class S, class T&gt; class const_mem_fun_t</TT> 
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public 
unary_function&lt;T*, S&gt; {</TT> </P>
<P>with</P>
<P><TT>template &lt;class S, class T&gt; class const_mem_fun_t</TT> 
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public 
unary_function&lt;<B>const</B> T*, S&gt; {</TT> </P>
<P>Also replace the top portion of the definition of the class template 
const_mem_fun1_t in 20.3.8, p9</P>
<P><TT>template &lt;class S, class T, class A&gt; class const_mem_fun1_t</TT> 
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public 
binary_function&lt;T*, A, S&gt; {</TT> </P>
<P>with</P>
<P><TT>template &lt;class S, class T, class A&gt; class const_mem_fun1_t</TT> 
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public 
binary_function&lt;<B>const</B> T*, A, S&gt; {</TT> </P>
<P><B>Rationale:</B></P>
<P>This is simply a contradiction: the <TT>argument_type</TT> typedef, and the 
argument type itself, are not the same.</P>
<HR>
<A name=298>
<H3>298.&nbsp;::operator delete[] requirement incorrect/insufficient</H3></A>
<P><B>Section:</B>&nbsp;18.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.array">[lib.new.delete.array]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;John A. Pedretti&nbsp; <B>Date:</B>&nbsp;10 Jan 2001</P>
<P>The default behavior of <TT>operator delete[]</TT> described in 18.4.1.2, p12 
- namely that for non-null value of <I>ptr</I>, the operator reclaims storage 
allocated by the earlier call to the default <TT>operator new[]</TT> - is not 
correct in all cases. Since the specified <TT>operator new[]</TT> default 
behavior is to call <TT>operator new</TT> (18.4.1.2, p4, p8), which can be 
replaced, along with <TT>operator delete</TT>, by the user, to implement their 
own memory management, the specified default behavior of<TT> operator 
delete[]</TT> must be to call <TT>operator delete</TT>. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 18.4.1.2, p12 from</P>
<BLOCKQUOTE><B>-12-</B> <B>Default behavior:</B> 
  <UL>
    <LI>For a null value of <I><TT>ptr</TT></I> , does nothing. 
    <LI>Any other value of <I><TT>ptr</TT></I> shall be a value returned earlier 
    by a call to the default <TT>operator new[](std::size_t)</TT>. [Footnote: 
    The value must not have been invalidated by an intervening call to 
    <TT>operator delete[](void*)</TT> (17.4.3.7 <A 
    href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.res.on.arguments">[lib.res.on.arguments]</A>). 
    --- end footnote] For such a non-null value of <I><TT>ptr</TT></I> , 
    reclaims storage allocated by the earlier call to the default <TT>operator 
    new[]</TT>. </LI></UL></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE><B>-12-</B> <B>Default behavior: </B>Calls <TT>operator 
  delete(</TT><I>ptr</I>) or <TT>operator delete(<I>ptr</I>, std::nothrow)</TT> 
  respectively. </BLOCKQUOTE>
<P>and expunge paragraph 13.</P>
<HR>
<A name=300>
<H3>300.&nbsp;list::merge() specification incomplete</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;John Pedretti&nbsp; <B>Date:</B>&nbsp;23 Jan 2001</P>
<P>The "Effects" clause for list::merge() (23.2.2.4, p23) appears to be 
incomplete: it doesn't cover the case where the argument list is identical to 
*this (i.e., this == &amp;x). The requirement in the note in p24 (below) is that 
x be empty after the merge which is surely unintended in this case. </P>
<P><B>Proposed resolution:</B></P>
<P>In 23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
replace paragraps 23-25 with:</P>
<BLOCKQUOTE>
  <P>23 Effects: if (&amp;x == this) does nothing; otherwise, merges the two 
  sorted ranges [begin(), end()) and [x.begin(), x.end()). The result is a range 
  in which the elements will be sorted in non-decreasing order according to the 
  ordering defined by comp; that is, for every iterator i in the range other 
  than the first, the condition comp(*i, *(i - 1)) will be false. </P>
  <P>24 Notes: Stable: if (&amp;x != this), then for equivalent elements in the 
  two original ranges, the elements from the original range [begin(), end()) 
  always precede the elements from the original range [x.begin(), x.end()). If 
  (&amp;x != this) the range [x.begin(), x.end()) is empty after the merge. </P>
  <P>25 Complexity: At most size() + x.size() - 1 applications of comp if 
  (&amp;x ! = this); otherwise, no applications of comp are performed. If an 
  exception is thrown other than by a comparison there are no effects. 
</P></BLOCKQUOTE>
<P><I>[Copenhagen: The original proposed resolution did not fix all of the 
problems in 23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
p22-25. Three different paragraphs (23, 24, 25) describe the effects of 
<TT>merge</TT>. Changing p23, without changing the other two, appears to 
introduce contradictions. Additionally, "merges the argument list into the list" 
is excessively vague.]</I></P>
<P><I>[Post-Curaao: Robert Klarer provided new wording.]</I></P>
<HR>
<A name=301>
<H3>301.&nbsp;basic_string template ctor effects clause omits allocator 
argument</H3></A>
<P><B>Section:</B>&nbsp;21.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string.cons">[lib.string.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;27 Jan 2001</P>
<P>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 a mistake. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace</P>
<BLOCKQUOTE>
  <P><B>-15- Effects:</B> If <I><TT>InputIterator</TT></I> is an integral type, 
  equivalent to</P>
  <BLOCKQUOTE><TT>basic_string(static_cast&lt;size_type&gt;(begin), 
    static_cast&lt;value_type&gt;(end))</TT></BLOCKQUOTE></BLOCKQUOTE>
<P>with</P>
<BLOCKQUOTE>
  <P><B>-15- Effects:</B> If <I><TT>InputIterator</TT></I> is an integral type, 
  equivalent to</P>
  <BLOCKQUOTE><TT>basic_string(static_cast&lt;size_type&gt;(begin), 
    static_cast&lt;value_type&gt;(end), <B>a</B>)</TT></BLOCKQUOTE></BLOCKQUOTE>
<HR>
<A name=303>
<H3>303.&nbsp;Bitset input operator underspecified</H3></A>
<P><B>Section:</B>&nbsp;23.3.5.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.bitset.operators">[lib.bitset.operators]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;5 Feb 2001</P>
<P>In 23.3.5.3, we are told that <TT>bitset</TT>'s input operator "Extracts up 
to <I>N</I> (single-byte) characters from <I>is</I>.", where <I>is</I> is a 
stream of type <TT>basic_istream&lt;charT, traits&gt;</TT>. </P>
<P>The standard does not say what it means to extract single byte characters 
from a stream whose character type, <TT>charT</TT>, is in general not a 
single-byte character type. Existing implementations differ. </P>
<P>A reasonable solution will probably involve <TT>widen()</TT> and/or 
<TT>narrow()</TT>, since they are the supplied mechanism for converting a single 
character between <TT>char</TT> and arbitrary <TT>charT</TT>. </P>
<P>Narrowing the input characters is not the same as widening the literals 
<TT>'0'</TT> and <TT>'1'</TT>, because there may be some locales in which more 
than one wide character maps to the narrow character <TT>'0'</TT>. Narrowing 
means that alternate representations may be used for bitset input, widening 
means that they may not be.</P>
<P>Note that for numeric input, <TT>num_get&lt;&gt;</TT> (22.2.2.1.2/8) compares 
input characters to widened version of narrow character literals.</P>
<P>From Pete Becker, in c++std-lib-8224:</P>
<BLOCKQUOTE>
  <P>Different writing systems can have different representations for the digits 
  that represent 0 and 1. For example, in the Unicode representation of the 
  Devanagari script (used in many of the Indic languages) the digit 0 is 0x0966, 
  and the digit 1 is 0x0967. Calling narrow would translate those into '0' and 
  '1'. But Unicode also provides the ASCII values 0x0030 and 0x0031 for for the 
  Latin representations of '0' and '1', as well as code points for the same 
  numeric values in several other scripts (Tamil has no character for 0, but 
  does have the digits 1-9), and any of these values would also be narrowed to 
  '0' and '1'. </P>
  <P>...</P>
  <P>It's fairly common to intermix both native and Latin representations of 
  numbers in a document. So I think the rule has to be that if a wide character 
  represents a digit whose value is 0 then the bit should be cleared; if it 
  represents a digit whose value is 1 then the bit should be set; otherwise 
  throw an exception. So in a Devanagari locale, both 0x0966 and 0x0030 would 
  clear the bit, and both 0x0967 and 0x0031 would set it. Widen can't do that. 
  It would pick one of those two values, and exclude the other one. 
</P></BLOCKQUOTE>
<P>From Jens Maurer, in c++std-lib-8233:</P>
<BLOCKQUOTE>
  <P>Whatever we decide, I would find it most surprising if bitset conversion 
  worked differently from int conversion with regard to alternate local 
  representations of numbers. </P>
  <P>Thus, I think the options are:</P>
  <UL>
    <LI>Have a new defect issue for 22.2.2.1.2/8 so that it will require the use 
    of narrow(). 
    <LI>Have a defect issue for bitset() which describes clearly that widen() is 
    to be used. </LI></UL></BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Replace the first two sentences of paragraph 5 with:</P>
<BLOCKQUOTE>Extracts up to <I>N</I> characters from <I>is</I>. Stores these 
  characters in a temporary object <I>str</I> of type <TT>basic_string&lt;charT, 
  traits&gt;</TT>, then evaluates the expression <TT><I>x</I> = 
  bitset&lt;N&gt;(<I>str</I>)</TT>. </BLOCKQUOTE>
<P>Replace the third bullet item in paragraph 5 with:</P>
<UL>
  <LI>the next input character is neither <TT><I>is</I>.widen(0)</TT> nor 
  <TT><I>is</I>.widen(1)</TT> (in which case the input character is not 
  extracted). </LI></UL>
<P><B>Rationale:</B></P>
<P>Input for <TT>bitset</TT> should work the same way as numeric input. Using 
<TT>widen</TT> does mean that alternative digit representations will not be 
recognized, but this was a known consequence of the design choice.</P>
<HR>
<A name=305>
<H3>305.&nbsp;Default behavior of codecvt&lt;wchar_t, char, 
mbstate_t&gt;::length()</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;24 Jan 2001</P>
<P>22.2.1.5/3 introduces codecvt in part with:</P>
<BLOCKQUOTE>codecvt&lt;wchar_t,char,mbstate_t&gt; converts between the native 
  character sets for tiny and wide characters. Instantiations on mbstate_t 
  perform conversion between encodings known to the library implementor. 
</BLOCKQUOTE>
<P>But 22.2.1.5.2/10 describes do_length in part with:</P>
<BLOCKQUOTE>... codecvt&lt;wchar_t, char, mbstate_t&gt; ... return(s) the 
  lesser of max and (from_end-from). </BLOCKQUOTE>
<P>The semantics of do_in and do_length are linked. What one does must be 
consistent with what the other does. 22.2.1.5/3 leads me to believe that the 
vendor is allowed to choose the algorithm that 
codecvt&lt;wchar_t,char,mbstate_t&gt;::do_in performs so that it makes his 
customers happy on a given platform. But 22.2.1.5.2/10 explicitly says what 
codecvt&lt;wchar_t,char,mbstate_t&gt;::do_length must return. And thus 
indirectly specifies the algorithm that 
codecvt&lt;wchar_t,char,mbstate_t&gt;::do_in must perform. I believe that this 
is not what was intended and is a defect. </P>
<P>Discussion from the -lib reflector: <BR>This proposal would have the effect 
of making the semantics of all of the virtual functions in 
<TT>codecvt&lt;wchar_t, char, mbstate_t&gt;</TT> implementation specified. Is 
that what we want, or do we want to mandate specific behavior for the base class 
virtuals and leave the implementation specified behavior for the codecvt_byname 
derived class? The tradeoff is that former allows implementors to write a base 
class that actually does something useful, while the latter gives users a way to 
get known and specified---albeit useless---behavior, and is consistent with the 
way the standard handles other facets. It is not clear what the original 
intention was.</P>
<P>Nathan has suggest a compromise: a character that is a widened version of the 
characters in the basic execution character set must be converted to a one-byte 
sequence, but there is no such requirement for characters that are not part of 
the basic execution character set. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 22.2.1.5.2/5 from: </P>
<P>The instantiations required in Table 51 (lib.locale.category), namely 
codecvt&lt;wchar_t,char,mbstate_t&gt; and codecvt&lt;char,char,mbstate_t&gt;, 
store no characters. Stores no more than (to_limit-to) destination elements. It 
always leaves the to_next pointer pointing one beyond the last element 
successfully stored. </P>
<P>to: </P>
<P>Stores no more than (to_limit-to) destination elements, and leaves the 
to_next pointer pointing one beyond the last element successfully stored. 
codecvt&lt;char,char,mbstate_t&gt; stores no characters. </P>
<P>Change 22.2.1.5.2/10 from:</P>
<BLOCKQUOTE>-10- Returns: (from_next-from) where from_next is the largest 
  value in the range [from,from_end] such that the sequence of values in the 
  range [from,from_next) represents max or fewer valid complete characters of 
  type internT. The instantiations required in Table 51 (21.1.1.1.1), namely 
  codecvt&lt;wchar_t, char, mbstate_t&gt; and codecvt&lt;char, char, 
  mbstate_t&gt;, return the lesser of max and (from_end-from). </BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>-10- Returns: (from_next-from) where from_next is the largest 
  value in the range [from,from_end] such that the sequence of values in the 
  range [from,from_next) represents max or fewer valid complete characters of 
  type internT. The instantiation codecvt&lt;char, char, mbstate_t&gt; returns 
  the lesser of max and (from_end-from). </BLOCKQUOTE>
<P><I>[Redmond: Nathan suggested an alternative resolution: same as above, but 
require that, in the default encoding, a character from the basic execution 
character set would map to a single external character. The straw poll was 8-1 
in favor of the proposed resolution.]</I></P>
<P><B>Rationale:</B></P>
<P>The default encoding should be whatever users of a given platform would 
expect to be the most natural. This varies from platform to platform. In many 
cases there is a preexisting C library, and users would expect the default 
encoding to be whatever C uses in the default "C" locale. We could impose a 
guarantee like the one Nathan suggested (a character from the basic execution 
character set must map to a 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.</P>
<P><I>[Curaao: fixed rationale typo at the request of Ichiro Koshida; 
"shift-JIS" changed to "JIS".]</I></P>
<HR>
<A name=306>
<H3>306.&nbsp;offsetof macro and non-POD types</H3></A>
<P><B>Section:</B>&nbsp;18.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.support.types">[lib.support.types]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;21 Feb 2001</P>
<P>Spliced together from reflector messages c++std-lib-8294 and -8295:</P>
<P>18.1, paragraph 5, reads: "The macro <TT>offsetof</TT> accepts a restricted 
set of <I>type</I> arguments in this International Standard. <I>type</I> 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."</P>
<P>For the POD requirement, it doesn't say "no diagnostic required" or 
"undefined behavior". I read 1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/intro.html#intro.compliance">[intro.compliance]</A>, 
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. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 18.1, paragraph 5, to "If <I>type</I> is not a POD structure or a POD 
union the results are undefined."</P>
<P><I>[Copenhagen: straw poll was 7-4 in favor. It was generally agreed that 
requiring a diagnostic was inadvertent, but some LWG members thought that 
diagnostics should be required whenever possible.]</I></P>
<HR>
<A name=307>
<H3>307.&nbsp;Lack of reference typedefs in container adaptors</H3></A>
<P><B>Section:</B>&nbsp;23.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.adaptors">[lib.container.adaptors]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;13 Mar 2001</P>
<P>From reflector message c++std-lib-8330. See also lib-8317.</P>
<P>The standard is currently inconsistent in 23.2.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.priority.queue">[lib.priority.queue]</A> 
paragraph 1 and 23.2.3.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.stack">[lib.stack]</A> 
paragraph 1. 23.2.3.3/1, for example, says: </P>
<BLOCKQUOTE>-1- Any sequence supporting operations back(), push_back() and 
  pop_back() can be used to instantiate stack. In particular, vector 
  (lib.vector), list (lib.list) and deque (lib.deque) can be used. </BLOCKQUOTE>
<P>But this is false: vector&lt;bool&gt; can not be used, because the container 
adaptors return a T&amp; rather than using the underlying container's reference 
type.</P>
<P>This is a contradiction that can be fixed by:</P>
<OL>
  <LI>Modifying these paragraphs to say that vector&lt;bool&gt; is an exception. 

  <LI>Removing the vector&lt;bool&gt; specialization. 
  <LI>Changing the return types of stack and priority_queue to use reference 
  typedef's. </LI></OL>
<P>I propose 3. This does not preclude option 2 if we choose to do it later (see 
issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#96">96</A>); 
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 
does not break any code. </P>
<P><B>Proposed resolution:</B></P>
<P>Summary: Add reference and const_reference typedefs to queue, priority_queue 
and stack. Change return types of "value_type&amp;" to "reference". Change 
return types of "const value_type&amp;" to "const_reference". Details:</P>
<P>Change 23.2.3.1/1 from:</P><PRE>  namespace std {
    template &lt;class T, class Container = deque&lt;T&gt; &gt;
    class queue {
    public:
      typedef typename Container::value_type            value_type;
      typedef typename Container::size_type             size_type;
      typedef          Container                        container_type;
    protected:
      Container c;

    public:
      explicit queue(const Container&amp; = Container());

      bool      empty() const             { return c.empty(); }
      size_type size()  const             { return c.size(); }
      value_type&amp;       front()           { return c.front(); }
      const value_type&amp; front() const     { return c.front(); }
      value_type&amp;       back()            { return c.back(); }
      const value_type&amp; back() const      { return c.back(); }
      void push(const value_type&amp; x)      { c.push_back(x); }
      void pop()                          { c.pop_front(); }
    };
</PRE>
<P>to:</P><PRE>  namespace std {
    template &lt;class T, class Container = deque&lt;T&gt; &gt;
    class queue {
    public:
      typedef typename Container::value_type            value_type;
      typedef typename Container::reference             reference;
      typedef typename Container::const_reference       const_reference;
      typedef typename Container::value_type            value_type;
      typedef typename Container::size_type             size_type;
      typedef          Container                        container_type;
    protected:
      Container c;

    public:
      explicit queue(const Container&amp; = Container());

      bool      empty() const             { return c.empty(); }
      size_type size()  const             { return c.size(); }
      reference         front()           { return c.front(); }
      const_reference   front() const     { return c.front(); }
      reference         back()            { return c.back(); }
      const_reference   back() const      { return c.back(); }
      void push(const value_type&amp; x)      { c.push_back(x); }
      void pop()                          { c.pop_front(); }
    };
</PRE>
<P>Change 23.2.3.2/1 from:</P><PRE>  namespace std {
    template &lt;class T, class Container = vector&lt;T&gt;,
              class Compare = less&lt;typename Container::value_type&gt; &gt;
    class priority_queue {
    public:
      typedef typename Container::value_type            value_type;
      typedef typename Container::size_type             size_type;
      typedef          Container                        container_type;
    protected:
      Container c;
      Compare comp;

    public:
      explicit priority_queue(const Compare&amp; x = Compare(),
                              const Container&amp; = Container());
      template &lt;class InputIterator&gt;
        priority_queue(InputIterator first, InputIterator last,
                       const Compare&amp; x = Compare(),
                       const Container&amp; = Container());

      bool      empty() const       { return c.empty(); }
      size_type size()  const       { return c.size(); }
      const value_type&amp; top() const { return c.front(); }
      void push(const value_type&amp; x);
      void pop();
    };
                                  //  no equality is provided
  }
</PRE>
<P>to:</P><PRE>  namespace std {
    template &lt;class T, class Container = vector&lt;T&gt;,
              class Compare = less&lt;typename Container::value_type&gt; &gt;
    class priority_queue {
    public:
      typedef typename Container::value_type            value_type;
      typedef typename Container::reference             reference;
      typedef typename Container::const_reference       const_reference;
      typedef typename Container::size_type             size_type;
      typedef          Container                        container_type;
    protected:
      Container c;
      Compare comp;

    public:
      explicit priority_queue(const Compare&amp; x = Compare(),
                              const Container&amp; = Container());
      template &lt;class InputIterator&gt;
        priority_queue(InputIterator first, InputIterator last,
                       const Compare&amp; x = Compare(),
                       const Container&amp; = Container());

      bool      empty() const       { return c.empty(); }
      size_type size()  const       { return c.size(); }
      const_reference   top() const { return c.front(); }
      void push(const value_type&amp; x);
      void pop();
    };
                                  //  no equality is provided
  }
</PRE>
<P>And change 23.2.3.3/1 from:</P><PRE>  namespace std {
    template &lt;class T, class Container = deque&lt;T&gt; &gt;
    class stack {
    public:
      typedef typename Container::value_type            value_type;
      typedef typename Container::size_type             size_type;
      typedef          Container                        container_type;
    protected:
      Container c;

    public:
      explicit stack(const Container&amp; = Container());

      bool      empty() const             { return c.empty(); }
      size_type size()  const             { return c.size(); }
      value_type&amp;       top()             { return c.back(); }
      const value_type&amp; top() const       { return c.back(); }
      void push(const value_type&amp; x)      { c.push_back(x); }
      void pop()                          { c.pop_back(); }
    };

    template &lt;class T, class Container&gt;
      bool operator==(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&lt; (const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator!=(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&gt; (const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&gt;=(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&lt;=(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
  }
</PRE>
<P>to:</P><PRE>  namespace std {
    template &lt;class T, class Container = deque&lt;T&gt; &gt;
    class stack {
    public:
      typedef typename Container::value_type            value_type;
      typedef typename Container::reference             reference;
      typedef typename Container::const_reference       const_reference;
      typedef typename Container::size_type             size_type;
      typedef          Container                        container_type;
    protected:
      Container c;

    public:
      explicit stack(const Container&amp; = Container());

      bool      empty() const             { return c.empty(); }
      size_type size()  const             { return c.size(); }
      reference         top()             { return c.back(); }
      const_reference   top() const       { return c.back(); }
      void push(const value_type&amp; x)      { c.push_back(x); }
      void pop()                          { c.pop_back(); }
    };

    template &lt;class T, class Container&gt;
      bool operator==(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&lt; (const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator!=(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&gt; (const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&gt;=(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
    template &lt;class T, class Container&gt;
      bool operator&lt;=(const stack&lt;T, Container&gt;&amp; x,
                      const stack&lt;T, Container&gt;&amp; y);
  }
</PRE>
<P><I>[Copenhagen: This change was discussed before the IS was released and it 
was deliberately not adopted. Nevertheless, the LWG believes (straw poll: 10-2) 
that it is a genuine defect.]</I></P>
<HR>
<A name=308>
<H3>308.&nbsp;Table 82 mentions unrelated headers</H3></A>
<P><B>Section:</B>&nbsp;27 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.input.output">[lib.input.output]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;15 Mar 2001</P>
<P>Table 82 in section 27 mentions the header &lt;cstdlib&gt; for String streams 
(27.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.string.streams">[lib.string.streams]</A>) 
and the headers &lt;cstdio&gt; and &lt;cwchar&gt; for File streams (27.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.file.streams">[lib.file.streams]</A>). 
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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.contents">[lib.contents]</A>, 
only such headers are to be listed in the summary. </P>
<P><B>Proposed resolution:</B></P>
<P>Remove &lt;cstdlib&gt; and &lt;cwchar&gt; from Table 82.</P>
<P><I>[Copenhagen: changed the proposed resolution slightly. The original 
proposed resolution also said to remove &lt;cstdio&gt; from Table 82. However, 
&lt;cstdio&gt; is mentioned several times within section 27.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.file.streams">[lib.file.streams]</A>, 
including 27.8.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.c.files">[lib.c.files]</A>.]</I></P>
<HR>
<A name=310>
<H3>310.&nbsp;Is errno a macro?</H3></A>
<P><B>Section:</B>&nbsp;17.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.headers">[lib.headers]</A>, 
19.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-diagnostics.html#lib.errno">[lib.errno]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Steve Clamage&nbsp; <B>Date:</B>&nbsp;21 Mar 2001</P>
<P>Exactly how should errno be declared in a conforming C++ header? </P>
<P>The C standard says in 7.1.4 that it is unspecified whether errno is a macro 
or an identifier with external linkage. In some implementations it can be 
either, depending on compile-time options. (E.g., on Solaris in multi-threading 
mode, errno is a macro that expands to a function call, but is an extern int 
otherwise. "Unspecified" allows such variability.) </P>
<P>The C++ standard:</P>
<UL>
  <LI>17.4.1.2 says in a note that errno must be macro in C. (false) 
  <LI>17.4.3.1.3 footnote 166 says errno is reserved as an external name (true), 
  and implies that it is an identifier. 
  <LI>19.3 simply lists errno as a macro (by what reasoning?) and goes on to say 
  that the contents of of C++ &lt;errno.h&gt; are the same as in C, begging the 
  question. 
  <LI>C.2, table 95 lists errno as a macro, without comment. </LI></UL>
<P>I find no other references to errno.</P>
<P>We should either explicitly say that errno must be a macro, even though it 
need not be a macro in C, or else explicitly leave it unspecified. We also need 
to say something about namespace std. A user who includes &lt;cerrno&gt; needs 
to know whether to write <TT>errno</TT>, or <TT>::errno</TT>, or 
<TT>std::errno</TT>, or else &lt;cerrno&gt; is useless.</P>
<P>Two acceptable fixes:</P>
<UL>
  <LI>
  <P>errno must be a macro. This is trivially satisfied by 
  adding<BR>&nbsp;&nbsp;#define errno (::std::errno)<BR>to the headers if errno 
  is not already a macro. You then always write errno without any scope 
  qualification, and it always expands to a correct reference. Since it is 
  always a macro, you know to avoid using errno as a local identifer.</P>
  <LI>
  <P>errno is in the global namespace. This fix is inferior, because ::errno is 
  not guaranteed to be well-formed.</P></LI></UL>
<P><I>[ This issue was first raised in 1999, but it slipped through the cracks. 
]</I></P>
<P><B>Proposed resolution:</B></P>
<P>Change the Note in section 17.4.1.2p5 from</P>
<BLOCKQUOTE>Note: the names defined as macros in C include the following: 
  assert, errno, offsetof, setjmp, va_arg, va_end, and va_start. </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>Note: the names defined as macros in C include the following: 
  assert, offsetof, setjmp, va_arg, va_end, and va_start. </BLOCKQUOTE>
<P>In section 19.3, change paragraph 2 from</P>
<BLOCKQUOTE>The contents are the same as the Standard C library header 
  &lt;errno.h&gt;. </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>The contents are the same as the Standard C library header 
  &lt;errno.h&gt;, except that errno shall be defined as a macro. </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>C++ must not leave it up to the implementation to decide whether or 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.</P>
<P><I>[Curaao: additional rationale added.]</I></P>
<HR>
<A name=311>
<H3>311.&nbsp;Incorrect wording in basic_ostream class synopsis</H3></A>
<P><B>Section:</B>&nbsp;27.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream">[lib.ostream]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andy Sawyer&nbsp; <B>Date:</B>&nbsp;21 Mar 2001</P>
<P>In 27.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream">[lib.ostream]</A>, 
the synopsis of class basic_ostream says:</P><PRE>  // partial specializationss
  template&lt;class traits&gt;
    basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;( basic_ostream&lt;char,traits&gt;&amp;,
                                            const char * );
</PRE>
<P>Problems:</P>
<UL>
  <LI>Too many 's's at the end of "specializationss" 
  <LI>This is an overload, not a partial specialization </LI></UL>
<P><B>Proposed resolution:</B></P>
<P>In the synopsis in 27.6.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream">[lib.ostream]</A>, 
remove the <I>// partial specializationss</I> comment. Also remove the same 
comment (correctly spelled, but still incorrect) from the synopsis in 27.6.2.5.4 
<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.inserters.character">[lib.ostream.inserters.character]</A>. 
</P>
<P><I>[ Pre-Redmond: added 27.6.2.5.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.inserters.character">[lib.ostream.inserters.character]</A> 
because of Martin's comment in c++std-lib-8939. ]</I></P>
<HR>
<A name=312>
<H3>312.&nbsp;Table 27 is missing headers</H3></A>
<P><B>Section:</B>&nbsp;20 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.utilities">[lib.utilities]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;29 Mar 2001</P>
<P>Table 27 in section 20 lists the header &lt;memory&gt; (only) for Memory 
(lib.memory) but neglects to mention the headers &lt;cstdlib&gt; and 
&lt;cstring&gt; that are discussed in 20.4.6 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.c.malloc">[lib.c.malloc]</A>.</P>
<P><B>Proposed resolution:</B></P>
<P>Add &lt;cstdlib&gt; and &lt;cstring&gt; to Table 27, in the same row as 
&lt;memory&gt;.</P>
<HR>
<A name=315>
<H3>315.&nbsp;Bad "range" in list::unique complexity</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andy Sawyer&nbsp; <B>Date:</B>&nbsp;1 May 2001</P>
<P>23.2.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.ops">[lib.list.ops]</A>, 
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)". </P>
<P>"(last - first)" is not a range. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the "range" from (last - first) to [first, last). </P>
<HR>
<A name=316>
<H3>316.&nbsp;Vague text in Table 69</H3></A>
<P><B>Section:</B>&nbsp;23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;4 May 2001</P>
<P>Table 69 says this about a_uniq.insert(t):</P>
<BLOCKQUOTE>inserts t if and only if there is no element in the container with 
  key equivalent to the key of t. The bool component of the returned pair 
  indicates whether the insertion takes place and the iterator component of the 
  pair points to the element with key equivalent to the key of t. </BLOCKQUOTE>
<P>The description should be more specific about exactly how the bool component 
indicates whether the insertion takes place.</P>
<P><B>Proposed resolution:</B></P>
<P>Change the text in question to</P>
<BLOCKQUOTE>...The bool component of the returned pair is true if and only if 
  the insertion takes place... </BLOCKQUOTE>
<HR>
<A name=317>
<H3>317.&nbsp;Instantiation vs. specialization of facets</H3></A>
<P><B>Section:</B>&nbsp;22 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.localization">[lib.localization]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;4 May 2001</P>
<P>The localization section of the standard refers to specializations of the 
facet templates as instantiations even though the required facets are typically 
specialized rather than explicitly (or implicitly) instantiated. In the case of 
ctype&lt;char&gt; and ctype_byname&lt;char&gt; (and the wchar_t versions), these 
facets are actually required to be specialized. The terminology should be 
corrected to make it clear that the standard doesn't mandate explicit 
instantiation (the term specialization encompasses both explicit instantiations 
and specializations). </P>
<P><B>Proposed resolution:</B></P>
<P>In the following paragraphs, replace all occurrences of the word 
instantiation or instantiations with specialization or specializations, 
respectively: </P>
<BLOCKQUOTE>22.1.1.1.1, p4, Table 52, 22.2.1.1, p2, 22.2.1.5, p3, 22.2.1.5.1, 
  p5, 22.2.1.5.2, p10, 22.2.2, p2, 22.2.3.1, p1, 22.2.3.1.2, p1, p2 and p3, 
  22.2.4.1, p1, 22.2.4.1.2, p1, 22,2,5, p1, 22,2,6, p2, 22.2.6.3.2, p7, and 
  Footnote 242. </BLOCKQUOTE>
<P>And change the text in 22.1.1.1.1, p4 from</P>
<BLOCKQUOTE>An implementation is required to provide those instantiations for 
  facet templates identified as members of a category, and for those shown in 
  Table 52: </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>An implementation is required to provide those specializations... 
</BLOCKQUOTE>
<P><I>[Nathan will review these changes, and will look for places where explicit 
specialization is necessary.]</I></P>
<P><B>Rationale:</B></P>
<P>This is a simple matter of outdated language. The language to describe 
templates was clarified during the standardization process, but the wording in 
clause 22 was never updated to reflect that change.</P>
<HR>
<A name=318>
<H3>318.&nbsp;Misleading comment in definition of numpunct_byname</H3></A>
<P><B>Section:</B>&nbsp;22.2.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.numpunct.byname">[lib.locale.numpunct.byname]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;12 May 2001</P>
<P>The definition of the numpunct_byname template contains the following 
comment:</P><PRE>    namespace std {
        template &lt;class charT&gt;
        class numpunct_byname : public numpunct&lt;charT&gt; {
    // this class is specialized for char and wchar_t.
        ...
</PRE>
<P>There is no documentation of the specializations and it seems conceivable 
that an implementation will not explicitly specialize the template at all, but 
simply provide the primary template.</P>
<P><B>Proposed resolution:</B></P>
<P>Remove the comment from the text in 22.2.3.2 and from the proposed resolution 
of library issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#228">228</A>.</P>
<HR>
<A name=319>
<H3>319.&nbsp;Storage allocation wording confuses "Required behavior", 
"Requires"</H3></A>
<P><B>Section:</B>&nbsp;18.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.single">[lib.new.delete.single]</A>, 
18.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.array">[lib.new.delete.array]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Beman Dawes&nbsp; <B>Date:</B>&nbsp;15 May 2001</P>
<P>The standard specifies 17.3.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.structure.specifications">[lib.structure.specifications]</A> 
that "Required behavior" elements describe "the semantics of a function 
definition provided by either the implementation or a C++ program."</P>
<P>The standard specifies 17.3.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.structure.specifications">[lib.structure.specifications]</A> 
that "Requires" elements describe "the preconditions for calling the 
function."</P>
<P>In the sections noted below, the current wording specifies "Required 
Behavior" for what are actually preconditions, and thus should be specified as 
"Requires".</P>
<P><B>Proposed resolution:</B></P>
<P>In 18.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.single">[lib.new.delete.single]</A> 
Para 12 Change:</P>
<BLOCKQUOTE>
  <P>Required behavior: accept a value of ptr that is null or that was returned 
  by an earlier call ...</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Requires: the value of ptr is null or the value returned by an earlier call 
  ...</P></BLOCKQUOTE>
<P>In 18.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.array">[lib.new.delete.array]</A> 
Para 11 Change:</P>
<BLOCKQUOTE>
  <P>Required behavior: accept a value of ptr that is null or that was returned 
  by an earlier call ...</P></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Requires: the value of ptr is null or the value returned by an earlier call 
  ...</P></BLOCKQUOTE>
<HR>
<A name=320>
<H3>320.&nbsp;list::assign overspecified</H3></A>
<P><B>Section:</B>&nbsp;23.2.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.list.cons">[lib.list.cons]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Howard Hinnant&nbsp; <B>Date:</B>&nbsp;17 May 2001</P>
<P>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. </P>
<P>I would like to document that implementers have the freedom to implement 
assign by other methods, as long as the end result is the same and the exception 
guarantee is as good or better than the basic guarantee. </P>
<P>The motivation for this is to use T's assignment operator to recycle existing 
nodes in the list instead of erasing them and reallocating them with new values. 
It is also worth noting that, with careful coding, most common cases of assign 
(everything but assignment with true input iterators) can elevate the exception 
safety to strong if T's assignment has a nothrow guarantee (with no extra memory 
cost). Metrowerks does this. However I do not propose that this subtlety be 
standardized. It is a QoI issue. </P>
<P>Existing practise: Metrowerks and SGI recycle nodes, Dinkumware and Rogue 
Wave don't. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 23.2.2.1/7 from:</P>
<BLOCKQUOTE>
  <P>Effects:</P><PRE>   erase(begin(), end());
   insert(begin(), first, last);
</PRE></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Effects: Replaces the contents of the list with the range [first, 
last).</P></BLOCKQUOTE>
<P>In 23.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.sequence.reqmts">[lib.sequence.reqmts]</A>, 
in Table 67 (sequence requirements), add two new rows:</P><PRE>      a.assign(i,j)     void      pre: i,j are not iterators into a.
                                  Replaces elements in a with a copy
                                  of [i, j).

      a.assign(n,t)     void      pre: t is not a reference into a.
                                  Replaces elements in a with n copies
                                  of t.
</PRE>
<P>Change 23.2.2.1/8 from:</P>
<BLOCKQUOTE>
  <P>Effects:</P><PRE>   erase(begin(), end());
   insert(begin(), n, t);
</PRE></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>Effects: Replaces the contents of the list with n copies of 
t.</P></BLOCKQUOTE>
<P><I>[Redmond: Proposed resolution was changed slightly. Previous version made 
explicit statement about exception safety, which wasn't consistent with the way 
exception safety is expressed elsewhere. Also, the change in the sequence 
requirements is new. Without that change, the proposed resolution would have 
required that assignment of a subrange would have to work. That too would have 
been overspecification; it would effectively mandate that assignment use a 
temporary. Howard provided wording. ]</I></P>
<P><I>[Curaao: 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.]</I></P>
<HR>
<A name=321>
<H3>321.&nbsp;Typo in num_get</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Kevin Djang&nbsp; <B>Date:</B>&nbsp;17 May 2001</P>
<P>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." However, Table 56 
uses the term "length modifier", not "length specifier". </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.1.2 at p7, change the text "A length specifier is added ..." to be 
"A length modifier is added ..." </P>
<P><B>Rationale:</B></P>
<P>C uses the term "length modifier". We should be consistent.</P>
<HR>
<A name=322>
<H3>322.&nbsp;iterator and const_iterator should have the same value 
type</H3></A>
<P><B>Section:</B>&nbsp;23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;17 May 2001</P>
<P>It's widely assumed that, if X is a container, 
iterator_traits&lt;X::iterator&gt;::value_type and 
iterator_traits&lt;X::const_iterator&gt;::value_type should both be 
X::value_type. However, this is nowhere stated. The language in Table 65 is not 
precise about the iterators' value types (it predates iterator_traits), and 
could even be interpreted as saying that 
iterator_traits&lt;X::const_iterator&gt;::value_type should be "const 
X::value_type". </P>
<P>Related issue: <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#279">279</A>.</P>
<P><B>Proposed resolution:</B></P>
<P>In Table 65 ("Container Requirements"), change the return type for 
X::iterator to "iterator type whose value type is T". Change the return type for 
X::const_iterator to "constant iterator type whose value type is T".</P>
<P><B>Rationale:</B></P>
<P>This belongs as a container requirement, rather than an iterator requirement, 
because the whole notion of iterator/const_iterator pairs is specific to 
containers' iterator. </P>
<P>It is existing practice that (for example) 
iterator_traits&lt;list&lt;int&gt;::const_iterator&gt;::value_type is "int", 
rather than "const int". This is consistent with the way that const pointers are 
handled: the standard already requires that iterator_traits&lt;const 
int*&gt;::value_type is int. </P>
<HR>
<A name=324>
<H3>324.&nbsp;Do output iterators have value types?</H3></A>
<P><B>Section:</B>&nbsp;24.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.output.iterators">[lib.output.iterators]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Dave Abrahams&nbsp; <B>Date:</B>&nbsp;7 June 2001</P>
<P>Table 73 suggests that output iterators have value types. It requires the 
expression "*a = t". Additionally, although Table 73 never lists "a = t" or 
"X(a) = t" in the "expressions" column, it contains a note saying that "a = t" 
and "X(a) = t" have equivalent (but nowhere specified!) semantics.</P>
<P>According to 24.1/9, t is supposed to be "a value of value type T":</P>
<BLOCKQUOTE>In the following sections, a and b denote values of X, n denotes a 
  value of the difference type Distance, u, tmp, and m denote identifiers, r 
  denotes a value of X&amp;, t denotes a value of value type T. </BLOCKQUOTE>
<P>Two other parts of the standard that are relevant to whether output iterators 
have value types:</P>
<UL>
  <LI>24.1/1 says "All iterators i support the expression *i, resulting in a 
  value of some class, enumeration, or built-in type T, called the value type of 
  the iterator". 
  <LI>24.3.1/1, which says "In the case of an output iterator, the types 
  iterator_traits&lt;Iterator&gt;::difference_type 
  iterator_traits&lt;Iterator&gt;::value_type are both defined as void." 
</LI></UL>
<P>The first of these passages suggests that "*i" is supposed to return a useful 
value, which contradicts the note in 24.1.2/2 saying that the only valid use of 
"*i" for output iterators is in an expression of the form "*i = t". The second 
of these passages appears to contradict Table 73, because it suggests that 
"*i"'s return value should be void. The second passage is also broken in the 
case of a an iterator type, like non-const pointers, that satisfies both the 
output iterator requirements and the forward iterator requirements.</P>
<P>What should the standard say about <TT>*i</TT>'s return value when i is an 
output iterator, and what should it say about that t is in the expression "*i = 
t"? Finally, should the standard say anything about output iterators' pointer 
and reference types?</P>
<P><B>Proposed resolution:</B></P>
<P>24.1 p1, change</P>
<BLOCKQUOTE>
  <P>All iterators <TT>i</TT> support the expression <TT>*i</TT>, resulting in a 
  value of some class, enumeration, or built-in type <TT>T</TT>, called the 
  value type of the iterator.</P></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
  <P>All input iterators <TT>i</TT> support the expression <TT>*i</TT>, 
  resulting in a value of some class, enumeration, or built-in type <TT>T</TT>, 
  called the value type of the iterator. All output iterators support the 
  expression <TT>*i = o</TT> where <TT>o</TT> is a value of some type that is in 
  the set of types that are <I>writable</I> to the particular iterator type of 
  <TT>i</TT>. </P></BLOCKQUOTE>
<P>24.1 p9, add</P>
<BLOCKQUOTE>
  <P><TT>o</TT> denotes a value of some type that is writable to the output 
  iterator. </P></BLOCKQUOTE>
<P>Table 73, change</P>
<BLOCKQUOTE><PRE>*a = t
</PRE></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE><PRE>*r = o
</PRE></BLOCKQUOTE>
<P>and change</P>
<BLOCKQUOTE><PRE>*r++ = t
</PRE></BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE><PRE>*r++ = o
</PRE></BLOCKQUOTE>
<P><I>[post-Redmond: Jeremy provided wording]</I></P>
<P><B>Rationale:</B></P>
<P>The LWG considered two options: change all of the language that seems to 
imply that output iterators have value types, thus making it clear that output 
iterators have no value types, or else define value types for output iterator 
consistently. The LWG chose the former option, because it seems clear that 
output iterators were never intended to have value types. This was a deliberate 
design decision, and any language suggesting otherwise is simply a mistake.</P>
<P>A future revision of the standard may wish to revisit this design 
decision.</P>
<HR>
<A name=325>
<H3>325.&nbsp;Misleading text in moneypunct&lt;&gt;::do_grouping</H3></A>
<P><B>Section:</B>&nbsp;22.2.6.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.moneypunct.virtuals">[lib.locale.moneypunct.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;02 Jul 2001</P>
<P>The Returns clause in 22.2.6.3.2, p3 says about 
moneypunct&lt;charT&gt;::do_grouping() </P>
<BLOCKQUOTE>Returns: A pattern defined identically as the result of 
  numpunct&lt;charT&gt;::do_grouping().241) </BLOCKQUOTE>
<P>Footnote 241 then reads</P>
<BLOCKQUOTE>This is most commonly the value "\003" (not "3"). </BLOCKQUOTE>
<P>The returns clause seems to imply that the two member functions must return 
an identical value which in reality may or may not be true, since the facets are 
usually implemented in terms of struct std::lconv and return the value of the 
grouping and mon_grouping, respectively. The footnote also implies that the 
member function of the moneypunct facet (rather than the overridden virtual 
functions in moneypunct_byname) most commonly return "\003", which contradicts 
the C standard which specifies the value of "" for the (most common) C locale. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Replace the text in Returns clause in 22.2.6.3.2, p3 with the following:</P>
<BLOCKQUOTE>Returns: A pattern defined identically as, but not necessarily 
  equal to, the result of numpunct&lt;charT&gt;::do_grouping().241) </BLOCKQUOTE>
<P>and replace the text in Footnote 241 with the following:</P>
<BLOCKQUOTE>To specify grouping by 3s the value is "\003", not "3". 
</BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The fundamental problem is that the description of the locale facet virtuals 
serves two purposes: describing the behavior of the base class, and describing 
the meaning of and constraints on the behavior in arbitrary derived classes. The 
new wording makes that separation a little bit clearer. The footnote (which is 
nonnormative) is not supposed to say what the grouping is in the "C" locale or 
in any other locale. It is just a reminder that the values are interpreted as 
small integers, not ASCII characters. </P>
<HR>
<A name=327>
<H3>327.&nbsp;Typo in time_get facet in table 52</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Tiki Wan&nbsp; <B>Date:</B>&nbsp;06 Jul 2001</P>
<P>The <TT>wchar_t</TT> versions of <TT>time_get</TT> and 
<TT>time_get_byname</TT> are listed incorrectly in table 52, required 
instantiations. In both cases the second template parameter is given as 
OutputIterator. It should instead be InputIterator, since these are input 
facets.</P>
<P><B>Proposed resolution:</B></P>
<P>In table 52, required instantiations, in 22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>, 
change</P><PRE>    time_get&lt;wchar_t, OutputIterator&gt;
    time_get_byname&lt;wchar_t, OutputIterator&gt;
</PRE>
<P>to</P><PRE>    time_get&lt;wchar_t, InputIterator&gt;
    time_get_byname&lt;wchar_t, InputIterator&gt;
</PRE>
<P><I>[Redmond: Very minor change in proposed resolution. Original had a typo, 
wchart instead of wchar_t.]</I></P>
<HR>
<A name=328>
<H3>328.&nbsp;Bad sprintf format modifier in 
money_put&lt;&gt;::do_put()</H3></A>
<P><B>Section:</B>&nbsp;22.2.6.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.money.put.virtuals">[lib.locale.money.put.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;07 Jul 2001</P>
<P>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 for values 
of type long double, and second, the precision of 01 doesn't seem to make sense. 
What was most likely intended was "%.0Lf"., that is a precision of zero followed 
by the L length modifier.</P>
<P><B>Proposed resolution:</B></P>
<P>Change the format string to "%.0Lf".</P>
<P><B>Rationale:</B></P>
<P>Fixes an obvious typo</P>
<HR>
<A name=329>
<H3>329.&nbsp;vector capacity, reserve and reallocation</H3></A>
<P><B>Section:</B>&nbsp;23.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.capacity">[lib.vector.capacity]</A>, 
23.2.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.modifiers">[lib.vector.modifiers]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Anthony Williams&nbsp; <B>Date:</B>&nbsp;13 Jul 2001</P>
<P>There is an apparent contradiction about which circumstances can cause a 
reallocation of a vector in Section 23.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.capacity">[lib.vector.capacity]</A> 
and section 23.2.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.modifiers">[lib.vector.modifiers]</A>. 
</P>
<P>23.2.4.2p5 says:</P>
<BLOCKQUOTE>Notes: Reallocation invalidates all the references, pointers, and 
  iterators referring to the elements in the sequence. It is guaranteed that no 
  reallocation takes place during insertions that happen after a call to 
  reserve() until the time when an insertion would make the size of the vector 
  greater than the size specified in the most recent call to reserve(). 
</BLOCKQUOTE>
<P>Which implies if I do</P><PRE>  std::vector&lt;int&gt; vec;
  vec.reserve(23);
  vec.reserve(0);
  vec.insert(vec.end(),1);
</PRE>
<P>then the implementation may reallocate the vector for the insert, as the size 
specified in the previous call to reserve was zero.</P>
<P>However, the previous paragraphs (23.2.4.2, p1-2) state:</P>
<BLOCKQUOTE>
  <P>(capacity) Returns: The total number of elements the vector can hold 
  without requiring reallocation </P>
  <P>...After reserve(), capacity() is greater or equal to the argument of 
  reserve if reallocation happens; and equal to the previous value of capacity() 
  otherwise... </P></BLOCKQUOTE>
<P>This implies that vec.capacity() is still 23, and so the insert() should not 
require a reallocation, as vec.size() is 0. This is backed up by 23.2.4.3p1: 
</P>
<BLOCKQUOTE>(insert) Notes: Causes reallocation if the new size is greater 
  than the old capacity. </BLOCKQUOTE>
<P>Though this doesn't rule out reallocation if the new size is less than the 
old capacity, I think the intent is clear. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the wording of 23.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.capacity">[lib.vector.capacity]</A> 
paragraph 5 to:</P>
<BLOCKQUOTE>Notes: Reallocation invalidates all the references, pointers, and 
  iterators referring to the elements in the sequence. It is guaranteed that no 
  reallocation takes place during insertions that happen after a call to 
  reserve() until the time when an insertion would make the size of the vector 
  greater than the value of capacity(). </BLOCKQUOTE>
<P><I>[Redmond: original proposed resolution was modified slightly. In the 
original, the guarantee was that there would be no reallocation until the size 
would be greater than the value of capacity() after the most recent call to 
reserve(). The LWG did not believe that the "after the most recent call to 
reserve()" added any useful information.]</I></P>
<P><B>Rationale:</B></P>
<P>There was general agreement that, when reserve() is called twice in 
succession and the argument to the second invocation is smaller than 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.</P>
<HR>
<A name=331>
<H3>331.&nbsp;bad declaration of destructor for ios_base::failure</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios::failure">[lib.ios::failure]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;PremAnand M. Rao&nbsp; <B>Date:</B>&nbsp;23 Aug 2001</P>
<P>With the change in 17.4.4.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.res.on.exception.handling">[lib.res.on.exception.handling]</A> 
to state "An implementation may strengthen the exception-specification for a 
non-virtual function by removing listed exceptions." (issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#119">119</A>) 
and the following declaration of ~failure() in ios_base::failure </P><PRE>    namespace std {
       class ios_base::failure : public exception {
       public:
           ...
           virtual ~failure();
           ...
       };
     }
</PRE>
<P>the class failure cannot be implemented since in 18.6.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.exception">[lib.exception]</A> 
the destructor of class exception has an empty exception specification:</P><PRE>    namespace std {
       class exception {
       public:
         ...
         virtual ~exception() throw();
         ...
       };
     }
</PRE>
<P><B>Proposed resolution:</B></P>
<P>Remove the declaration of ~failure().</P>
<P><B>Rationale:</B></P>
<P>The proposed resolution is consistent with the way that destructors of other 
classes derived from <TT>exception</TT> are handled.</P>
<HR>
<A name=333>
<H3>333.&nbsp;does endl imply synchronization with the device?</H3></A>
<P><B>Section:</B>&nbsp;27.6.2.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.manip">[lib.ostream.manip]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;PremAnand M. Rao&nbsp; <B>Date:</B>&nbsp;27 Aug 2001</P>
<P>A footnote in 27.6.2.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.manip">[lib.ostream.manip]</A> 
states:</P>
<BLOCKQUOTE>[Footnote: The effect of executing cout &lt;&lt; endl is to insert 
  a newline character in the output sequence controlled by cout, then 
  synchronize it with any external file with which it might be associated. --- 
  end foonote] </BLOCKQUOTE>
<P>Does the term "file" here refer to the external device? This leads to some 
implementation ambiguity on systems with fully buffered files where a newline 
does not cause a flush to the device. </P>
<P>Choosing to sync with the device leads to significant performance penalties 
for each call to endl, while not sync-ing leads to errors under special 
circumstances. </P>
<P>I could not find any other statement that explicitly defined the behavior one 
way or the other. </P>
<P><B>Proposed resolution:</B></P>
<P>Remove footnote 300 from section 27.6.2.7 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.manip">[lib.ostream.manip]</A>.</P>
<P><B>Rationale:</B></P>
<P>We already have normative text saying what <TT>endl</TT> does: it inserts a 
newline character and calls <TT>flush</TT>. This footnote is at best redundant, 
at worst (as this issue says) misleading, because it appears to make promises 
about what <TT>flush</TT> does.</P>
<HR>
<A name=334>
<H3>334.&nbsp;map::operator[] specification forces inefficient 
implementation</H3></A>
<P><B>Section:</B>&nbsp;23.3.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.map.access">[lib.map.access]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andrea Griffini&nbsp; <B>Date:</B>&nbsp;02 Sep 2001</P>
<P>The current standard describes map::operator[] using a code example. That 
code example is however quite inefficient because it requires several useless 
copies of both the passed key_type value and of default constructed mapped_type 
instances. My opinion is that was not meant by the comitee to require all those 
temporary copies. </P>
<P>Currently map::operator[] behaviour is specified as: </P><PRE>  Returns:
    (*((insert(make_pair(x, T()))).first)).second.
</PRE>
<P>This specification however uses make_pair that is a template function of 
which parameters in this case will be deduced being of type const key_type&amp; 
and const T&amp;. This will create a pair&lt;key_type,T&gt; that isn't the 
correct type expected by map::insert so another copy will be required using the 
template conversion constructor available in pair to build the required 
pair&lt;const key_type,T&gt; instance. </P>
<P>If we consider calling of key_type copy constructor and mapped_type default 
constructor and copy constructor as observable behaviour (as I think we should) 
then the standard is in this place requiring two copies of a key_type element 
plus a default construction and two copy construction of a mapped_type 
(supposing the addressed element is already present in the map; otherwise at 
least another copy construction for each type). </P>
<P>A simple (half) solution would be replacing the description with:</P><PRE>  Returns:
    (*((insert(value_type(x, T()))).first)).second.
</PRE>
<P>This will remove the wrong typed pair construction that requires one extra 
copy of both key and value.</P>
<P>However still the using of map::insert requires temporary objects while the 
operation, from a logical point of view, doesn't require any. </P>
<P>I think that a better solution would be leaving free an implementer to use a 
different approach than map::insert that, because of its interface, forces 
default constructed temporaries and copies in this case. The best solution in my 
opinion would be just requiring map::operator[] to return a reference to the 
mapped_type part of the contained element creating a default element with the 
specified key if no such an element is already present in the container. Also a 
logarithmic complexity requirement should be specified for the operation. </P>
<P>This would allow library implementers to write alternative implementations 
not using map::insert and reaching optimal performance in both cases of the 
addressed element being present or absent from the map (no temporaries at all 
and just the creation of a new pair inside the container if the element isn't 
present). Some implementer has already taken this option but I think that the 
current wording of the standard rules that as non-conforming. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace 23.3.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.map.access">[lib.map.access]</A> 
paragraph 1 with </P>
<BLOCKQUOTE>
  <P>-1- Effects: If there is no key equivalent to x in the map, inserts 
  value_type(x, T()) into the map. </P>
  <P>-2- Returns: A reference to the mapped_type corresponding to x in *this. 
  </P>
  <P>-3- Complexity: logarithmic. </P></BLOCKQUOTE>
<P><I>[This is the second option mentioned above. Howard provided 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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#98">98</A> 
for a similar problem.]</I></P>
<P><B>Rationale:</B></P>
<P>This is the second solution described above; as noted, it is consistent with 
existing practice. </P>
<P>Note that we now need to specify the complexity explicitly, because we are no 
longer defining <TT>operator[]</TT> in terms of <TT>insert</TT>.</P>
<HR>
<A name=335>
<H3>335.&nbsp;minor issue with char_traits, table 37</H3></A>
<P><B>Section:</B>&nbsp;21.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.char.traits.require">[lib.char.traits.require]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andy Sawyer&nbsp; <B>Date:</B>&nbsp;06 Sep 2001</P>
<P>Table 37, in 21.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.char.traits.require">[lib.char.traits.require]</A>, 
descibes char_traits::assign as: </P><PRE>  X::assign(c,d)   assigns c = d.
</PRE>
<P>And para 1 says:</P>
<BLOCKQUOTE>[...] c and d denote values of type CharT [...] </BLOCKQUOTE>
<P>Naturally, if c and d are <I>values</I>, then the assignment is (effectively) 
meaningless. It's clearly intended that (in the case of assign, at least), 'c' 
is intended to be a reference type. </P>
<P>I did a quick survey of the four implementations I happened to have lying 
around, and sure enough they all have signatures:</P><PRE>    assign( charT&amp;, const charT&amp; );
</PRE>
<P>(or the equivalent). It's also described this way in Nico's book. (Not to 
mention the synopses of char_traits&lt;char&gt; in 21.1.3.1 and 
char_traits&lt;wchar_t&gt; in 21.1.3.2...) </P>
<P><B>Proposed resolution:</B></P>
<P>Add the following to 21.1.1 para 1:</P>
<BLOCKQUOTE>r denotes an lvalue of CharT </BLOCKQUOTE>
<P>and change the description of assign in the table to:</P><PRE>  X::assign(r,d)   assigns r = d
</PRE>
<HR>
<A name=336>
<H3>336.&nbsp;Clause 17 lack of references to deprecated headers</H3></A>
<P><B>Section:</B>&nbsp;17 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.library">[lib.library]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Detlef Vollmann&nbsp; <B>Date:</B>&nbsp;05 Sep 2001</P>
<P>From c++std-edit-873:</P>
<P>17.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.headers">[lib.headers]</A>, 
Table 11. In this table, the header &lt;strstream&gt; is missing.</P>
<P>This shows a general problem: The whole clause 17 refers quite often to 
clauses 18 through 27, but D.7 is also a part of the standard library (though a 
deprecated one).</P>
<P><B>Proposed resolution:</B></P>
<P>To 17.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.headers">[lib.headers]</A> 
Table 11, C++ Library Headers, add "&lt;strstream&gt;".</P>
<P>In the following places, change "clauses 17 through 27" to "clauses 17 
through 27 and Annex D":</P>
<UL>
  <LI>1.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/intro.html#intro.refs">[intro.refs]</A> 
  Normative references/1/footnote 1 
  <LI>1.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/intro.html#intro.defs">[intro.defs]</A> 
  Definitions/1 
  <LI>7 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/dcl.html#dcl.dcl">[dcl.dcl]</A> 
  Library introduction/9 
  <LI>17.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.description">[lib.description]</A> 
  Method of description (Informative)/1 
  <LI>17.3.2.1.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.character.seq">[lib.character.seq]</A> 
  Character sequences/1/bullet 2 
  <LI>17.3.2.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.functions.within.classes">[lib.functions.within.classes]</A> 
  Functions within classes/1 
  <LI>17.3.2.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.objects.within.classes">[lib.objects.within.classes]</A> 
  Private members/1/(2 places) 
  <LI>17.4 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.requirements">[lib.requirements]</A> 
  Library-wide requirements/1 
  <LI>17.4.1.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.headers">[lib.headers]</A> 
  Headers/4 
  <LI>17.4.3.4 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.replacement.functions">[lib.replacement.functions]</A> 
  Replacement functions/1 
  <LI>17.4.4.3 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.global.functions">[lib.global.functions]</A> 
  Global or non-member functions/2 
  <LI>17.4.4.6 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.protection.within.classes">[lib.protection.within.classes]</A> 
  Protection within classes/1 </LI></UL>
<HR>
<A name=337>
<H3>337.&nbsp;replace_copy_if's template parameter should be 
InputIterator</H3></A>
<P><B>Section:</B>&nbsp;25.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.replace">[lib.alg.replace]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Detlef Vollmann&nbsp; <B>Date:</B>&nbsp;07 Sep 2001</P>
<P>From c++std-edit-876:</P>
<P>In section 25.2.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.replace">[lib.alg.replace]</A> 
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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.type.descriptions">[lib.type.descriptions]</A> 
p1 the parameter name conveys real normative meaning. </P>
<P><B>Proposed resolution:</B></P>
<P>Change <TT>Iterator</TT> to <TT>InputIterator</TT>.</P>
<HR>
<A name=338>
<H3>338.&nbsp; is whitespace allowed between `-' and a digit?</H3></A>
<P><B>Section:</B>&nbsp;22.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.categories">[lib.locale.categories]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;17 Sep 2001</P>
<P>From Stage 2 processing in 22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>, 
p8 and 9 (the original text or the text corrected by the proposed resolution of 
issue <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#221">221</A>) 
it seems clear that no whitespace is allowed within a number, but 22.2.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.numpunct">[lib.locale.numpunct]</A>, 
p2, which gives the format for integer and floating point values, says that 
whitespace is optional between a plusminus and a sign. </P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lex.html#lex.icon">[lex.icon]</A>, 
that of floating-point-literals in 2.13.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lex.html#lex.fcon">[lex.fcon]</A> 
of the C++ standard). </P>
<P><B>Proposed resolution:</B></P>
<P>Change the first part of 22.2.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.numpunct">[lib.locale.numpunct]</A> 
paragraph 2 from:</P>
<BLOCKQUOTE>
  <P>The syntax for number formats is as follows, where <TT>digit</TT> 
  represents the radix set specified by the <TT>fmtflags</TT> argument value, 
  <TT>whitespace</TT> is as determined by the facet <TT>ctype&lt;charT&gt;</TT> 
  (22.2.1.1), and <TT>thousands-sep</TT> and <TT>decimal-point</TT> are the 
  results of corresponding <TT>numpunct&lt;charT&gt;</TT> members. Integer 
  values have the format: </P><PRE>  integer   ::= [sign] units
  sign      ::= plusminus [whitespace]
  plusminus ::= '+' | '-'
  units     ::= digits [thousands-sep units]
  digits    ::= digit [digits]
</PRE></BLOCKQUOTE>
<P>to:</P>
<BLOCKQUOTE>
  <P>The syntax for number formats is as follows, where <TT>digit</TT> 
  represents the radix set specified by the <TT>fmtflags</TT> argument value, 
  and <TT>thousands-sep</TT> and <TT>decimal-point</TT> are the results of 
  corresponding <TT>numpunct&lt;charT&gt;</TT> members. Integer values have the 
  format: </P><PRE>  integer   ::= [sign] units
  sign      ::= plusminus
  plusminus ::= '+' | '-'
  units     ::= digits [thousands-sep units]
  digits    ::= digit [digits]
</PRE></BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>It's not clear whether the format described in 22.2.3.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.numpunct">[lib.locale.numpunct]</A> 
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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>. 
The proposed resolution removes all mention of "whitespace" from that 
format.</P>
<HR>
<A name=339>
<H3>339.&nbsp;definition of bitmask type restricted to clause 27</H3></A>
<P><B>Section:</B>&nbsp;22.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.category.ctype">[lib.category.ctype]</A>, 
17.3.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.bitmask.types">[lib.bitmask.types]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;17 September 
2001</P>
<P>The ctype_category::mask type is declared to be an enum in 22.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.category.ctype">[lib.category.ctype]</A> 
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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.bitmask.types">[lib.bitmask.types]</A>, 
p1. However, the said definition only applies to clause 27, making the reference 
in 22.2.1 somewhat dubious. </P>
<P><B>Proposed resolution:</B></P>
<P>Clarify 17.3.2.1.2, p1 by changing the current text from</P>
<BLOCKQUOTE>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 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.template.bitset">[lib.template.bitset]</A>). 
</BLOCKQUOTE>
<P>to read</P>
<BLOCKQUOTE>Several types defined in clauses lib.language.support through 
  lib.input.output and Annex D 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 (lib.template.bitset). </BLOCKQUOTE>
<P>Additionally, change the definition in 22.2.1 to adopt the same convention as 
in clause 27 by replacing the existing text with the following (note, in 
particluar, the cross-reference to 17.3.2.1.2 in 22.2.1, p1): </P>
<BLOCKQUOTE>
  <P>22.2.1 The ctype category [lib.category.ctype]</P><PRE>namespace std {
    class ctype_base {
    public:
        typedef <B><I>T</I></B> mask;

        // numeric values are for exposition only.
        static const mask space = 1 &lt;&lt; 0;
        static const mask print = 1 &lt;&lt; 1;
        static const mask cntrl = 1 &lt;&lt; 2;
        static const mask upper = 1 &lt;&lt; 3;
        static const mask lower = 1 &lt;&lt; 4;
        static const mask alpha = 1 &lt;&lt; 5;
        static const mask digit = 1 &lt;&lt; 6;
        static const mask punct = 1 &lt;&lt; 7;
        static const mask xdigit = 1 &lt;&lt; 8;
        static const mask alnum = alpha | digit;
        static const mask graph = alnum | punct;
    };
}
</PRE>
  <P>The type <TT>mask</TT> is a bitmask type (17.3.2.1.2 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.bitmask.types">[lib.bitmask.types]</A>).</P></BLOCKQUOTE>
<P><I>[Curaao: The LWG notes that T above should be bold-italics to be 
consistent with the rest of the standard.]</I></P>
<HR>
<A name=340>
<H3>340.&nbsp;interpretation of <TT>has_facet&lt;Facet&gt;(loc)</TT> </H3></A>
<P><B>Section:</B>&nbsp;22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;18 Sep 2001</P>
<P>It's unclear whether 22.1.1.1.1, p3 says that 
<TT>has_facet&lt;Facet&gt;(loc)</TT> returns true for any <TT>Facet</TT> from 
Table 51 or whether it includes Table 52 as well: </P>
<BLOCKQUOTE>For any locale <TT>loc</TT> either constructed, or returned by 
  locale::classic(), and any facet <TT>Facet</TT> that is a member of a standard 
  category, <TT>has_facet&lt;Facet&gt;(loc)</TT> is true. Each locale member 
  function which takes a <TT>locale::category</TT> argument operates on the 
  corresponding set of facets. </BLOCKQUOTE>
<P>It seems that it comes down to which facets are considered to be members of a 
standard category. Intuitively, I would classify all the facets in Table 52 as 
members of their respective standard categories, but there are an unbounded set 
of them... </P>
<P>The paragraph implies that, for instance, <TT>has_facet&lt;num_put&lt;C, 
OutputIterator&gt; &gt;(loc)</TT> must always return true. I don't think that's 
possible. If it were, then <TT>use_facet&lt;num_put&lt;C, OutputIterator&gt; 
&gt;(loc)</TT> would have to return a reference to a distinct object for each 
valid specialization of <TT>num_put&lt;C, OutputIteratory&gt;</TT>, which is 
clearly impossible. </P>
<P>On the other hand, if none of the facets in Table 52 is a member of a 
standard category then none of the locale member functions that operate on 
entire categories of facets will work properly. </P>
<P>It seems that what p3 should mention that it's required (permitted?) to hold 
only for specializations of <TT>Facet</TT> from Table 52 on <TT>C</TT> from the 
set { <TT>char</TT>, <TT>wchar_t</TT> }, and <TT>InputIterator</TT> and 
<TT>OutputIterator</TT> from the set of { 
{i,o}<TT>streambuf_iterator</TT>&lt;{<TT>char</TT>,<TT>wchar_t</TT>}<TT>&gt;</TT> 
}. </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>, 
paragraph 3, change "that is a member of a standard category" to "shown in Table 
51".</P>
<P><B>Rationale:</B></P>
<P>The facets in Table 52 are an unbounded set. Locales should not be required 
to contain an infinite number of facets.</P>
<P>It's not necessary to talk about which values of InputIterator and 
OutputIterator must be supported. Table 51 already contains a complete list of 
the ones we need.</P>
<HR>
<A name=341>
<H3>341.&nbsp;Vector reallocation and swap</H3></A>
<P><B>Section:</B>&nbsp;23.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.capacity">[lib.vector.capacity]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Anthony Williams&nbsp; <B>Date:</B>&nbsp;27 Sep 2001</P>
<P>It is a common idiom to reduce the capacity of a vector by swapping it with 
an empty one:</P><PRE>  std::vector&lt;SomeType&gt; vec;
  // fill vec with data
  std::vector&lt;SomeType&gt;().swap(vec);
  // vec is now empty, with minimal capacity
</PRE>
<P>However, the wording of 23.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.capacity">[lib.vector.capacity]</A>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-defects.html#329">329</A> 
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.</P>
<P>However, the container requirements state that swap must have constant 
complexity (23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
note to table 65).</P>
<P>This is an important issue, as reallocation affects the validity of 
references and iterators.</P>
<P>If the wording of 23.2.4.2p5 is taken to be the desired intent, then 
references and iterators remain valid after a call to swap, if they refer to an 
element before the new end() of the vector into which they originally pointed, 
in which case they refer to the element at the same index position. Iterators 
and references that referred to an element whose index position was beyond the 
new end of the vector are invalidated.</P>
<P>If the note to table 65 is taken as the desired intent, then there are two 
possibilities with regard to iterators and references:</P>
<OL>
  <LI>All Iterators and references into both vectors are invalidated. 
  <LI>Iterators and references into either vector remain valid, and remain 
  pointing to the same element. Consequently iterators and references that 
  referred to one vector now refer to the other, and vice-versa. </LI></OL>
<P><B>Proposed resolution:</B></P>
<P>Add a new paragraph after 23.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.capacity">[lib.vector.capacity]</A> 
paragraph 5:</P>
<BLOCKQUOTE><PRE>  void swap(vector&lt;T,Allocator&gt;&amp; x);
</PRE>
  <P><B>Effects:</B> Exchanges the contents and capacity() of <TT>*this</TT> 
  with that of <TT>x</TT>.</P>
  <P><B>Complexity:</B> Constant time.</P></BLOCKQUOTE>
<P><I>[This solves the problem reported for this issue. We may also have a 
problem with a circular definition of swap() for other containers.]</I></P>
<P><B>Rationale:</B></P>
<P>swap should be constant time. The clear intent is that it should just do 
pointer twiddling, and that it should exchange all properties of the two 
vectors, including their reallocation guarantees. </P>
<HR>
<A name=345>
<H3>345.&nbsp;type tm in &lt;cwchar&gt;</H3></A>
<P><B>Section:</B>&nbsp;21.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.c.strings">[lib.c.strings]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Clark Nelson&nbsp; <B>Date:</B>&nbsp;19 Oct 2001</P>
<P>C99, and presumably amendment 1 to C90, specify that &lt;wchar.h&gt; declares 
struct tm as an incomplete type. However, table 48 in 21.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.c.strings">[lib.c.strings]</A> 
does not mention the type tm as being declared in &lt;cwchar&gt;. Is this 
omission intentional or accidental? </P>
<P><B>Proposed resolution:</B></P>
<P>In section 21.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.c.strings">[lib.c.strings]</A>, 
add "tm" to table 48.</P>
<HR>
<A name=346>
<H3>346.&nbsp;Some iterator member functions should be const</H3></A>
<P><B>Section:</B>&nbsp;24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Jeremy Siek&nbsp; <B>Date:</B>&nbsp;20 Oct 2001</P>
<P>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 value. The standard does not 
explicitly state which functions should be const. Since this a fairly common 
mistake, the following changes are suggested to make this explicit.</P>
<P>The tables almost indicate constness properly through naming: r for non-const 
and a,b for const iterators. The following changes make this more explicit and 
also fix a couple problems.</P>
<P><B>Proposed resolution:</B></P>
<P>In 24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A> 
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...".</P>
<P>In Table 73, change</P><PRE>    a-&gt;m   U&amp;         ...
</PRE>
<P>to</P><PRE>    a-&gt;m   const U&amp;   ...
    r-&gt;m   U&amp;         ...
</PRE>
<P>In Table 73 expression column, change</P><PRE>    *a = t
</PRE>
<P>to</P><PRE>    *r = t
</PRE>
<P><I>[Redmond: The container requirements should be reviewed to see if the same 
problem appears there.]</I></P>
<HR>
<A name=347>
<H3>347.&nbsp;locale::category and bitmask requirements</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;P.J. Plauger, Nathan Myers&nbsp; <B>Date:</B>&nbsp;23 Oct 
2001</P>
<P>In 22.1.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.category">[lib.locale.category]</A> 
paragraph 1, the category members are described as bitmask elements. In fact, 
the bitmask requirements in 17.3.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.bitmask.types">[lib.bitmask.types]</A> 
don't seem quite right: <TT>none</TT> and <TT>all</TT> are bitmask constants, 
not bitmask elements.</P>
<P>In particular, the requirements for <TT>none</TT> interact poorly with the 
requirement that the LC_* constants from the C library must be recognizable as 
C++ locale category constants. LC_* values should not be mixed with these values 
to make category values.</P>
<P>We have two options for the proposed resolution. Informally: option 1 removes 
the requirement that LC_* values be recognized as category arguments. Option 2 
changes the category type so that this requirement is implementable, by allowing 
<TT>none</TT> to be some value such as 0x1000 instead of 0.</P>
<P>Nathan writes: "I believe my proposed resolution [Option 2] merely 
re-expresses the status quo more clearly, without introducing any changes beyond 
resolving the DR.</P>
<P><B>Proposed resolution:</B></P>
<P>Replace the first two paragraphs of 22.1.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.types">[lib.locale.types]</A> 
with:</P>
<BLOCKQUOTE><PRE>    typedef int category;
</PRE>
  <P>Valid category values include the <TT>locale</TT> member bitmask elements 
  <TT>collate</TT>, <TT>ctype</TT>, <TT>monetary</TT>, <TT>numeric</TT>, 
  <TT>time</TT>, and <TT>messages</TT>, each of which represents a single locale 
  category. In addition, <TT>locale</TT> member bitmask constant <TT>none</TT> 
  is defined as zero and represents no category. And locale member bitmask 
  constant <TT>all</TT> is defined such that the expression</P><PRE>    (collate | ctype | monetary | numeric | time | messages | all) == all
</PRE>
  <P>is <TT>true</TT>, and represents the union of all categories. Further the 
  expression <TT>(X | Y)</TT>, where <TT>X</TT> and <TT>Y</TT> each represent a 
  single category, represents the union of the two categories. </P>
  <P><TT>locale</TT> member functions expecting a <TT>category</TT> argument 
  require one of the <TT>category</TT> values defined above, or the union of two 
  or more such values. Such a <TT>category</TT> argument identifies a set of 
  locale categories. Each locale category, in turn, identifies a set of locale 
  facets, including at least those shown in Table 51: </P></BLOCKQUOTE>
<P><I>[Curaao: need input from locale experts.]</I></P>
<P><B>Rationale:</B></P>
<P>The LWG considered, and rejected, an alternate proposal (described as "Option 
2" in the discussion). The main reason for rejecting it was that library 
implementors were concerened about implementation difficult, given that getting 
a C++ library to work smoothly with a separately written C library is already a 
delicate business. Some library implementers were also concerned about the issue 
of adding extra locale categories.</P>
<BLOCKQUOTE>
  <P><B>Option 2:</B> <BR>Replace the first paragraph of 22.1.1.1 <A 
  href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.types">[lib.locale.types]</A> 
  with:</P>
  <BLOCKQUOTE>
    <P>Valid category values include the enumerated values. In addition, the 
    result of applying commutative operators | and &amp; to any two valid values 
    is valid, and results in the setwise union and intersection, respectively, 
    of the argument categories. The values <TT>all</TT> and <TT>none</TT> are 
    defined such that for any valid value <TT>cat</TT>, the expressions <TT>(cat 
    | all == all)</TT>, <TT>(cat &amp; all == cat)</TT>, <TT>(cat | none == 
    cat)</TT> and <TT>(cat &amp; none == none)</TT> are true. For non-equal 
    values <TT>cat1</TT> and <TT>cat2</TT> of the remaining enumerated values, 
    <TT>(cat1 &amp; cat2 == none)</TT> is true. For any valid categories 
    <TT>cat1</TT> and <TT>cat2</TT>, the result of <TT>(cat1 &amp; ~cat2)</TT> 
    is valid, and equals the setwise union of those categories found in 
    <TT>cat1</TT> but not found in <TT>cat2</TT>. [Footnote: it is not required 
    that <TT>all</TT> equal the setwise union of the other enumerated values; 
    implementations may add extra categories.] </P></BLOCKQUOTE></BLOCKQUOTE>
<HR>
<A name=349>
<H3>349.&nbsp;Minor typographical error in ostream_iterator</H3></A>
<P><B>Section:</B>&nbsp;24.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.ostream.iterator">[lib.ostream.iterator]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Andy Sawyer&nbsp; <B>Date:</B>&nbsp;24 Oct 2001</P>
<P>24.5.2 [lib.ostream.iterator] states:</P><PRE>    [...]

    private:
    // basic_ostream&lt;charT,traits&gt;* out_stream; exposition only
    // const char* delim; exposition only
</PRE>
<P>Whilst it's clearly marked "exposition only", I suspect 'delim' should be of 
type 'const charT*'.</P>
<P><B>Proposed resolution:</B></P>
<P>In 24.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.ostream.iterator">[lib.ostream.iterator]</A>, 
replace <TT>const char* delim</TT> with <TT>const charT* delim</TT>. </P>
<HR>
<A name=352>
<H3>352.&nbsp;missing fpos requirements</H3></A>
<P><B>Section:</B>&nbsp;21.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.char.traits.typedefs">[lib.char.traits.typedefs]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;2 Dec 2001</P>
<P><I>(1)</I> There are no requirements on the <TT>stateT</TT> template 
parameter of <TT>fpos</TT> listed in 27.4.3. The interface appears to require 
that the type be at least Assignable and CopyConstructible (27.4.3.1, p1), and I 
think also DefaultConstructible (to implement the operations in Table 88). </P>
<P>21.1.2, p3, however, only requires that 
<TT>char_traits&lt;charT&gt;::state_type</TT> meet the requirements of 
CopyConstructible types. </P>
<P><I>(2)</I> Additionally, the <TT>stateT</TT> template argument has no 
corresponding typedef in fpos which might make it difficult to use in generic 
code. </P>
<P><B>Proposed resolution:</B></P>
<P>Modify 21.1.2, p4 from </P>
<P>Requires: <TT>state_type</TT> shall meet the requirements of 
CopyConstructible types (20.1.3). </P>
<P>Requires: state_type shall meet the requirements of Assignable (23.1, p4), 
CopyConstructible (20.1.3), and DefaultConstructible (20.1.4) types. </P>
<P><B>Rationale:</B></P>
<P>The LWG feels this is two issues, as indicated above. The first is a 
defect---std::basic_fstream is unimplementable without these additional 
requirements---and the proposed resolution fixes it. The second is questionable; 
who would use that typedef? The class 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.</P>
<HR>
<A name=354>
<H3>354.&nbsp;Associative container lower/upper bound requirements</H3></A>
<P><B>Section:</B>&nbsp;23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Hans Aberg&nbsp; <B>Date:</B>&nbsp;17 Dec 2001</P>
<P>Discussions in the thread "Associative container lower/upper bound 
requirements" on comp.std.c++ suggests that there is a defect in the C++ 
standard, Table 69 of section 23.1.2, "Associative containers", 
[lib.associative.reqmts]. It currently says:</P>
<BLOCKQUOTE>
  <P>a.find(k): returns an iterator pointing to an element with the key 
  equivalent to k, or a.end() if such an element is not found. </P>
  <P>a.lower_bound(k): returns an iterator pointing to the first element with 
  key not less than k. </P>
  <P>a.upper_bound(k): returns an iterator pointing to the first element with 
  key greater than k. </P></BLOCKQUOTE>
<P>We have "or a.end() if such an element is not found" for <TT>find</TT>, but 
not for <TT>upper_bound</TT> or <TT>lower_bound</TT>. As the text stands, one 
would be forced to insert a new element into the container and return an 
iterator to that in case the sought iterator does not exist, which does not seem 
to be the intention (and not possible with the "const" versions). </P>
<P><B>Proposed resolution:</B></P>
<P>Change Table 69 of section 23.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.associative.reqmts">[lib.associative.reqmts]</A> 
indicated entries to:</P>
<BLOCKQUOTE>
  <P>a.lower_bound(k): returns an iterator pointing to the first element with 
  key not less than k, or a.end() if such an element is not found. </P>
  <P>a.upper_bound(k): returns an iterator pointing to the first element with 
  key greater than k, or a.end() if such an element is not found. 
</P></BLOCKQUOTE>
<P><I>[Curaao: LWG reviewed PR.]</I></P>
<HR>
<A name=355>
<H3>355.&nbsp;Operational semantics for a.back()</H3></A>
<P><B>Section:</B>&nbsp;23.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.sequence.reqmts">[lib.sequence.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Yaroslav Mironov&nbsp; <B>Date:</B>&nbsp;23 Jan 2002</P>
<P>Table 68 "Optional Sequence Operations" in 23.1.1/12 specifies operational 
semantics for "a.back()" as "*--a.end()", which may be ill-formed <I>[because 
calling operator-- on a temporary (the return) of a built-in type is 
ill-formed]</I>, provided a.end() returns a simple pointer rvalue (this is 
almost always the case for std::vector::end(), for example). Thus, the 
specification is not only incorrect, it demonstrates a dangerous construct: 
"--a.end()" may successfully compile and run as intended, but after changing the 
type of the container or the mode of compilation it may produce compile-time 
error. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the specification in table 68 "Optional Sequence Operations" in 
23.1.1/12 for "a.back()" from</P>
<BLOCKQUOTE>*--a.end() </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>{ iterator tmp = a.end(); --tmp; return *tmp; } </BLOCKQUOTE>
<P>and the specification for "a.pop_back()" from</P>
<BLOCKQUOTE>a.erase(--a.end()) </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>{ iterator tmp = a.end(); --tmp; a.erase(tmp); } </BLOCKQUOTE>
<P><I>[Curaao: 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())".]</I></P>
<P><I>[There is a second possible defect; table 68 "Optional Sequence 
Operations" in the "Operational Semantics" column uses operations present only 
in the "Reversible Container" requirements, yet there is no stated dependency 
between these separate requirements tables. Ask in Santa Cruz if the LWG would 
like a new issue opened.]</I></P>
<P><I>[Santa Cruz: the proposed resolution is even worse than what's in the 
current standard: erase is undefined for reverse iterator. If we're going to 
make the change, we need to define a temporary and use operator--. Additionally, 
we don't know how prevalent this is: do we need to make this change in more than 
one place? Martin has volunteered to review the standard and see if this problem 
occurs elsewhere.]</I></P>
<P><I>[Oxford: Matt provided new wording to address the concerns raised in Santa 
Cruz. It does not appear that this problem appears anywhere else in clauses 23 
or 24.]</I></P>
<P><I>[Kona: In definition of operational semantics of back(), change "*tmp" to 
"return *tmp;"]</I></P>
<HR>
<A name=358>
<H3>358.&nbsp;interpreting <TT>thousands_sep</TT> after a <TT>decimal_point</TT> 
</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.get.virtuals">[lib.facet.num.get.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;12 Mar 2002</P>
<P>I don't think <TT>thousands_sep</TT> is being treated correctly after 
decimal_point has been seen. Since grouping applies only to the integral part of 
the number, the first such occurrence should, IMO, terminate Stage 2. (If it 
does not terminate it, then 22.2.2.1.2, p12 and 22.2.3.1.2, p3 need to explain 
how <TT>thousands_sep</TT> is to be interpreted in the fractional part of a 
number.) </P>
<P>The easiest change I can think of that resolves this issue would be something 
like below. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the first sentence of 22.2.2.1.2, p9 from </P>
<BLOCKQUOTE>If discard is true then the position of the character is 
  remembered, but the character is otherwise ignored. If it is not discarded, 
  then a check is made to determine if c is allowed as the next character of an 
  input field of the conversion specifier returned by stage 1. If so it is 
  accumulated. </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>If <TT>discard</TT> is true, then if <TT>'.'</TT> has not yet been 
  accumulated, then the position of the character is remembered, but the 
  character is otherwise ignored. Otherwise, if <TT>'.'</TT> has already been 
  accumulated, the character is discarded and Stage 2 terminates. ... 
</BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>We believe this reflects the intent of the Standard. Thousands sep characters 
after the decimal point are not useful in any locale. Some formatting 
conventions do group digits that follow the decimal point, but they usually 
introduce a different grouping character instead of reusing the thousand sep 
character. If we want to add support for such conventions, we need to do so 
explicitly.</P>
<HR>
<A name=359>
<H3>359.&nbsp;num_put&lt;&gt;::do_put (..., bool) undocumented</H3></A>
<P><B>Section:</B>&nbsp;22.2.2.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.members">[lib.facet.num.put.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;12 Mar 2002</P>
<P>22.2.2.2.1, p1:</P><PRE>    iter_type put (iter_type out, ios_base&amp; str, char_type fill,
                   bool val) const;
    ...

    1   Returns: do_put (out, str, fill, val).
    </PRE>
<P>AFAICS, the behavior of do_put (..., bool) is not documented anywhere, 
however, 22.2.2.2.2, p23:</P>
<BLOCKQUOTE><PRE>iter_type put (iter_type out, ios_base&amp; str, char_type fill,
               bool val) const;
</PRE>Effects: If (str.flags() &amp; ios_base::boolalpha) == 0 then do out = 
  do_put(out, str, fill, (int)val) Otherwise do <PRE>             string_type s =
                 val ? use_facet&lt;ctype&lt;charT&gt; &gt;(loc).truename()
                     : use_facet&lt;ctype&lt;charT&gt; &gt;(loc).falsename();
</PRE>and then insert the characters of s into out. <I>out</I>. </BLOCKQUOTE>
<P>This means that the bool overload of <TT>do_put()</TT> will never be called, 
which contradicts the first paragraph. Perhaps the declaration should read 
<TT>do_put()</TT>, and not <TT>put()</TT>? </P>
<P>Note also that there is no <B>Returns</B> clause for this function, which 
should probably be corrected, just as should the second occurrence of 
<I>"out."</I> in the text. </P>
<P>I think the least invasive change to fix it would be something like the 
following: </P>
<P><B>Proposed resolution:</B></P>
<P>In 22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>, 
just above paragraph 1, remove the <TT>bool</TT> overload.</P>
<P>In 22.2.2.2.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.facet.num.put.virtuals">[lib.facet.num.put.virtuals]</A>, 
p23, make the following changes </P>
<BLOCKQUOTE>Replace <TT>put()</TT> with <TT>do_put()</TT> in the declaration 
  of the member function. </BLOCKQUOTE>
<BLOCKQUOTE>Change the <B>Effects</B> clause to a <B>Returns</B> clause (to 
  avoid the requirement to call <TT>do_put(..., int)</TT> from <TT>do_put (..., 
  bool))</TT> like so: </BLOCKQUOTE>
<BLOCKQUOTE>23 <B>Returns</B>: If <TT>(str.flags() &amp; ios_base::boolalpha) 
  == 0</TT> then <TT>do_put (out, str, fill, (long)val)</TT> Otherwise the 
  function obtains a string <TT>s</TT> as if by <PRE>             string_type s =
                val ? use_facet&lt;ctype&lt;charT&gt; &gt;(loc).truename()
                    : use_facet&lt;ctype&lt;charT&gt; &gt;(loc).falsename();
</PRE>and then inserts each character <TT>c</TT> of s into out via <TT>*out++ 
  = c</TT> and returns <TT>out</TT>. </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>This fixes a couple of obvious typos, and also fixes what appears to be a 
requirement of gratuitous inefficiency. </P>
<HR>
<A name=360>
<H3>360.&nbsp;locale mandates inefficient implementation</H3></A>
<P><B>Section:</B>&nbsp;22.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale">[lib.locale]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;12 Mar 2002</P>
<P>22.1.1, p7 (copied below) allows iostream formatters and extractors to make 
assumptions about the values returned from facet members. However, such 
assumptions are apparently not guaranteed to hold in other cases (e.g., when the 
facet members are being called directly rather than as a result of iostream 
calls, or between successive calls to the same iostream functions with no 
interevening calls to <TT>imbue()</TT>, or even when the facet member functions 
are called from other member functions of other facets). This restriction 
prevents locale from being implemented efficiently. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the first sentence in 22.1.1, p7 from</P>
<BLOCKQUOTE>In successive calls to a locale facet member function during a 
  call to an iostream inserter or extractor or a streambuf member function, the 
  returned result shall be identical. [Note: This implies that such results may 
  safely be reused without calling the locale facet member function again, and 
  that member functions of iostream classes cannot safely call <TT>imbue()</TT> 
  themselves, except as specified elsewhere. --end note] </BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>In successive calls to a locale facet member function on a facet 
  object installed in the same locale, the returned result shall be identical. 
  ... </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>This change is reasonable becuase it clarifies the intent of this part of the 
standard.</P>
<HR>
<A name=363>
<H3>363.&nbsp;Missing exception specification in 27.4.2.1.1</H3></A>
<P><B>Section:</B>&nbsp;27.4.2.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios::failure">[lib.ios::failure]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Walter Brown and Marc Paterno&nbsp; <B>Date:</B>&nbsp;20 
May 2002</P>
<P>The destructor of ios_base::failure should have an empty throw specification, 
because the destructor of its base class, exception, is declared in this way. 
</P>
<P><B>Proposed resolution:</B></P>
<P>Change the destructor to</P><PRE>  virtual ~failure() throw();
</PRE>
<P><B>Rationale:</B></P>
<P>Fixes an obvious glitch. This is almost editorial.</P>
<HR>
<A name=364>
<H3>364.&nbsp;Inconsistent wording in 27.5.2.4.2</H3></A>
<P><B>Section:</B>&nbsp;27.5.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.buffer">[lib.streambuf.virt.buffer]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Walter Brown, Marc Paterno&nbsp; <B>Date:</B>&nbsp;10 May 
2002</P>
<P>27.5.2.4.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.streambuf.virt.buffer">[lib.streambuf.virt.buffer]</A> 
paragraph 1 is inconsistent with the Effects clause for seekoff. </P>
<P><B>Proposed resolution:</B></P>
<P>Make this paragraph, the Effects clause for setbuf, consistent in wording 
with the Effects clause for seekoff in paragraph 3 by amending paragraph 1 to 
indicate the purpose of setbuf: </P>
<P>Original text:</P>
<BLOCKQUOTE>1 Effects: Performs an operation that is defined separately for 
  each class derived from basic_streambuf in this clause (27.7.1.3, 27.8.1.4). 
</BLOCKQUOTE>
<P>Proposed text:</P>
<BLOCKQUOTE>1 Effects: Influences stream buffering in a way that is defined 
  separately for each class derived from basic_streambuf in this clause 
  (27.7.1.3, 27.8.1.4). </BLOCKQUOTE>
<P><B>Rationale:</B></P>
<P>The LWG doesn't believe there is any normative difference between the 
existing wording and what's in the proposed resolution, but the change may make 
the intent clearer.</P>
<HR>
<A name=365>
<H3>365.&nbsp;Lack of const-qualification in clause 27</H3></A>
<P><B>Section:</B>&nbsp;27 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.input.output">[lib.input.output]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Walter Brown, Marc Paterno&nbsp; <B>Date:</B>&nbsp;10 May 
2002</P>
<P>Some stream and streambuf member functions are declared non-const, even 
thought they appear only to report information rather than to change an object's 
logical state. They should be declared const. See document N1360 for details and 
rationale. </P>
<P>The list of member functions under discussion: <TT>in_avail</TT>, 
<TT>showmanyc</TT>, <TT>tellg</TT>, <TT>tellp</TT>, <TT>is_open</TT>.</P>
<P>Related issue: <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#73">73</A></P>
<P><B>Proposed resolution:</B></P>
<P>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</P>
<P>Replace</P><PRE>  bool is_open();
</PRE>
<P>with</P><PRE>  bool is_open() const;
</PRE>
<P><B>Rationale:</B></P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-closed.html#73">73</A>), 
but now thinks otherwise. The corresponding streambuf member function, after 
all,is already const.</P>
<P>The other proposed changes are less safe, because some streambuf functions 
that appear merely to report a value do actually perform mutating operations. 
It's not even clear that they should be considered "logically const", because 
streambuf has two interfaces, a public one and a protected one. These functions 
may, and often do, change the state as exposed by the protected interface, even 
if the state exposed by the public interface is unchanged.</P>
<P>Note that implementers can make this change in a binary compatible way by 
providing both overloads; this would be a conforming extension.</P>
<HR>
<A name=370>
<H3>370.&nbsp;Minor error in basic_istream::get</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Ray Lischner&nbsp; <B>Date:</B>&nbsp;15 Jul 2002</P>
<P>Defect report for description of basic_istream::get (section 27.6.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.unformatted">[lib.istream.unformatted]</A>), 
paragraph 15. The description for the get function with the following 
signature:</P><PRE>  basic_istream&lt;charT,traits&gt;&amp; get(basic_streambuf&lt;char_type,traits&gt;&amp;
  sb);
</PRE>
<P>is incorrect. It reads</P>
<BLOCKQUOTE>Effects: Calls get(s,n,widen('\n')) </BLOCKQUOTE>
<P>which I believe should be:</P>
<BLOCKQUOTE>Effects: Calls get(sb,widen('\n')) </BLOCKQUOTE>
<P><B>Proposed resolution:</B></P>
<P>Change the <B>Effects</B> paragraph to:</P>
<BLOCKQUOTE>Effects: Calls get(sb,this-&gt;widen('\n')) </BLOCKQUOTE>
<P><I>[Pre-Oxford: Minor correction from Howard: replaced 'widen' with 
'this-&gt;widen'.]</I></P>
<P><B>Rationale:</B></P>
<P>Fixes an obvious typo.</P>
<HR>
<A name=373>
<H3>373.&nbsp;Are basic_istream and basic_ostream to use 
(exceptions()&amp;badbit) != 0 ?</H3></A>
<P><B>Section:</B>&nbsp;27.6.1.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.reqmts">[lib.istream.formatted.reqmts]</A>, 
27.6.2.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.formatted.reqmts">[lib.ostream.formatted.reqmts]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Keith Baker&nbsp; <B>Date:</B>&nbsp;23 Jul 2002</P>
<P>In 27.6.1.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.reqmts">[lib.istream.formatted.reqmts]</A> 
and 27.6.2.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.formatted.reqmts">[lib.ostream.formatted.reqmts]</A> 
(exception()&amp;badbit) != 0 is used in testing for rethrow, yet exception() is 
the constructor to class std::exception in 18.6.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.exception">[lib.exception]</A> 
that has no return type. Should member function exceptions() found in 27.4.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ios">[lib.ios]</A> 
be used instead? </P>
<P><B>Proposed resolution:</B></P>
<P>In 27.6.1.2.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.istream.formatted.reqmts">[lib.istream.formatted.reqmts]</A> 
and 27.6.2.5.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.ostream.formatted.reqmts">[lib.ostream.formatted.reqmts]</A>, 
change "(exception()&amp;badbit) != 0" to "(exceptions()&amp;badbit) != 0". </P>
<P><B>Rationale:</B></P>
<P>Fixes an obvious typo.</P>
<HR>
<A name=375>
<H3>375.&nbsp;basic_ios should be ios_base in 27.7.1.3</H3></A>
<P><B>Section:</B>&nbsp;27.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.virtuals">[lib.stringbuf.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Ray Lischner&nbsp; <B>Date:</B>&nbsp;14 Aug 2002</P>
<P>In Section 27.7.1.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.stringbuf.virtuals">[lib.stringbuf.virtuals]</A>: 
Table 90, Table 91, and paragraph 14 all contain references to "basic_ios::" 
which should be "ios_base::". </P>
<P><B>Proposed resolution:</B></P>
<P>Change all references to "basic_ios" in Table 90, Table 91, and paragraph 14 
to "ios_base". </P>
<P><B>Rationale:</B></P>
<P>Fixes an obvious typo.</P>
<HR>
<A name=379>
<H3>379.&nbsp;nonsensical ctype::do_widen() requirement</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.virtuals">[lib.locale.ctype.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;6 Sep 2002</P>
<P>The last sentence in 22.2.1.1.2, p11 below doesn't seem to make sense. </P><PRE>  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
       charT value or values. The only characters for which unique
       transformations are required are those in the basic source
       character set (2.2). For any named ctype category with a
       ctype&lt;charT&gt; facet ctw and valid ctype_base::mask value
       M (is(M, c) || !ctw.is(M, do_widen(c))) is true.
</PRE>
<P>Shouldn't the last sentence instead read </P><PRE>       For any named ctype category with a ctype&lt;char&gt; facet ctc
       and valid ctype_base::mask value M
       (ctc.is(M, c) || !is(M, do_widen(c))) is true.
</PRE>
<P>I.e., if the narrow character c is not a member of a class of characters then 
neither is the widened form of c. (To paraphrase footnote 224.) </P>
<P><B>Proposed resolution:</B></P>
<P>Replace the last sentence of 22.2.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.ctype.virtuals">[lib.locale.ctype.virtuals]</A>, 
p11 with the following text: </P><PRE>       For any named ctype category with a ctype&lt;char&gt; facet ctc
       and valid ctype_base::mask value M,
       (ctc.is(M, c) || !is(M, do_widen(c))) is true.
</PRE>
<P><I>[Kona: Minor edit. Added a comma after the <I>M</I> for clarity.]</I></P>
<P><B>Rationale:</B></P>
<P>The LWG believes this is just a typo, and that this is the correct fix.</P>
<HR>
<A name=380>
<H3>380.&nbsp;typos in codecvt tables 53 and 54</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;6 Sep 2002</P>
<P>Tables 53 and 54 in 22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A> 
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. </P>
<P>Table 54, row 3 says that the meaning of partial is "more characters needed 
to be supplied to complete termination." The function is not supplied any 
characters, it is given a buffer which it fills with characters or, more 
precisely, destination elements (i.e., an escape sequence). So partial means 
that space for more than (to_limit - to) destination elements was needed to 
terminate a sequence given the value of state. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the title of Table 53 to "do_in/do_out result values" and the title of 
Table 54 to "do_unshift result values." </P>
<P>Change the text in Table 54, row 3 (the <B>partial</B> row), under the 
heading Meaning, to "space for more than (to_limit - to) destination elements 
was needed to terminate a sequence given the value of state." </P>
<HR>
<A name=381>
<H3>381.&nbsp;detection of invalid mbstate_t in codecvt</H3></A>
<P><B>Section:</B>&nbsp;22.2.1.5.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.codecvt.virtuals">[lib.locale.codecvt.virtuals]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;6 Sep 2002</P>
<P>All but one codecvt member functions that take a state_type argument list as 
one of their preconditions that the state_type argument have a valid value. 
However, according to 22.2.1.5.2, p6, codecvt::do_unshift() is the only codecvt 
member that is supposed to return error if the state_type object is invalid. 
</P>
<P>It seems to me that the treatment of state_type by all codecvt member 
functions should be the same and the current requirements should be changed. 
Since the detection of invalid state_type values may be difficult in general or 
computationally expensive in some specific cases, I propose the following: </P>
<P><B>Proposed resolution:</B></P>
<P>Add a new paragraph before 22.2.1.5.2, p5, and after the function declaration 
below </P><PRE>    result do_unshift(stateT&amp; state,
    externT* to, externT* to_limit, externT*&amp; to_next) const;
</PRE>
<P>as follows: </P><PRE>    Requires: (to &lt;= 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.
</PRE>
<P>and change the text in Table 54, row 4, the <B>error</B> row, under the 
heading Meaning, from </P><PRE>    state has invalid value
</PRE>
<P>to </P><PRE>    an unspecified error has occurred
</PRE>
<P><B>Rationale:</B></P>
<P>The intent is that implementations should not be required to detect invalid 
state values; such a requirement appears nowhere else. An invalid state value is 
a precondition violation, <I>i.e.</I> undefined behavior. Implementations that 
do choose to detect invalid state values, or that choose to detect any other 
kind of error, may return <B>error</B> as an indication.</P>
<HR>
<A name=383>
<H3>383.&nbsp;Bidirectional iterator assertion typo</H3></A>
<P><B>Section:</B>&nbsp;24.1.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.bidirectional.iterators">[lib.bidirectional.iterators]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;ysapir (submitted via comp.std.c++)&nbsp; 
<B>Date:</B>&nbsp;17 Oct 2002</P>
<P>Following a discussion on the boost list regarding end iterators and the 
possibility of performing operator--() on them, it seems to me that there is a 
typo in the standard. This typo has nothing to do with that discussion. </P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#299">299</A> 
on section 24.1.4, and DR <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#299">299</A> 
is not related to this issue. </P>
<P>The standard makes the following assertion on bidirectional iterators, in 
section 24.1.4 [lib.bidirectional.iterators], Table 75: </P><PRE>                         operational  assertion/note
expression  return type   semantics    pre/post-condition

--r          X&amp;                        pre: there exists s such
                                       that r == ++s.
                                       post: s is dereferenceable.
                                       --(++r) == r.
                                       --r == --s implies r == s.
                                       &amp;r == &amp;--r.
</PRE>
<P>(See <A 
href="http://aspn.activestate.com/ASPN/Mail/Message/boost/1395763">http://aspn.activestate.com/ASPN/Mail/Message/boost/1395763</A>.) 
</P>
<P>In particular, "s is dereferenceable" seems to be in error. It seems that the 
intention was to say "r is dereferenceable". </P>
<P>If it were to say "r is dereferenceable" it would make perfect sense. Since s 
must be dereferenceable prior to operator++, then the natural result of 
operator-- (to undo operator++) would be to make r dereferenceable. Furthermore, 
without other assertions, and basing only on precondition and postconditions, we 
could not otherwise know this. So it is also interesting information. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the guarantee to "postcondition: r is dereferenceable." </P>
<P><B>Rationale:</B></P>
<P>Fixes an obvious typo</P>
<HR>
<A name=389>
<H3>389.&nbsp;Const overload of valarray::operator[] returns by value</H3></A>
<P><B>Section:</B>&nbsp;26.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.valarray">[lib.template.valarray]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Gabriel Dos Reis&nbsp; <B>Date:</B>&nbsp;8 Nov 2002</P>
<P>Consider the following program:</P><PRE>    #include &lt;iostream&gt;
    #include &lt;ostream&gt;
    #include &lt;vector&gt;
    #include &lt;valarray&gt;
    #include &lt;algorithm&gt;
    #include &lt;iterator&gt;
    template&lt;typename Array&gt;
    void print(const Array&amp; a)
    {
    using namespace std;
    typedef typename Array::value_type T;
    copy(&amp;a[0], &amp;a[0] + a.size(),
    ostream_iterator&lt;T&gt;(std::cout, " "));
    }
    template&lt;typename T, unsigned N&gt;
    unsigned size(T(&amp;)[N]) { return N; }
    int main()
    {
    double array[] = { 0.89, 9.3, 7, 6.23 };
    std::vector&lt;double&gt; v(array, array + size(array));
    std::valarray&lt;double&gt; w(array, size(array));
    print(v); // #1
    std::cout &lt;&lt; std::endl;
    print(w); // #2
    std::cout &lt;&lt; std::endl;
    }
</PRE>
<P>While the call numbered #1 succeeds, the call numbered #2 fails because the 
const version of the member function valarray&lt;T&gt;::operator[](size_t) 
returns a value instead of a const-reference. That seems to be so for no 
apparent reason, no benefit. Not only does that defeats users' expectation but 
it also does hinder existing software (written either in C or Fortran) 
integration within programs written in C++. There is no reason why subscripting 
an expression of type valarray&lt;T&gt; that is const-qualified should not 
return a const T&amp;.</P>
<P><B>Proposed resolution:</B></P>
<P>In the class synopsis in 26.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.template.valarray">[lib.template.valarray]</A>, 
and in 26.3.2.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.valarray.access">[lib.valarray.access]</A> 
just above paragraph 1, change</P><PRE>  T operator[](size_t const);
</PRE>
<P>to</P><PRE>  const T&amp; operator[](size_t const);
</PRE>
<P><I>[Kona: fixed a minor typo: put semicolon at the end of the line wehre it 
belongs.]</I></P>
<P><B>Rationale:</B></P>
<P>Return by value seems to serve no purpose. Valaray was explicitly designed to 
have a specified layout so that it could easily be 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.</P>
<HR>
<A name=391>
<H3>391.&nbsp;non-member functions specified as const</H3></A>
<P><B>Section:</B>&nbsp;22.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.conversions">[lib.conversions]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;James Kanze&nbsp; <B>Date:</B>&nbsp;10 Dec 2002</P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locales">[lib.locales]</A>. 
</P>
<P><B>Proposed resolution:</B></P>
<P>In 22.1.3.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.conversions">[lib.conversions]</A>, 
remove <TT>const</TT> from the function declarations of std::toupper and 
std::tolower</P>
<P><B>Rationale:</B></P>
<P>Fixes an obvious typo</P>
<HR>
<A name=395>
<H3>395.&nbsp;inconsistencies in the definitions of rand() and 
random_shuffle()</H3></A>
<P><B>Section:</B>&nbsp;26.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.c.math">[lib.c.math]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;James Kanze&nbsp; <B>Date:</B>&nbsp;3 Jan 2003</P>
<P>In 26.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-numerics.html#lib.c.math">[lib.c.math]</A>, 
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." </P>
<P>In 25.2.11 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.random.shuffle">[lib.alg.random.shuffle]</A>, 
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 not call rand(), there is the question of how whatever random generator it 
does use is seeded. Something is missing. </P>
<P><B>Proposed resolution:</B></P>
<P>In [lib.c.math], add a paragraph specifying that the C definition of rand 
shal be modified to say that "Unless otherwise specified, the implementation 
shall behave as if no library function calls the rand function." </P>
<P>In [lib.alg.random.shuffle], add a sentence to the effect that "In the two 
argument form of the function, the underlying source of random numbers is 
implementation defined. [Note: in particular, an implementation is permitted to 
use <TT>rand</TT>.] </P>
<P><B>Rationale:</B></P>
<P>The original proposed resolution proposed requiring the two-argument from of 
<TT>random_shuffle</TT> to use <TT>rand</TT>. We don't want to do that, because 
some existing implementations already use something else: gcc uses 
<TT>lrand48</TT>, for example. Using <TT>rand</TT> presents a problem if the 
number of elements in the sequence is greater than RAND_MAX.</P>
<HR>
<A name=400>
<H3>400.&nbsp;redundant type cast in lib.allocator.members</H3></A>
<P><B>Section:</B>&nbsp;20.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.members">[lib.allocator.members]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Markus Mauhart&nbsp; <B>Date:</B>&nbsp;27 Feb 2003</P>
<P>20.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.members">[lib.allocator.members]</A> 
allocator members, contains the following 3 lines: </P><PRE>  12 Returns: new((void *) p) T( val)
     void destroy(pointer p);
  13 Returns: ((T*) p)-&gt;~T()
</PRE>
<P>The type cast "(T*) p" in the last line is redundant cause we know that 
std::allocator&lt;T&gt;::pointer is a typedef for T*. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace "((T*) p)" with "p". </P>
<P><B>Rationale:</B></P>
<P>Just a typo, this is really editorial.</P>
<HR>
<A name=402>
<H3>402.&nbsp;wrong new expression in [some_]allocator::construct</H3></A>
<P><B>Section:</B>&nbsp;20.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A>, 
20.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.members">[lib.allocator.members]</A>, 
&nbsp; <B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Markus Mauhart&nbsp; <B>Date:</B>&nbsp;27 Feb 2003</P>
<P>This applies to the new expression that is contained in both par12 of 
20.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.members">[lib.allocator.members]</A> 
and in par2 (table 32) of 20.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A>. 
I think this new expression is wrong, involving unintended side effects. </P>
<P>20.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.members">[lib.allocator.members]</A> 
contains the following 3 lines:</P><PRE>  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)
</PRE>
<P>20.1.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-utilities.html#lib.allocator.requirements">[lib.allocator.requirements]</A> 
in table 32 has the following line:</P><PRE>  a.construct(p,t)   Effect: new((void*)p) T(t)
</PRE>
<P>.... with the prerequisits coming from the preceding two paragraphs, 
especially from table 31: </P><PRE>  alloc&lt;T&gt;             a     ;// an allocator for T
  alloc&lt;T&gt;::pointer    p     ;// random access iterator
                              // (may be different from T*)
  alloc&lt;T&gt;::reference  r = *p;// T&amp;
  T const&amp;             t     ;
</PRE>
<P>Cause of using "new" but not "::new", any existing "T::operator new" function 
will hide the global placement new function. When there is no "T::operator new" 
with adequate signature, every_alloc&lt;T&gt;::construct(..) is ill-formed, and 
most std::container&lt;T,every_alloc&lt;T&gt;&gt; use it; a workaround would be 
adding placement new and delete functions with adequate signature and semantic 
to class T, but class T might come from another party. Maybe even worse is the 
case when T has placement new and delete functions with adequate signature but 
with "unknown" semantic: I dont like to speculate about it, but whoever 
implements any_container&lt;T,any_alloc&gt; and wants to use construct(..) 
probably must think about it. </P>
<P><B>Proposed resolution:</B></P>
<P>Replace "new" with "::new" in both cases. </P>
<HR>
<A name=403>
<H3>403.&nbsp;basic_string::swap should not throw exceptions</H3></A>
<P><B>Section:</B>&nbsp;21.3.5.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::swap">[lib.string::swap]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Beman Dawes&nbsp; <B>Date:</B>&nbsp;25 Mar 2003</P>
<P>std::basic_string, 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A> 
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. </P>
<P>Section 23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
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. </P>
<P>Eric Niebler points out that 21.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.basic.string">[lib.basic.string]</A> 
paragraph 5 explicitly permits basic_string::swap to invalidates iterators, 
which is disallowed by 23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
paragraph 10. Thus the standard would be contradictory if it were read or 
extended to read as having basic_string meet 23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
paragraph 10 requirements. </P>
<P>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 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
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 important 
use of swap is to ensure that exceptions are not thrown in exception-safe code. 
</P>
<P>Note: There remains long standing concern over whether or not it is possible 
to reasonably meet the 23.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.container.requirements">[lib.container.requirements]</A> 
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. </P>
<P><B>Proposed resolution:</B></P>
<P>In 21.3.5.8 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::swap">[lib.string::swap]</A>, 
add a throws clause: </P>
<P>Throws: Shall not throw exceptions. </P>
<HR>
<A name=404>
<H3>404.&nbsp;May a replacement allocation function be declared inline?</H3></A>
<P><B>Section:</B>&nbsp;17.4.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.replacement.functions">[lib.replacement.functions]</A>, 
18.4.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete">[lib.new.delete]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;24 Apr 2003</P>
<P>The eight basic dynamic memory allocation functions (single-object and array 
versions of ::operator new and ::operator delete, in the ordinary and nothrow 
forms) are replaceable. A C++ program may provide an alternative definition for 
any of them, which will be used in preference to the implementation's 
definition. </P>
<P>Three different parts of the standard mention requirements on replacement 
functions: 17.4.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.replacement.functions">[lib.replacement.functions]</A>, 
18.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.single">[lib.new.delete.single]</A> 
and 18.4.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.array">[lib.new.delete.array]</A>, 
and 3.7.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/basic.html#basic.stc.dynamic">[basic.stc.dynamic]</A>. 
</P>
<P>None of these three places say whether a replacement function may be declared 
inline. 18.4.1.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-support.html#lib.new.delete.single">[lib.new.delete.single]</A> 
paragraph 2 specifies a signature for the replacement function, but that's not 
enough: the <TT>inline</TT> specifier is not part of a function's signature. One 
might also reason from 7.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/dcl.html#dcl.fct.spec">[dcl.fct.spec]</A> 
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 explicitly forbid inline 
replacement memory allocation functions.</P>
<P><B>Proposed resolution:</B></P>
<P>Add a new sentence to the end of 17.4.3.4 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-intro.html#lib.replacement.functions">[lib.replacement.functions]</A> 
paragraph 3: "The program's definitions shall not be specified as 
<TT>inline</TT>. No diagnostic is required." </P>
<P><I>[Kona: added "no diagnostic is required"]</I></P>
<P><B>Rationale:</B></P>
<P>The fact that <TT>inline</TT> isn't mentioned appears to have been nothing 
more than an oversight. Existing implementations do not permit inline functions 
as replacement memory allocation functions. Providing this functionality would 
be difficult in some cases, and is believed to be of limited value. </P>
<HR>
<A name=407>
<H3>407.&nbsp;Can singular iterators be destroyed?</H3></A>
<P><B>Section:</B>&nbsp;24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Nathan Myers&nbsp; <B>Date:</B>&nbsp;3 June 2003</P>
<P>Clause 24.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iterators.html#lib.iterator.requirements">[lib.iterator.requirements]</A>, 
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 variable go out of scope) is technically undefined behavior. This 
seems overly strict, and probably unintentional. </P>
<P><B>Proposed resolution:</B></P>
<P>Change the sentence in question to "... the only exceptions are destroying an 
iterator that holds a singular value, or the assignment of a non-singular value 
to an iterator that holds a singular value." </P>
<HR>
<A name=411>
<H3>411.&nbsp;Wrong names of set member functions</H3></A>
<P><B>Section:</B>&nbsp;25.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.set.operations">[lib.alg.set.operations]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Daniel Frey&nbsp; <B>Date:</B>&nbsp;9 Jul 2003</P>
<P>25.3.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-algorithms.html#lib.alg.set.operations">[lib.alg.set.operations]</A> 
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 so on." 
</P>
<P>This is wrong. The name of the functions are set_union() and 
set_intersection(), not union() and intersection(). </P>
<P><B>Proposed resolution:</B></P>
<P>Change that sentence to use the correct names.</P>
<HR>
<A name=414>
<H3>414.&nbsp;Which iterators are invalidated by v.erase()?</H3></A>
<P><B>Section:</B>&nbsp;23.2.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.modifiers">[lib.vector.modifiers]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Matt Austern&nbsp; <B>Date:</B>&nbsp;19 Aug 2003</P>
<P>Consider the following code fragment: </P>
<BLOCKQUOTE><PRE>int A[8] = { 1,3,5,7,9,8,4,2 };
std::vector&lt;int&gt; v(A, A+8);

std::vector&lt;int&gt;::iterator i1 = v.begin() + 3;
std::vector&lt;int&gt;::iterator i2 = v.begin() + 4;
v.erase(i1);
</PRE></BLOCKQUOTE>
<P>Which iterators are invalidated by <TT>v.erase(i1)</TT>: i1, i2, both, or 
neither? </P>
<P>On all existing implementations that I know of, the status of i1 and i2 is 
the same: both of them will be iterators that point to some elements of the 
vector (albeit not the same elements they did before). You won't get a crash if 
you use them. Depending on exactly what you mean by "invalidate", you might say 
that neither one has been invalidated because they still point to 
<I>something</I>, or you might say that both have been invalidated because in 
both cases the elements they point to have been changed out from under the 
iterator. </P>
<P>The standard doesn't say either of those things. It says that erase 
invalidates all iterators and references "after the point of the erase". This 
doesn't include i1, since it's at the point of the erase instead of after it. I 
can't think of any sensible definition of invalidation by which one can say that 
i2 is invalidated but i1 isn't. </P>
<P>(This issue is important if you try to reason about iterator validity based 
only on the guarantees in the standard, rather than reasoning from typical 
implementation techniques. Strict debugging modes, which some programmers find 
useful, do not use typical implementation techniques.) </P>
<P><B>Proposed resolution:</B></P>
<P>In 23.2.4.3 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-containers.html#lib.vector.modifiers">[lib.vector.modifiers]</A> 
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". </P>
<P><B>Rationale:</B></P>
<P>I believe this was essentially a typographical error, and that it was taken 
for granted that erasing an element invalidates iterators that point to it. The 
effects clause in question treats iterators and references in parallel, and it 
would seem counterintuitive to say that a reference to an erased value remains 
valid.</P>
<HR>
<A name=420>
<H3>420.&nbsp;is std::FILE a complete type?</H3></A>
<P><B>Section:</B>&nbsp;27.8.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fstreams">[lib.fstreams]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;18 Sep 2003</P>
<P>7.19.1, p2, of C99 requires that the FILE type only be declared in 
&lt;stdio.h&gt;. None of the (implementation-defined) members of the struct is 
mentioned anywhere for obvious reasons. </P>
<P>C++ says in 27.8.1, p2 that FILE is a type that's defined in &lt;cstdio&gt;. 
Is it really the intent that FILE be a complete type or is an implementation 
allowed to just declare it without providing a full definition? </P>
<P><B>Proposed resolution:</B></P>
<P>In the first sentence of 27.8.1 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-iostreams.html#lib.fstreams">[lib.fstreams]</A> 
paragraph 2, change "defined" to "declared".</P>
<P><B>Rationale:</B></P>
<P>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.</P>
<HR>
<A name=428>
<H3>428.&nbsp;string::erase(iterator) validity</H3></A>
<P><B>Section:</B>&nbsp;21.3.5.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::erase">[lib.string::erase]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;18 Sep 2003</P>
<P>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. </P>
<P>However, 21.3.5.5, p5 describing string::erase(p) only requires that p be a 
valid iterator. </P>
<P>This may be interepreted as a relaxation of the general requirement, which is 
most likely not the intent. </P>
<P><B>Proposed resolution:</B></P>
<P>Remove 21.3.5.5 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-strings.html#lib.string::erase">[lib.string::erase]</A> 
paragraph 5.</P>
<P><B>Rationale:</B></P>
<P>The LWG considered two options: changing the string requirements to match the 
general container requirements, or just removing the erroneous string 
requirements altogether. The LWG chose the latter option, on the grounds that 
duplicating text always risks the possibility that it might be duplicated 
incorrectly.</P>
<HR>
<A name=436>
<H3>436.&nbsp;are cv-qualified facet types valid facets?</H3></A>
<P><B>Section:</B>&nbsp;22.1.1.1.2 <A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lib-locales.html#lib.locale.facet">[lib.locale.facet]</A>&nbsp; 
<B>Status:</B>&nbsp;<A 
href="file:///C:/Documents%20and%20Settings/jward4/Local%20Settings/Temp/lwg-active.html#WP">WP</A>&nbsp; 
<B>Submitter:</B>&nbsp;Martin Sebor&nbsp; <B>Date:</B>&nbsp;15 Oct 2003</P>
<P>Is "const std::ctype&lt;char&gt;" a valid template argument to has_facet, 
use_facet, and the locale template ctor? And if so, does it designate the same 
Facet as the non-const "std::ctype&lt;char&gt;?" What about "volatile 
std::ctype&lt;char&gt;?" Different implementations behave differently: some fail 
to compile, others accept such types but behave inconsistently. </P>
<P><B>Proposed resolution:</B></P>
<P>Change 22.1.1.1.2, p1 to read:</P>
<P>Template parameters in this clause which are required to be facets are those 
named Facet in declarations. A program that passes a type that is not a facet, 
or a type that refers to volatile-qualified facet, as an (explicit or deduced) 
template parameter to a locale function expecting a facet, is ill-formed. A 
const-qualified facet is a valid template argument to any locale function that 
expects a Facet template parameter.</P>
<P><I>[Kona: changed the last sentence from a footnote to normative 
text.]</I></P>
<P>----- End of document -----</P></BODY></HTML>
