Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51125 - sandbox/committee/rvalue_ref
From: dgregor_at_[hidden]
Date: 2009-02-08 22:59:34


Author: dgregor
Date: 2009-02-08 22:59:33 EST (Sun, 08 Feb 2009)
New Revision: 51125
URL: http://svn.boost.org/trac/boost/changeset/51125

Log:
Address some comments from Howard
Text files modified:
   sandbox/committee/rvalue_ref/N2831_fixing_rvalue_refs.html | 53 ++++++++++++++++++++++++++++++++-------
   1 files changed, 43 insertions(+), 10 deletions(-)

Modified: sandbox/committee/rvalue_ref/N2831_fixing_rvalue_refs.html
==============================================================================
--- sandbox/committee/rvalue_ref/N2831_fixing_rvalue_refs.html (original)
+++ sandbox/committee/rvalue_ref/N2831_fixing_rvalue_refs.html 2009-02-08 22:59:33 EST (Sun, 08 Feb 2009)
@@ -96,6 +96,8 @@
 <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>24.4.3.2.4 move_iterator::operator* [move.iter.op.star]</li>
+<li>24.4.3.2.12 move_iterator::operator[] [move.iter.op.index]</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>
@@ -219,7 +221,7 @@
 
   <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>
+ <li>Split the two <code>getline</code> functions into four functions to support both lvalue and rvalue streams.</li>
 </ul>
 
 <a name="implementation"></a><h2>Implementation Experience</h2>
@@ -417,8 +419,9 @@
 
 <pre>
   template &lt;IdentityOf T&gt; <ins>requires !LvalueReference&lt;T&gt;</ins>
- T&amp;&amp; forward(IdentityOf&lt;T&gt;::type&amp;&amp; t);
- <ins>template &lt;IdentityOf T&gt; T&amp; forward(IdentityOf&lt;T&gt;::type&amp; t);</ins>
+ T&amp;&amp; forward(IdentityOf&lt;T&gt;::type&amp; t);
+ <ins>template &lt;IdentityOf T&gt; requires LvalueReference&lt;T&gt;</ins>
+ <ins>T&amp; forward(IdentityOf&lt;T&gt;::type&amp; t);</ins>
 
 </pre>
 
@@ -603,23 +606,32 @@
                const basic_string&lt;charT,traits,Allocator&gt;&amp; str);
 </pre>
 
-<p>Change the declaration of basic_string's <code>getline</code> prior to paragraph 7 as follows:</p>
+<p>Add a second declaration of basic_string's <code>getline</code> prior to paragraph 7 as follows:</p>
 
 <pre>
+<ins>template&lt;class charT, class traits, class Allocator&gt;</ins>
+ <ins>basic_istream&lt;charT,traits&gt;&amp;</ins>
+ <ins>getline(basic_istream&lt;charT,traits&gt;&amp; is,</ins>
+ <ins>basic_string&lt;charT,traits,Allocator&gt;&amp; str,</ins>
+ <ins>charT delim);</ins>
 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,
+ getline(basic_istream&lt;charT,traits&gt;&amp;&amp; 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>
+<p>Add a second declaration of basic_string's <code>getline</code> prior to paragraph 11 as follows:</p>
 
 <pre>
+<ins>template&lt;class charT, class traits, class Allocator&gt;</ins>
+ <ins>basic_istream&lt;charT,traits&gt;&amp;</ins>
+ <ins>getline(basic_istream&lt;charT,traits&gt;&amp; is,</ins>
+ <ins>basic_string&lt;charT,traits,Allocator&gt;&amp; str);</ins>
 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)
+ getline(basic_istream&lt;charT,traits&gt;&amp;&amp; is,
+ basic_string&lt;charT,traits,Allocator&gt;&amp; str);
 </pre>
 
 <a name="deque"></a><h3>23.2.2 Class template deque [deque]</h3>
@@ -978,13 +990,34 @@
   MoveConstructible reference = typename X::reference;
   MoveConstructible postincrement_result;
   requires HasDereference&lt;postincrement_result&gt;;
+ <ins>reference operator*(X&amp;);</ins>
   reference operator*(X&amp;&amp;);
- <ins>reference operator*(X&amp;&amp;);</ins>
   X&amp; operator++(X&amp;);
   postincrement_result operator++(X&amp;, int);
 }
 </pre>
 
+<a name="move.iter.op.star"></a><h3>24.4.3.2.4 move_iterator::operator* [move.iter.op.star]</h3>
+
+<pre>
+reference operator*() const;
+</pre>
+
+<ol>
+ <li><i>Returns</i>: <code><ins>std::move(</ins>*current<ins>)</ins></code><del>, implicitly converted to an rvalue reference</del>.</li>
+</ol>
+
+<a name="move.iter.op.index"></a><h3>24.4.3.2.12 move_iterator::operator[] [move.iter.op.index]</h3>
+
+<pre>
+requires RandomAccessIterator<Iter>
+ unspecified operator[](difference_type n) const;
+</pre>
+
+<ol>
+ <li><i>Returns</i>: <code><ins>std::move(</ins>current[n]<ins>)</ins></code><del>, implicitly converted to an rvalue reference</del>.</li>
+</ol>
+
 <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>
 
@@ -1588,5 +1621,5 @@
 
 <hr>
 <address></address>
-<!-- hhmts start --> Last modified: Sun Feb 8 14:17:51 PST 2009 <!-- hhmts end -->
+<!-- hhmts start --> Last modified: Sun Feb 8 19:59:34 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