Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51118 - sandbox/committee/rvalue_ref
From: dgregor_at_[hidden]
Date: 2009-02-08 17:20:50


Author: dgregor
Date: 2009-02-08 17:20:47 EST (Sun, 08 Feb 2009)
New Revision: 51118
URL: http://svn.boost.org/trac/boost/changeset/51118

Log:
This document is done, I hope
Text files modified:
   sandbox/committee/rvalue_ref/soundness.html | 589 +++++++++++++++++++++++++++++++--------
   1 files changed, 462 insertions(+), 127 deletions(-)

Modified: sandbox/committee/rvalue_ref/soundness.html
==============================================================================
--- sandbox/committee/rvalue_ref/soundness.html (original)
+++ sandbox/committee/rvalue_ref/soundness.html 2009-02-08 17:20:47 EST (Sun, 08 Feb 2009)
@@ -6,6 +6,23 @@
 li {text-align:justify}
 ins {background-color:#A0FFA0}
 del {background-color:#FFA0A0}
+
+div.admonition {
+ margin: 2em ;
+ border: medium outset ;
+ padding: 1em }
+
+div.admonition p.admonition-title, {
+ font-weight: bold ;
+ font-family: sans-serif }
+
+div.attention p.admonition-title, div.caution p.admonition-title,
+div.danger p.admonition-title, div.error p.admonition-title,
+div.warning p.admonition-title {
+ color: red ;
+ font-weight: bold ;
+ font-family: sans-serif }
+
 </style>
 </head>
 
@@ -19,16 +36,176 @@
 Number: D2831=09-0021<br>
 Revises: N2812=08-0322</p>
 
-<!-- TODO: string's getline? -->
-<!-- TODO: 27.6.2.7, then pick up after that with the insertion/extraction operators -->
-<!-- TODO: add the rvalue stream insertion/extraction operations -->
+<ul>
+ <li>Introduction</li>
+ <li>The Problem</li>
+ <li>Proposed Changes</li>
+ <li>Implementation Experience</li>
+ <li>Proposed Wording
+ <ul>
+ <li>5.2.9 Static cast [expr.static.cast]</li>
+ <li>8.5.3 References [dcl.init.ref]</li>
+ <li>13.3.3.2 Ranking implicit conversion sequences [over.ics.rank]</li>
+ <li>20.1.1 Type transformations [concept.transform]</li>
+ <li>20.1.2 Type classifications [concept.classify]</li>
+ <li>20.1.3 Operator concepts [concept.operator]</li>
+ <li>20.2.2 forward/move helpers [forward]</li>
+ <li>20.2.3 Pairs [pairs]</li>
+ <li>20.4.2.6 Tuple swap [tuple.swap]</li>
+ <li>20.4.2.7 Tuple specialized algorithms [tuple.special]</li>
+ <li>20.6.16.2.2 function modifiers [func.wrap.func.mod]</li>
+ <li>20.7.12.2.5 unique_ptr modifiers [unique.ptr.single.modifiers]</li>
+ <li><a href="#20.7.12.4">20.7.12.4 unique_ptr specialized algorithms
+[unique.ptr.special]</a></li>
+ <li>20.7.13.2.4 shared_ptr modifiers [util.smartptr.shared.mod]</li>
+ <li><a href="#20.7.13.2.9">20.7.13.2.9 shared_ptr specialized algorithms
+[util.smartptr.shared.spec]</a></li>
+ <li>21.3.6.8 basic_string::swap [string::swap]</li>
+ <li>21.3.8.8 swap [string.special]</li>
+ <li>21.3.8.9 Inserters and extractors [string.io]</li>
+ <li>23.2.2 Class template deque [deque]</li>
+ <li>23.2.2.4 deque specialized algorithms [deque.special]</li>
+ <li>23.2.3 Class template forward_list [forwardlist]</li>
+ <li>23.2.3.6 forward_list specialized algorithms [forwardlist.spec]</li>
+ <li>23.2.4 Class template list [list]</li>
+ <li>23.2.4.5 list specialized algorithms [list.special]</li>
+ <li>23.2.5.1.1 queue definition [queue.defn]</li>
+ <li>23.2.5.1.3 queue specialized algorithms [queue.special]</li>
+<li>23.2.5.2 Class template priority_queue [priority.queue]</li>
+<li>23.2.5.2.3 priority_queue specialized algorithms [priqueue.special]</li>
+<li>23.2.5.3.1 stack definition [stack.defn]</li>
+<li>23.2.5.3.3 stack specialized algorithms [stack.special]</li>
+<li>23.2.6 Class template vector [vector]</li>
+<li>23.2.6.2 vector capacity [vector.capacity]</li>
+<li>23.2.6.5 vector specialized algorithms [vector.special]</li>
+<li>23.2.7 Class vector<bool> [vector.bool]</li>
+<li>23.3.1 Class template map [map]</li>
+<li>23.3.1.5 map specialized algorithms [map.special]</li>
+<li>23.3.2 Class template multimap [multimap]</li>
+<li>23.3.2.4 multimap specialized algorithms [multimap.special]</li>
+<li>23.3.3 Class template set [set]</li>
+<li>23.3.3.2 set specialized algorithms [set.special]</li>
+<li>23.3.4 Class template multiset [multiset]</li>
+<li>23.3.4.2 multiset specialized algorithms [multiset.special]</li>
+<li>23.4.1 Class template unordered_map [unord.map]</li>
+<li>23.4.1.3 unordered_map swap [unord.map.swap]</li>
+<li>23.4.2 Class template unordered_multimap [unord.multimap]</li>
+<li>23.4.2.2 unordered_multimap swap [unord.multimap.swap]</li>
+<li>23.4.3 Class template unordered_set [unord.set]</li>
+<li>23.4.3.2 unordered_set swap [unord.set.swap]</li>
+<li>23.4.4 Class template unordered_multiset [unord.multiset]</li>
+<li>23.4.4.2 unordered_multiset swap [unord.multiset.swap]</li>
+<li>24.1.1 Iterator [iterator.iterators]</li>
+<li>26.5.2 Class template valarray [template.valarray]</li>
+<li>26.5.2.7 valarray member functions [valarray.members]</li>
+<li>26.5.3.4 valarray specialized algorithms [valarray.special]</li>
+<li>27.4.4 Class template basic_ios [ios]</li>
+<li>27.4.4.2 Member functions [basic.ios.members]</li>
+<li>27.5.2 Class template basic_streambuf [streambuf]</li>
+<li>27.5.2.3.1 Assignment [streambuf.assign]</li>
+<li>27.6 Formatting and manipulators [iostream.format]</li>
+<li>27.6.1 Input streams [input.streams]</li>
+<li>27.6.1.1 Class template basic_istream [istream]</li>
+<li>27.6.1.1.2 Class basic_istream assign and swap [istream.assign]</li>
+<li>27.6.1.2.3 basic_istream::operator>> [istream::extractors]</li>
+<li>27.6.1.5 Class template basic_iostream [iostreamclass]</li>
+<li>27.6.1.5.3 basic_iostream assign and swap [iostream.assign]</li>
+<li>27.6.1.6 Rvalue stream extraction [istream.rvalue]</li>
+<li>27.6.2 Output streams [output.streams]</li>
+<li>27.6.2.1 Class template basic_ostream [ostream]</li>
+<li>27.6.2.3 Class basic_ostream assign and swap [ostream.assign]</li>
+<li>27.6.2.6.4 Character inserter function templates [ostream.inserters.character]</li>
+<li>27.6.2.9 Rvalue stream insertion [ostream.rvalue]</li>
+<li>27.7.1 Class template basic_stringbuf [stringbuf]</li>
+<li>27.7.1.2 Assign and swap [stringbuf.assign]</li>
+<li>27.7.2 Class template basic_istringstream [istringstream]</li>
+<li>27.7.2.2 Assign and swap [istringstream.assign]</li>
+<li>27.7.3 Class template basic_ostringstream [ostringstream]</li>
+<li>27.7.3.2 Assign and swap [ostringstream.assign]</li>
+<li>27.7.4 Class template basic_stringstream [stringstream]</li>
+<li>27.7.4.2 Assign and swap [stringstream.assign]</li>
+<li>27.8.1.1 Class template basic_filebuf [filebuf]</li>
+<li>27.8.1.3 Assign and swap [filebuf.assign]</li>
+<li>27.8.1.6 Class template basic_ifstream [ifstream]</li>
+<li>27.8.1.8 Assign and swap [ifstream.assign]</li>
+<li>27.8.1.10 Class template basic_ofstream [ofstream]</li>
+<li>27.8.1.12 Assign and swap [ofstream.assign]</li>
+<li>27.8.1.14 Class template basic_fstream [fstream]</li>
+<li>27.8.1.16 Assign and swap [fstream.assign]</li>
+<li>30.2.1 Class thread [thread.thread.class]</li>
+<li>30.2.1.1 Class thread::id [thread.thread.id]</li>
+<li>30.2.1.5 thread members [thread.thread.member]</li>
+<li>30.2.1.7 thread specialized algorithms [thread.thread.algorithm]</li>
+<li>30.3.3.2 Class template unique_lock [thread.lock.unique]</li>
+<li>30.3.3.2.3 unique_lock modifiers [thread.lock.unique.mod]</li>
+<li>30.5.8 Class template packaged_task [futures.task]</li>
+ </ul>
+ </li>
+</ul>
+
+<a name="intro"></a><h2>Introduction</h2>
+<p>N2812=08-0322 describes a safety problem with rvalue references that can cause unintentional modification of lvalues. The problem is summarized below; however, please read N2812 for a comprehensive discussion of the motivation behind this change. This paper provides proposed wording that fixes the safety problem in both the language and in the library.<p>
+
+<a name="problem"></a><h2>The Problem</h2>
+
+<p>Rvalue references violate a principle which we refer to as the Principle of Type-Safe Overloading, which we express as:<p>
+
+<div class="admonition-principle-of-type-safe-overloading-pto admonition">
+<p class="first admonition-title">Principle of Type-safe Overloading</p>
+<p class="last">Every function must be type-safe in isolation, <em>without regard to how it has been overloaded.</em></p>
+</div>
+
+<p>Specifically, in the common use of rvalue references to provide
+overloads for both copy and move semantics, rvalue references rely on
+overloading behavior to provide type safety. For example, consider <code>std::list</code>'s <code>push_back</code> operation:</p>
+
+<pre>
+template&lt;typename T&gt;
+class list {
+public:
+ void push_back(const value_type&amp; x); // #1
+ void push_back(value_type&amp;&amp; x); // #2
+};
+</pre>
+
+<p>Now, when we call <code>push_back</code> with an lvalue of a type that is movable but not copyable (here, <code>std::unique_ptr</code>), we see the use of overloading to ensure type-safety. For example:</p>
+
+<pre>
+void do_push_back(std::list&lt;std::unique_ptr&lt;int&gt;&gt; &amp;l, std::unique_ptr&lt;int&gt; x) {
+ l.push_back(x); // error: selects #1, which fails to instantiate
+}
+</pre>
+
+<p>Here, overload resolution must select between the two overloads. Overload #1 is viable, since the lvalue reference to const can bind to an lvalue. Overload #2 is also viable, since an rvalue reference can bind to an lvalue. Overload resolution then selects #1 (the copying version of <code>push_back</code>).
+Later, the instantiation of #1 will fail, because <code>std::unique_ptr</code>s are non-copyable types.<p>
+
+<p>The end result of this process is as desired: the <code>do_push_back</code> operation attempted to pass an lvalue to an operation (<code>push_back</code>) that (conceptually) does not modify its input argument, but since the argument type does not support copying, we receive an error from the compiler. To avoid the error, we would need to explicitly say that the argument should be treated as an rvalue or provide a temporary.</p>
+
+<p>Despite the desirable result, the mechanism used to ensure that we receive a compilation error in this example is brittle. In particular, if for some reason overload #1 is not viable, then call <code>l.push_back(x)</code> will resolve to #2, and silently steal resources from an lvalue. How could overload #1 become non-viable? One possibility is the use of concepts:</p>
+
+<pre>
+ <b>requires CopyConstructible&lt;value_type&gt;</b> void push_back(const value_type&amp; x); // #1
+ <b>requires MoveConstructible&lt;value_type&gt;</b> void push_back(value_type&amp;&amp; x); // #2
+</pre>
+
+<p>Here, the fact that <code>value_type</code> is not <code>CopyConstructible</code> means that overload #1 is automatically non-viable (in fact, it doesn't even exist in the class template specialization <code>std::list&lt;std::unique_ptr&lt;int&gt;&gt;</code>), Therefore, with concepts, the call <code>l.push_back(x)</code> type-checks and selects #2, silently moving from lvalues.</p>
+
+<p>The fundamental problem in this example is that overload #2 is violating the principle of type-safe overloading, because overload #2 <i>in isolation</i> is not safe: it silently steals resources from lvalues. The attempted fix for the problem, where we add additional overloads, will fail any time that those overloads can become non-viable in the overload sets. Simple uses of concepts expose this problem with rvalue references, but they aren't the only triggers: the issue can crop up due to any kind of template argument deduction failure.</p>
+
+<p>This proposal eliminates the binding of rvalue references to lvalues, so that rvalue references adhere to the principle of type-safe overloading. For additional motivation and a discussion of alternatives that have been proposed, please refer to N2812=08-0322.</p>
+
+<a name="changes"></a><h2>Proposed Changes</h2>
+<p>The language itself required relatively few changes, specifically:</p>
 
-<h2>Introduction</h2>
-<p>N2812=08-0322 describes a safety problem with rvalue references that can cause unintentional modification of lvalues. The problem is summarized below; however, please read N2812 for a comprehensive discussion of the motivation behind this change. This paper provides proposed wording that fixes the safety problem in both the language and in the library. Specifically, this paper proposes XXX changes:</p>
 <ul>
   <li>Rvalue references can no longer bind to lvalues.</li>
-
- <li>The signatures and implementations of <code>std::forward</code> and <code>std::move</code> are modified to provide the same user interface under the new reference-binding rules.</li>
+ <li>One can explicitly <code>static_cast</code> an lvalue to an rvalue without creating a temporary.</li>
+</ul>
+
+<p>The library changes are more extensive. However, most of the changes are specification changes that provide the same user-visible behavior while adhering to the new semantics of rvalue references. To achieve this goal, we:</p>
+
+<ul>
+ <li>Modified the signatures and implementations of <code>std::forward</code> and <code>std::move</code> to provide the same user interface under the new reference-binding rules.</li>
 
   <li>Added the concepts <code>LvalueReference</code> and <code>RvalueReference</code>; the former is required for <code>std::forward</code>, the latter for consistency.</li>
 
@@ -38,19 +215,38 @@
 
   <li>Added an additional <code>operator*</code> associated function to the <code>Iterator</code> and <code>HasDereference</code> concepts to permit dereferencing lvalue iterators.</li>
 
- <li>Changed the input and output streaming operators back to their C++03 versions by using lvalue references for the stream argument rather than rvalue references. Added new <code>operator&lt;&lt;</code> and <code>operator&gt;&gt;</code> overloads that accept rvalue streams and forward to the appropriate operator.</li>
+ <li>Changed the input and output streaming operators back to their C++03 versions by using lvalue references for the stream argument rather than rvalue references. </li>
+
+ <li>Added new <code>operator&lt;&lt;</code> and <code>operator&gt;&gt;</code> overloads that accept an rvalue stream and forward that stream (as an lvalue) to the appropriate operator, so that the C++0x library still supports the use of rvalue streams throughout.<li>
+
+ <li>Reverted <code>getline</code> to its lvalue-only C++03 semantics by removing the use of rvalue references.</li>
 </ul>
 
+<a name="implementation"></a><h2>Implementation Experience</h2>
 
-<h2>Proposed Wording</h2>
+<p>We have produced an implementation of the proposed solution in the
+GNU C++ compiler, which is available as a <a
+ href="http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00436.html">patch
+against GCC 4.3.2</a>. The actual implementation of the language
+change is trivial---we merely check whether the binding computed would
+bind an lvalue to an rvalue reference, and reject the binding in this
+case. The changes to the standard library are slightly more involved
+due to the large number of changes. We do not anticipate that this
+change will have any significant impact on compilers or standard
+library implementations. The GCC implementation required a day's
+effort to update both the language and the library, although more
+effort would certainly be required to update the test cases associated
+with this feature.</p>
 
-<h3>5.2.9 Static cast [expr.static.cast]</h3>
+<a name="wording"></a><h2>Proposed Wording</h2>
+
+<a name="5.2.9"></a><h3>5.2.9 Static cast [expr.static.cast]</h3>
 <p>Add the following new paragraph after paragraph 2</p>
 <ol start="3">
   <li><ins>A value of type "cv1 T2" can be cast to type "rvalue reference to cv2 T1" if "cv1 T1" is reference-compatible with "cv2 T2" (8.5.3). If T1 is a base class of T2, a program that necessitates such a cast is ill-formed if T1 is an inaccessible (Clause 11) or ambiguous (10.2) base class of T2.</ins></li>
 </ol>
 
-<h3>8.5.3 References [dcl.init.ref]</h3>
+<a name="8.5.3"></a><h3>8.5.3 References [dcl.init.ref]</h3>
 <p>Modify paragraph 5 as follows:</p>
 <ol start="5">
   <li>A reference to type "cv1 T1" is initialized by an expression of
@@ -98,7 +294,7 @@
   </li>
 </ol>
 
-<h3>13.3.3.2 Ranking implicit conversion sequences [over.ics.rank]</h3>
+<a name="13.3.3.2"></a><h3>13.3.3.2 Ranking implicit conversion sequences [over.ics.rank]</h3>
 <p>Modify paragraph 3 as follows</p>
 <ol start="3">
   <li>Two implicit conversion sequences of the same form are
@@ -151,7 +347,7 @@
   </ul></li>
 </ol>
 
-<h3>20.1.1 Type transformations [concept.transform]</h3>
+<a name="20.1.1"></a><h3>20.1.1 Type transformations [concept.transform]</h3>
 <p>Modify the <code>RvalueOf</code> concept as follows:</p>
 
 <pre>
@@ -162,7 +358,7 @@
 </pre>
 
 <p>Add the following new section</p>
-<h3><ins>20.1.2 Type classifications [concept.classify]</ins></h3>
+<a name="20.1.2"></a><h3><ins>20.1.2 Type classifications [concept.classify]</ins></h3>
 <ol>
   <li><ins>The concepts in 20.1.2 provide simple type classifications that
   can be used within constrained templates.</ins></li>
@@ -186,7 +382,7 @@
   reference type.</ins></li>
 </ol>
 
-<h3>20.1.3 Operator concepts [concept.operator]</h3>
+<a name="20.1.3"></a><h3>20.1.3 Operator concepts [concept.operator]</h3>
 <p>Modify the <code>HasDereference</code> concept as follows:</p>
 
 <pre>
@@ -215,7 +411,7 @@
 }
 </pre>
 
-<h3>20.2.2 forward/move helpers [forward]</h3>
+<a name="20.2.2"></a><h3>20.2.2 forward/move helpers [forward]</h3>
 <p>Change the definitions of <code>forward</code> and
 <code>move</code> as follows:</p>
 
@@ -239,7 +435,7 @@
   <li><i>Returns</i>: <code><ins>static_cast&lt;RvalueOf&lt;T&gt;::type&gt;(</ins>t<ins>)</ins></code></li>
 </ol>
 
-<h3>20.2.3 Pairs [pairs]</h3>
+<a name="20.2.3"></a><h3>20.2.3 Pairs [pairs]</h3>
 <p>Update the declaration of pair's <code>swap</code> as follows:</p>
 
 <pre>
@@ -264,7 +460,7 @@
   <li><i>Effects</i>: <code>x.swap(y)</code></li>
 </ol>
 
-<h3>20.4.2.6 Tuple swap [tuple.swap]</h3>
+<a name="20.4.2.6"></a><h3>20.4.2.6 Tuple swap [tuple.swap]</h3>
 <p>Change the declaration of tuple's <code>swap</code> as follows:</p>
 
 <pre>
@@ -275,7 +471,7 @@
   <li><del><i>Requires</i>: each type in Types shall be Swappable.</del></li>
 </ol>
 
-<h3>20.4.2.7 Tuple specialized algorithms [tuple.special]</h3>
+<a name="20.4.2.7"></a><h3>20.4.2.7 Tuple specialized algorithms [tuple.special]</h3>
 <p>Change the declaration of tuple's <code>swap</code> as follows:</p>
 
 <pre>
@@ -291,7 +487,7 @@
   <li><i>Effects</i>: <code>x.swap(y)</code></li>
 </ol>
 
-<h3>20.6.16.2.2 function modifiers [func.wrap.func.mod]</h3>
+<a name="20.6.16.2.2"></a><h3>20.6.16.2.2 function modifiers [func.wrap.func.mod]</h3>
 <p>Change the declaration of function's <code>swap</code> as
 follows:</p>
 
@@ -303,7 +499,7 @@
   <li><i>Throws</i>: nothing. </li>
 </ol>
 
-<h3>20.7.12.2.5 unique_ptr modifiers [unique.ptr.single.modifiers]</h3>
+<a name="20.7.12.2.5"></a><h3>20.7.12.2.5 unique_ptr modifiers [unique.ptr.single.modifiers]</h3>
 <p>Change the declaration of unique_ptr's <code>swap</code> as
 follows:</p>
 
@@ -316,7 +512,7 @@
 <li><i>Throws</i>: nothing.</li>
 </ol>
 
-<h3>20.7.12.4 unique_ptr specialized algorithms
+<a name="20.7.12.4"></a><h3>20.7.12.4 unique_ptr specialized algorithms
 [unique.ptr.special]</h3>
 <p>Change the declaration of unique_ptr's <code>swap</code> as
 follows:</p>
@@ -330,7 +526,7 @@
   <li>Effects: Calls <code>x.swap(y)</code>.</li>
 </ol>
 
-<h3>20.7.13.2.4 shared_ptr modifiers [util.smartptr.shared.mod]</h3>
+<a name="20.7.13.2.4"></a><h3>20.7.13.2.4 shared_ptr modifiers [util.smartptr.shared.mod]</h3>
 <p>Change the declaration of shared_ptr's <code>swap</code> as
 follows:</p>
 
@@ -342,7 +538,7 @@
   <li><i>Throws</i>: nothing.</li>
 </ol>
 
-<h3>20.7.13.2.9 shared_ptr specialized algorithms
+<a name="20.7.13.2.9"></a><h3>20.7.13.2.9 shared_ptr specialized algorithms
 [util.smartptr.shared.spec]</h3>
 <p>Change the declaration of shared_ptr's <code>swap</code> as
 follows:</p>
@@ -357,7 +553,7 @@
   <li><i>Throws</i>: nothing.</li>
 </ol>
 
-<h3>21.3.6.8 basic_string::swap [string::swap]</h3>
+<a name="string::swap"></a><h3>21.3.6.8 basic_string::swap [string::swap]</h3>
 <p>Change the declaration of basic_string's <code>swap</code> as follows:</p>
 
 <pre>
@@ -370,7 +566,7 @@
   <li><i>Complexity</i>: constant time.</li>
 </ol>
 
-<h3>21.3.8.8 swap [string.special]</h3>
+<a name="string.special"></a><h3>21.3.8.8 swap [string.special]</h3>
 <p>Change the declaration of basic_string's <code>swap</code> as follows:</p>
 
 <pre>
@@ -388,7 +584,7 @@
   <li><i>Effects</i>: <code>lhs.swap(rhs);</code></li>
 </ol>
 
-<h3>21.3.8.9 Inserters and extractors [string.io]</h3>
+<a name="string.io"></a><h3>21.3.8.9 Inserters and extractors [string.io]</h3>
 <p>Change the declaration of basic_string's <code>operator&gt;&gt;</code> as follows:</p>
 
 <pre>
@@ -407,14 +603,33 @@
                const basic_string&lt;charT,traits,Allocator&gt;&amp; str);
 </pre>
 
-<h3>23.2.2 Class template deque [deque]</h3>
+<p>Change the declaration of basic_string's <code>getline</code> prior to paragraph 7 as follows:</p>
+
+<pre>
+template&lt;class charT, class traits, class Allocator&gt;
+ basic_istream&lt;charT,traits&gt;&amp;
+ getline(basic_istream&lt;charT,traits&gt;&amp;<del>&amp;</del> is,
+ basic_string&lt;charT,traits,Allocator&gt;&amp; str,
+ charT delim);
+</pre>
+
+<p>Change the declaration of basic_string's <code>getline</code> prior to paragraph 11 as follows:</p>
+
+<pre>
+template&lt;class charT, class traits, class Allocator&gt;
+ basic_istream&lt;charT,traits&gt;&amp;
+ getline(basic_istream&lt;charT,traits&gt;&amp;<del>&amp;</del> is,
+ basic_string&lt;charT,traits,Allocator&gt;&amp; str)
+</pre>
+
+<a name="deque"></a><h3>23.2.2 Class template deque [deque]</h3>
 <p>Change the declaration of deque's <code>swap</code> as follows:</p>
 
 <pre>
 void swap(deque&lt;T,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.2.2.4 deque specialized algorithms [deque.special]</h3>
+<a name="deque.special"></a><h3>23.2.2.4 deque specialized algorithms [deque.special]</h3>
 <p>Change the declaration of deque's <code>swap</code> as follows:</p>
 
 <pre>
@@ -429,14 +644,14 @@
   <li><i>Effects</i>: <code>x.swap(y);</code></li>
 </ol>
 
-<h3>23.2.3 Class template forward_list [forwardlist]</h3>
+<a name="forwardlist"></a><h3>23.2.3 Class template forward_list [forwardlist]</h3>
 <p>Change the declaration of forward_list's <code>swap</code> as follows:</p>
 
 <pre>
 void swap(forward_list&lt;T,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.2.3.6 forward_list specialized algorithms
+<a name="forwardlist.spec"></a><h3>23.2.3.6 forward_list specialized algorithms
 [forwardlist.spec]</h3>
 <p>Change the declaration of forward_list's <code>swap</code> as follows:</p>
 
@@ -452,14 +667,14 @@
   <li><i>Effects</i>: x.swap(y) </li>
 </ol>
 
-<h3>23.2.4 Class template list [list]</h3>
+<a name="list"></a><h3>23.2.4 Class template list [list]</h3>
 <p>Change the declaration of list's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(list&lt;T,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.2.4.5 list specialized algorithms [list.special]</h3>
+<a name="list.special"></a><h3>23.2.4.5 list specialized algorithms [list.special]</h3>
 <p>Change the declaration of list's <code>swap</code> as follows:</p>
 
 <pre>
@@ -474,14 +689,14 @@
   <li><i>Effects:</i> x.swap(y); </li>
 </ol>
 
-<h3>23.2.5.1.1 queue definition [queue.defn]</h3>
+<a name="queue.defn"></a><h3>23.2.5.1.1 queue definition [queue.defn]</h3>
 <p>Change the definition of queue's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(queue&amp;<del>&amp;</del> q) { swap(c, q.c); }
 </pre>
 
-<h3>23.2.5.1.3 queue specialized algorithms [queue.special]</h3>
+<a name="queue.special"></a><h3>23.2.5.1.3 queue specialized algorithms [queue.special]</h3>
 <p>Change the declaration of queue's <code>swap</code> as follows:</p>
 
 <pre>
@@ -497,7 +712,7 @@
   <li><i>Effects</i>: x.swap(y).</li>
 </ol>
 
-<h3>23.2.5.2 Class template priority_queue [priority.queue]</h3>
+<a name="priority.queue"></a><h3>23.2.5.2 Class template priority_queue [priority.queue]</h3>
 <p>Change the declaration of priority_queue's <code>swap</code> as follows:</p>
 
 <pre>
@@ -505,7 +720,7 @@
   void swap(priority_queue&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.2.5.2.3 priority_queue specialized algorithms [priqueue.special]</h3>
+<a name="priqueue.special"></a><h3>23.2.5.2.3 priority_queue specialized algorithms [priqueue.special]</h3>
 <p>Change the declaration of priority_queue's <code>swap</code> as follows:</p>
 
 <pre>
@@ -521,7 +736,7 @@
   <li><i>Effects</i>: x.swap(y).</li>
 </ol>
 
-<h3>23.2.5.3.1 stack definition [stack.defn]</h3>
+<a name="stack.defn"></a><h3>23.2.5.3.1 stack definition [stack.defn]</h3>
 <p>Change the definition of stack's <code>swap</code> as follows:</p>
 
 <pre>
@@ -529,7 +744,7 @@
   void swap(stack&amp;<del>&amp;</del> s) { swap(c, s.c); }
 </pre>
 
-<h3>23.2.5.3.3 stack specialized algorithms [stack.special]</h3>
+<a name="stack.special"></a><h3>23.2.5.3.3 stack specialized algorithms [stack.special]</h3>
 
 <pre>
 template &lt;ObjectType T, Swappable Cont&gt;
@@ -543,21 +758,21 @@
   <li><i>Effects</i>: x.swap(y).</li>
 </ol>
 
-<h3>23.2.6 Class template vector [vector]</h3>
+<a name="vector"></a><h3>23.2.6 Class template vector [vector]</h3>
 <p>Change the declaration of vector's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(vector&lt;T,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.2.6.2 vector capacity [vector.capacity]</h3>
+<a name="vector.capacity"></a><h3>23.2.6.2 vector capacity [vector.capacity]</h3>
 <p>Modify the declaration of vector's <code>swap</code> prior to paragraph 8 as follows:</p>
 
 <pre>
   void swap(vector&lt;T,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.2.6.5 vector specialized algorithms [vector.special]</h3>
+<a name="vector.special"></a><h3>23.2.6.5 vector specialized algorithms [vector.special]</h3>
 <p>Change the declaration of vector's <code>swap</code> as follows:</p>
 
 <pre>
@@ -573,21 +788,21 @@
   <li>Effects: x.swap(y);</li>
 </ol>
 
-<h3>23.2.7 Class vector&lt;bool&gt; [vector.bool]</h3>
+<a name="vector.bool"></a><h3>23.2.7 Class vector&lt;bool&gt; [vector.bool]</h3>
 <p>Change the declaration of vector&lt;bool&gt;'s <code>swap</code> as follows:</p>
 
 <pre>
 void swap(vector&lt;bool,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.3.1 Class template map [map]</h3>
+<a name="map"></a><h3>23.3.1 Class template map [map]</h3>
 <p>Change the declaration of map's <code>swap</code> as follows:</p>
 
 <pre>
 void swap(map&lt;Key,T,Compare,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.3.1.5 map specialized algorithms [map.special]</h3>
+<a name="map.special"></a><h3>23.3.1.5 map specialized algorithms [map.special]</h3>
 <p>Remove map's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -602,14 +817,14 @@
             <del>map&lt;Key,T,Compare,Alloc&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>23.3.2 Class template multimap [multimap]</h3>
+<a name="multimap"></a><h3>23.3.2 Class template multimap [multimap]</h3>
 <p>Change the declaration of multimap's <code>swap</code> as follows:</p>
 
 <pre>
 void swap(multimap&lt;Key,T,Compare,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.3.2.4 multimap specialized algorithms [multimap.special]</h3>
+<a name="multimap.special"></a><h3>23.3.2.4 multimap specialized algorithms [multimap.special]</h3>
 <p>Remove multimap's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -624,14 +839,14 @@
             <del>multimap&lt;Key,T,Compare,Alloc&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>23.3.3 Class template set [set]</h3>
+<a name="set"></a><h3>23.3.3 Class template set [set]</h3>
 <p>Change the declaration of set's <code>swap</code> as follows:</p>
 
 <pre>
 void swap(set&lt;Key,T,Compare,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.3.3.2 set specialized algorithms [set.special]</h3>
+<a name="set.special"></a><h3>23.3.3.2 set specialized algorithms [set.special]</h3>
 <p>Remove set's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -646,14 +861,14 @@
             <del>set&lt;Key,T,Compare,Alloc&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>23.3.4 Class template multiset [multiset]</h3>
+<a name="multiset"></a><h3>23.3.4 Class template multiset [multiset]</h3>
 <p>Change the declaration of multiset's <code>swap</code> as follows:</p>
 
 <pre>
 void swap(multiset&lt;Key,T,Compare,Alloc&gt;&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.3.4.2 multiset specialized algorithms [multiset.special]</h3>
+<a name="multiset.special"></a><h3>23.3.4.2 multiset specialized algorithms [multiset.special]</h3>
 <p>Remove multiset's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -668,14 +883,14 @@
             <del>multiset&lt;Key,T,Compare,Alloc&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>23.4.1 Class template unordered_map [unord.map]</h3>
+<a name="unord.map"></a><h3>23.4.1 Class template unordered_map [unord.map]</h3>
 <p>Change the declaration of unordered_map's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(unordered_map&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.4.1.3 unordered_map swap [unord.map.swap]</h3>
+<a name="unord.map.swap"></a><h3>23.4.1.3 unordered_map swap [unord.map.swap]</h3>
 <p>Remove unordered_map's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -690,14 +905,14 @@
             <del>unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y);</del>
 </pre>
 
-<h3>23.4.2 Class template unordered_multimap [unord.multimap]</h3>
+<a name="unord.multimap"></a><h3>23.4.2 Class template unordered_multimap [unord.multimap]</h3>
 <p>Change the declaration of unordered_multimap's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(unordered_multimap&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.4.2.2 unordered_multimap swap [unord.multimap.swap]</h3>
+<a name="unord.multimap.swap"></a><h3>23.4.2.2 unordered_multimap swap [unord.multimap.swap]</h3>
 <p>Remove unordered_multimap's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -712,14 +927,14 @@
             <del>unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y);</del>
 </pre>
 
-<h3>23.4.3 Class template unordered_set [unord.set]</h3>
+<a name="unord.set"></a><h3>23.4.3 Class template unordered_set [unord.set]</h3>
 <p>Change the declaration of unordered_set's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(unordered_set&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.4.3.2 unordered_set swap [unord.set.swap]</h3>
+<a name="unord.set.swap"></a><h3>23.4.3.2 unordered_set swap [unord.set.swap]</h3>
 <p>Remove unordered_set's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -734,14 +949,14 @@
             <del>unordered_set&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y);</del>
 </pre>
 
-<h3>23.4.4 Class template unordered_multiset [unord.multiset]</h3>
+<a name="unord.multiset"></a><h3>23.4.4 Class template unordered_multiset [unord.multiset]</h3>
 <p>Change the declaration of unordered_multiset's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(unordered_multiset&amp;<del>&amp;</del>);
 </pre>
 
-<h3>23.4.4.2 unordered_multiset swap [unord.multiset.swap]</h3>
+<a name="unord.multiset.swap"></a><h3>23.4.4.2 unordered_multiset swap [unord.multiset.swap]</h3>
 <p>Remove unordered_multiset's <code>swap</code> algorithms that operate on rvalue references:</p>
 
 <pre>
@@ -756,7 +971,7 @@
             <del>unordered_multiset&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y);</del>
 </pre>
 
-<h3>24.1.1 Iterator [iterator.iterators]</h3>
+<a name="iterator.iterators"></a><h3>24.1.1 Iterator [iterator.iterators]</h3>
 <p>Change the iterator concept as follows:</p>
 <pre>
 concept Iterator&lt;typename X&gt; : Semiregular&lt;X&gt; {
@@ -770,21 +985,21 @@
 }
 </pre>
 
-<h3>26.5.2 Class template valarray [template.valarray]</h3>
+<a name="template.valarray"></a><h3>26.5.2 Class template valarray [template.valarray]</h3>
 <p>Change the declaration of valarray's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(valarray&amp;<del>&amp;</del>);
 </pre>
 
-<h3>26.5.2.7 valarray member functions [valarray.members]</h3>
+<a name="valarray.members"></a><h3>26.5.2.7 valarray member functions [valarray.members]</h3>
 <p>Change the declaration of valarray's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(valarray&amp;<del>&amp;</del>);
 </pre>
 
-<h3>26.5.3.4 valarray specialized algorithms [valarray.special]</h3>
+<a name="valarray.special"></a><h3>26.5.3.4 valarray specialized algorithms [valarray.special]</h3>
 <p>Remove valarray's <code>swap</code> specialized algorithms that use rvalue references as follows:</p>
 
 <pre>
@@ -793,42 +1008,93 @@
 <del>template &lt;class T&gt; void swap(valarray&lt;T&gt;&amp; x, valarray&lt;T&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.4.4 Class template basic_ios [ios]</h3>
+<a name="ios"></a><h3>27.4.4 Class template basic_ios [ios]</h3>
 <p>Change the declaration of basic_ios's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_ios&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.4.4.2 Member functions [basic.ios.members]</h3>
+<a name="basic.ios.members"></a><h3>27.4.4.2 Member functions [basic.ios.members]</h3>
 <p>Modify the declaration of basic_ios's <code>swap</code> prior to paragraph 21 as follows:</p>
 
 <pre>
   void swap(basic_ios&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.5.2 Class template basic_streambuf<charT,traits> [streambuf]</h3>
+<a name="streambuf"></a><h3>27.5.2 Class template basic_streambuf<charT,traits> [streambuf]</h3>
 <p>Change the declaration of basic_streambuf's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_streambuf&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.5.2.3.1 Assignment [streambuf.assign]</h3>
+<a name="streambuf.assign"></a><h3>27.5.2.3.1 Assignment [streambuf.assign]</h3>
 <p>Change the declaration of basic_streambuf's <code>swap</code> before paragraph 4 as follows:</p>
 
 <pre>
   void swap(basic_streambuf&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.6.1.1 Class template basic_istream [istream]</h3>
+<a name="iostream.format"></a><h3>27.6 Formatting and manipulators [iostream.format]</h3>
+<p>Modify the header <code>&lt;istream&gt;</code> synopsis as follows:</p>
+
+<pre>
+namespace std {
+ template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
+ class basic_istream;
+
+ typedef basic_istream&lt;char&gt; istream;
+ typedef basic_istream&lt;wchar_t&gt; wistream;
+ template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
+ class basic_iostream;
+ typedef basic_iostream&lt;char&gt; iostream;
+ typedef basic_iostream&lt;wchar_t&gt; wiostream;
+
+ template &lt;class charT, class traits&gt;
+ basic_istream&lt;charT,traits&gt;&amp; ws(basic_istream&lt;charT,traits&gt;&amp; is);
+
+ <ins>template&lt;typename charT, typename traits, typename T&gt;</ins>
+ <ins>basic_istream&lt;charT, traits&gt;&amp;</ins>
+ <ins>operator&gt;&gt;(basic_istream&lt;charT, traits&gt;&amp;&amp; is, T&amp; x);</ins>
+}
+</pre>
+
+<p>Modify the header <code>&lt;ostream&gt;</code> synopsis as follows:</p>
+
+<pre>
+namespace std {
+ template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
+ class basic_ostream;
+ typedef basic_ostream&lt;char&gt; ostream;
+ typedef basic_ostream&lt;wchar_t&gt; wostream;
+
+ template &lt;class charT, class traits&gt;
+ basic_ostream&lt;charT,traits&gt;&amp; endl(basic_ostream&lt;charT,traits&gt;&amp; os);
+ template &lt;class charT, class traits&gt;
+ basic_ostream&lt;charT,traits&gt;&amp; ends(basic_ostream&lt;charT,traits&gt;&amp; os);
+ template &lt;class charT, class traits&gt;
+ basic_ostream&lt;charT,traits&gt;&amp; flush(basic_ostream&lt;charT,traits&gt;&amp; os);
+
+ <ins>template&lt;typename charT, typename traits, typename T&gt;</ins>
+ <ins>basic_ostream&lt;charT, traits&gt;&amp;</ins>
+ <ins>operator&lt;&lt;(basic_ostream&lt;charT, traits&gt;&amp;&amp; os, const T&amp; x);</ins>
+}
+</pre>
+
+<a name="input.streams"></a><h3>27.6.1 Input streams [input.streams]</h3>
+<ol>
+ <li>The header <code>&lt;istream&gt;</code> defines two types and a function signature that control input from a stream buffer <ins>along with a function template that performs extraction from stream rvalues</ins>.</li>
+</ol>
+
+<a name="istream"></a><h3>27.6.1.1 Class template basic_istream [istream]</h3>
 <p>Change the declaration of basic_istream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_istream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.6.1.1.2 Class basic_istream assign and swap [istream.assign]</h3>
+<a name="istream.assign"></a><h3>27.6.1.1.2 Class basic_istream assign and swap [istream.assign]</h3>
 <p>Change the declaration of basic_istream's <code>swap</code> as follows:</p>
 
 <pre>
@@ -846,14 +1112,43 @@
   <del>void swap(basic_istream&lt;charT, traits&gt;&amp; x, basic_istream&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.6.1.5 Class template basic_iostream [iostreamclass]</h3>
+<a name="istream::extrators"></a><h3>27.6.1.2.3 basic_istream::operator&gt;&gt; [istream::extractors]</h3>
+<p>Change the declarations of basic_istream's <code>operator&gt;&gt;</code> prior to paragraph 7 as follows:</p>
+
+<pre>
+template&lt;class charT, class traits&gt;
+ basic_istream&lt;charT,traits&gt;&amp; operator&gt;&gt;(basic_istream&lt;charT,traits&gt;&amp;<del>&amp;</del> in,
+ charT* s);
+template&lt;class traits&gt;
+ basic_istream&lt;char,traits&gt;&amp; operator&gt;&gt;(basic_istream&lt;char,traits&gt;&amp;<del>&amp;</del> in,
+ unsigned char* s);
+template&lt;class traits&gt;
+ basic_istream&lt;char,traits&gt;&amp; operator&gt;&gt;(basic_istream&lt;char,traits&gt;&amp;<del>&amp;</del> in,
+ signed char* s);
+</pre>
+
+<p>Change the declarations of basic_istream's <code>operator&gt;&gt;</code> prior to paragraph 12 as follows:</p>
+
+<pre>
+template&lt;class charT, class traits&gt;
+ basic_istream&lt;charT,traits&gt;&amp; operator&gt;&gt;(basic_istream&lt;charT,traits&gt;&amp;<del>&amp;</del> in,
+ charT&amp; c);
+template&lt;class traits&gt;
+ basic_istream&lt;char,traits&gt;&amp; operator&gt;&gt;(basic_istream&lt;char,traits&gt;&amp;<del>&amp;</del> in,
+ unsigned char&amp; c);
+template&lt;class traits&gt;
+ basic_istream&lt;char,traits&gt;&amp; operator&gt;&gt;(basic_istream&lt;char,traits&gt;&amp;<del>&amp;</del> in,
+ signed char&amp; c);
+</pre>
+
+<a name="iostreamclass"></a><h3>27.6.1.5 Class template basic_iostream [iostreamclass]</h3>
 <p>Change the declaration of basic_iostream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_iostream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.6.1.5.3 basic_iostream assign and swap [iostream.assign]</h3>
+<a name="iostream.assign"></a><h3>27.6.1.5.3 basic_iostream assign and swap [iostream.assign]</h3>
 <p>Change the declaration of basic_iostream's <code>swap</code> prior to paragraph 2 as follows:</p>
 
 <pre>
@@ -871,14 +1166,33 @@
   <del>void swap(basic_iostream&lt;charT, traits&gt;&amp; x, basic_iostream&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.6.2.1 Class template basic_ostream [ostream]</h3>
+<p>Add the following new section:</p>
+
+<a name="istream.rvalue"></a><h3><ins> 27.6.1.6 Rvalue stream extraction [istream.rvalue]</ins></h3>
+<pre>
+<ins>template&lt;typename charT, typename traits, typename T&gt;</ins>
+ <ins>basic_istream&lt;charT, traits&gt;&amp;</ins>
+ <ins>operator&gt;&gt;(basic_istream&lt;charT, traits&gt;&amp;&amp; is, T&amp; x);</ins>
+</pre>
+
+<ol>
+ <li><ins><i>Effects</i>: <code>is &gt;&gt; x</code></ins></li>
+ <li><ins><i>Returns</i>: <code>is</code></ins></li>
+</ol>
+
+<a name="output.streams"></a><h3>27.6.2 Output streams [output.streams]</h3>
+<ol>
+ <li>The header <code>&lt;ostream&gt;</code> defines a type and several function signatures that control output to a stream buffer <ins>along with a function template that performs insertion into stream rvalues</ins>.</li>
+</ol>
+
+<a name="ostream"></a><h3>27.6.2.1 Class template basic_ostream [ostream]</h3>
 <p>Change the declaration of basic_ostream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_ostream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.6.2.3 Class basic_ostream assign and swap [ostream.assign]</h3>
+<a name="ostream.assign"></a><h3>27.6.2.3 Class basic_ostream assign and swap [ostream.assign]</h3>
 <p>Change the declaration of basic_ostream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
 <pre>
@@ -896,7 +1210,7 @@
   <del>void swap(basic_ostream&lt;charT, traits&gt;&amp; x, basic_ostream&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.6.2.6.4 Character inserter function templates [ostream.inserters.character]</h3>
+<a name="ostream.inserters.character"></a><h3>27.6.2.6.4 Character inserter function templates [ostream.inserters.character]</h3>
 <p>Remove the rvalue-reference overloads of <code>basic_ostream</code>'s inserter function templates prior to paragraph 1 as follows:</p>
 
 <pre>
@@ -937,46 +1251,58 @@
 <p>Remove the rvalue-reference overloads of <code>basic_ostream</code>'s inserter function templates prior to paragraph 3 as follows:</p>
 
 <pre>
-template<class charT, class traits>
-basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
-const charT* s);
-template<class charT, class traits>
-basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&& out,
-const charT* s);
-template<class charT, class traits>
-basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
-const char* s);
-template<class charT, class traits>
-basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&& out,
-const char* s);
-template<class traits>
-basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
-const char* s);
-template<class traits>
-basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&& out,
-const char* s);
-template<class traits>
-basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
-const signed char* s);
-template<class traits>
-basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&& out,
-const signed char* s);
-template<class traits>
-basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
-const unsigned char* s);
-template<class traits>
-basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&& out,
-const unsigned char* s);
+template&lt;class charT, class traits&gt;
+ basic_ostream&lt;charT,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;charT,traits&gt;&amp; out,
+ const charT* s);
+<del>template&lt;class charT, class traits&gt;</del>
+ <del>basic_ostream&lt;charT,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;charT,traits&gt;&amp;&amp; out,</del>
+ <del>const charT* s);</del>
+template&lt;class charT, class traits&gt;
+ basic_ostream&lt;charT,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;charT,traits&gt;&amp; out,
+ const char* s);
+<del>template&lt;class charT, class traits&gt;</del>
+ <del>basic_ostream&lt;charT,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;charT,traits&gt;&amp;&amp; out,</del>
+ <del>const char* s);</del>
+template&lt;class traits&gt;
+ basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;char,traits&gt;&amp; out,
+ const char* s);
+<del>template&lt;class traits&gt;</del>
+ <del>basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;char,traits&gt;&amp;&amp; out,</del>
+ <del>const char* s);</del>
+template&lt;class traits&gt;
+ basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;char,traits&gt;&amp; out,
+ const signed char* s);
+<del>template&lt;class traits&gt;</del>
+ <del>basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;char,traits&gt;&amp;&amp; out,</del>
+ <del>const signed char* s);</del>
+template&lt;class traits&gt;
+ basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;char,traits&gt;&amp; out,
+ const unsigned char* s);
+<del>template&lt;class traits&gt;</del>
+ <del>basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;(basic_ostream&lt;char,traits&gt;&amp;&amp; out,</del>
+ <del>const unsigned char* s);</del>
+</pre>
+
+<a name="ostream.rvalue"></a><h3><ins> 27.6.2.9 Rvalue stream insertion [ostream.rvalue]</ins></h3>
+<pre>
+<ins>template&lt;typename charT, typename traits, typename T&gt;</ins>
+ <ins>basic_ostream&lt;charT, traits&gt;&amp;</ins>
+ <ins>operator&lt;&lt;(basic_ostream&lt;charT, traits&gt;&amp;&amp; os, const T&amp; x);</ins>
 </pre>
 
-<h3>27.7.1 Class template basic_stringbuf [stringbuf]</h3>
+<ol>
+ <li><ins><i>Effects</i>: <code>os &lt;&lt; x</code></ins></li>
+ <li><ins><i>Returns</i>: <code>os</code></ins></li>
+</ol>
+
+<a name="stringbuf"></a><h3>27.7.1 Class template basic_stringbuf [stringbuf]</h3>
 <p>Change the declaration of basic_stringbuf's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_stringbuf&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.7.1.2 Assign and swap [stringbuf.assign]</h3>
+<a name="stringbuf.assign"></a><h3>27.7.1.2 Assign and swap [stringbuf.assign]</h3>
 <p>Change the declaration of basic_stringbuf's <code>swap</code> prior to paragraph 3 as follows:</p>
 
 <pre>
@@ -997,14 +1323,14 @@
             <del>basic_stringbuf&lt;charT, traits, Allocator&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.7.2 Class template basic_istringstream [istringstream]</h3>
+<a name="istringstream"></a><h3>27.7.2 Class template basic_istringstream [istringstream]</h3>
 <p>Change the declaration of basic_istringstream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_istringstream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.7.2.2 Assign and swap [istringstream.assign]</h3>
+<a name="istringstream.assign"></a><h3>27.7.2.2 Assign and swap [istringstream.assign]</h3>
 
 <p>Change the declaration of basic_istringstream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
@@ -1026,14 +1352,14 @@
             <del>basic_istringstream&lt;charT, traits, Allocator&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.7.3 Class template basic_ostringstream [ostringstream]</h3>
+<a name="ostringstream"></a><h3>27.7.3 Class template basic_ostringstream [ostringstream]</h3>
 <p>Change the declaration of basic_ostringstream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_ostringstream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.7.3.2 Assign and swap [ostringstream.assign]</h3>
+<a name="ostringstream.assign"></a><h3>27.7.3.2 Assign and swap [ostringstream.assign]</h3>
 
 <p>Change the declaration of basic_ostringstream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
@@ -1055,14 +1381,14 @@
             <del>basic_ostringstream&lt;charT, traits, Allocator&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.7.4 Class template basic_stringstream [stringstream]</h3>
+<a name="stringstream"></a><h3>27.7.4 Class template basic_stringstream [stringstream]</h3>
 <p>Change the declaration of basic_stringstream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_stringstream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.7.4.2 Assign and swap [stringstream.assign]</h3>
+<a name="stringstream.assign"></a><h3>27.7.4.2 Assign and swap [stringstream.assign]</h3>
 
 <p>Change the declaration of basic_stringstream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
@@ -1084,14 +1410,14 @@
             <del>basic_stringstream&lt;charT, traits, Allocator&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.8.1.1 Class template basic_filebuf [filebuf]</h3>
+<a name="filebuf"></a><h3>27.8.1.1 Class template basic_filebuf [filebuf]</h3>
 <p>Change the declaration of basic_filebuf's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_filebuf&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.8.1.3 Assign and swap [filebuf.assign]</h3>
+<a name="filebuf.assign"></a><h3>27.8.1.3 Assign and swap [filebuf.assign]</h3>
 <p>Change the declaration of basic_filebuf's <code>swap</code> prior to paragraph 3 as follows:</p>
 
 <pre>
@@ -1112,14 +1438,14 @@
             <del>basic_filebuf&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.8.1.6 Class template basic_ifstream [ifstream]</h3>
+<a name="ifstream"></a><h3>27.8.1.6 Class template basic_ifstream [ifstream]</h3>
 <p>Change the declaration of basic_ifstream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_ifstream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.8.1.8 Assign and swap [ifstream.assign]</h3>
+<a name="ifstream.assign"></a><h3>27.8.1.8 Assign and swap [ifstream.assign]</h3>
 <p>Change the declaration of basic_ifstream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
 <pre>
@@ -1140,14 +1466,14 @@
             <del>basic_ifstream&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.8.1.10 Class template basic_ofstream [ofstream]</h3>
+<a name="ofstream"></a><h3>27.8.1.10 Class template basic_ofstream [ofstream]</h3>
 <p>Change the declaration of basic_ofstream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_ofstream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.8.1.12 Assign and swap [ofstream.assign]</h3>
+<a name="ofstream.assign"></a><h3>27.8.1.12 Assign and swap [ofstream.assign]</h3>
 <p>Change the declaration of basic_ofstream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
 <pre>
@@ -1168,14 +1494,14 @@
             <del>basic_ofstream&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>27.8.1.14 Class template basic_fstream [fstream]</h3>
+<a name="fstream"></a><h3>27.8.1.14 Class template basic_fstream [fstream]</h3>
 <p>Change the declaration of basic_fstream's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(basic_fstream&amp;<del>&amp;</del> rhs);
 </pre>
 
-<h3>27.8.1.16 Assign and swap [fstream.assign]</h3>
+<a name="fstream.assign"></a><h3>27.8.1.16 Assign and swap [fstream.assign]</h3>
 <p>Change the declaration of basic_fstream's <code>swap</code> prior to paragraph 3 as follows:</p>
 
 <pre>
@@ -1196,21 +1522,30 @@
             <del>basic_fstream&lt;charT, traits&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>30.2.1 Class thread [thread.thread.class]</h3>
+<a name="thread.thread.class"></a><h3>30.2.1 Class thread [thread.thread.class]</h3>
 <p>Change the declaration of thread's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(thread&amp;<del>&amp;</del>);
 </pre>
 
-<h3>30.2.1.5 thread members [thread.thread.member]</h3>
+<a name="thread.thread.id"></a><h3>30.2.1.1 Class thread::id [thread.thread.id]</h3>
+<p>Change the declaration of thread's <code>operator&lt;&lt;</code> prior to paragraph 18 as follows:</p>
+
+<pre>
+template&lt;class charT, class traits&gt;
+ basic_ostream&lt;charT, traits&gt;&amp;
+ operator&lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp;<del>&amp;</del> out, thread::id id);
+</pre>
+
+<a name="thread.thread.member"></a><h3>30.2.1.5 thread members [thread.thread.member]</h3>
 <p>Change the declaration of thread's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(thread&amp;<del>&amp;</del>);
 </pre>
 
-<h3>30.2.1.7 thread specialized algorithms [thread.thread.algorithm]</h3>
+<a name="thread.thread.algorithm"></a><h3>30.2.1.7 thread specialized algorithms [thread.thread.algorithm]</h3>
 <p>Remove the rvalue-reference overloads of thread's <code>swap</code> as follows:</p>
 
 <pre>
@@ -1219,14 +1554,14 @@
 <del>void swap(thread&amp; x, thread&amp;&amp; y);</del>
 </pre>
 
-<h3>30.3.3.2 Class template unique_lock [thread.lock.unique]</h3>
+<a name="thread.lock.unique"></a><h3>30.3.3.2 Class template unique_lock [thread.lock.unique]</h3>
 <p>Change the declaration of unique_lock's <code>swap</code> as follows:</p>
 
 <pre>
   void swap(unique_lock&amp;<del>&amp;</del> u);
 </pre>
 
-<h3>30.3.3.2.3 unique_lock modifiers [thread.lock.unique.mod]</h3>
+<a name="thread.lock.unique.mod"></a><h3>30.3.3.2.3 unique_lock modifiers [thread.lock.unique.mod]</h3>
 <p>Change the declaration of unique_lock's <code>swap</code> as follows:</p>
 
 <pre>
@@ -1244,7 +1579,7 @@
   <del>void swap(unique_lock&lt;Mutex&gt;&amp; x, unique_lock&lt;Mutex&gt;&amp;&amp; y);</del>
 </pre>
 
-<h3>30.5.8 Class template packaged_task [futures.task]</h3>
+<a name="futures.task"></a><h3>30.5.8 Class template packaged_task [futures.task]</h3>
 <p>Change the declaration of packaged_task's <code>swap</code> as follows:</p>
 
 <pre>
@@ -1253,5 +1588,5 @@
 
 <hr>
 <address></address>
-<!-- hhmts start --> Last modified: Sat Feb 7 22:15:10 PST 2009 <!-- hhmts end -->
+<!-- hhmts start --> Last modified: Sun Feb 8 14:17:51 PST 2009 <!-- hhmts end -->
 </body> </html>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk