<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Move It With Rvalue&#160;References</title>
	<atom:link href="http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/feed/" rel="self" type="application/rss+xml" />
	<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/</link>
	<description>The next generation of C++</description>
	<lastBuildDate>Mon, 30 Apr 2012 15:07:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Lvalues, rvalues and references &#124; Andrzej&#039;s C++ blog</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1747</link>
		<dc:creator>Lvalues, rvalues and references &#124; Andrzej&#039;s C++ blog</dc:creator>
		<pubDate>Wed, 09 Nov 2011 22:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1747</guid>
		<description>&lt;p&gt;[...] will be read once, and they will be destroyed. This is a very useful observation in implementing move semantics. Since the temporary will not be inspected after its value is read, we can cheat while reading, and [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] will be read once, and they will be destroyed. This is a very useful observation in implementing move semantics. Since the temporary will not be inspected after its value is read, we can cheat while reading, and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Move Constructor &#124; Andrzej&#039;s C++ blog</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1242</link>
		<dc:creator>Move Constructor &#124; Andrzej&#039;s C++ blog</dc:creator>
		<pubDate>Thu, 11 Aug 2011 21:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1242</guid>
		<description>&lt;p&gt;[...] couple of new compilers and have been well described in a number of articles, e.g. by Danny Kalev, Dave Abrahams, and Howard E. Hinnant, Bjarne Stroustrup &amp; Bronek Kozicki. In this post I try to describe only [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] couple of new compilers and have been well described in a number of articles, e.g. by Danny Kalev, Dave Abrahams, and Howard E. Hinnant, Bjarne Stroustrup &amp; Bronek Kozicki. In this post I try to describe only [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaisha</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1230</link>
		<dc:creator>Kaisha</dc:creator>
		<pubDate>Wed, 27 Jul 2011 16:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1230</guid>
		<description>&lt;p&gt;Yes, thank-you, looks good to me.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, thank-you, looks good to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1229</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Wed, 27 Jul 2011 15:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1229</guid>
		<description>&lt;p&gt;I made the corrections directly, for you.  Please check that they&#039;re OK&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I made the corrections directly, for you.  Please check that they&#8217;re OK</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaisha</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1223</link>
		<dc:creator>Kaisha</dc:creator>
		<pubDate>Tue, 26 Jul 2011 18:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1223</guid>
		<description>&lt;p&gt;Sorry, messed up the formatting, the above code sections should read:&lt;/p&gt;

&lt;pre&gt;&#160;
int a = 5; 
float b = 10.0f; 
obj &lt;&lt; Message&#040;a,b&#041;;
&#160;
...
&#160;
template &lt;typename T1, typename T1, ... , typename TN&gt; Data&lt;T0,T1, … , TN&gt; Message &#040;const T0&amp; p0, const T1&amp; p1, … , const TN&amp; pN&#041; &#123; … &#125;
&#160;
...
&#160;
auto MessageSomethingOrAnother = Message&lt;int,float,Obj*&gt;; 
obj &lt;&lt; MessageSomethingOrAnother&#040;5,6,this&#041;;
&#160;
...
&#160;
obj &lt;&lt; Message&#040;static_cast&lt;int&gt;&#040;5&#041;,static_cast&lt;float&gt;&#040;6&#041;,static_cast&lt;Obj*&gt;&#040;this&#041;&#041;;
&#160;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Sorry, messed up the formatting, the above code sections should read:</p>

<pre>&nbsp;
int a = 5; 
float b = 10.0f; 
obj &lt;&lt; Message&#040;a,b&#041;;
&nbsp;
...
&nbsp;
template &lt;typename T1, typename T1, ... , typename TN&gt; Data&lt;T0,T1, … , TN&gt; Message &#040;const T0&amp; p0, const T1&amp; p1, … , const TN&amp; pN&#041; &#123; … &#125;
&nbsp;
...
&nbsp;
auto MessageSomethingOrAnother = Message&lt;int,float,Obj*&gt;; 
obj &lt;&lt; MessageSomethingOrAnother&#040;5,6,this&#041;;
&nbsp;
...
&nbsp;
obj &lt;&lt; Message&#040;static_cast&lt;int&gt;&#040;5&#041;,static_cast&lt;float&gt;&#040;6&#041;,static_cast&lt;Obj*&gt;&#040;this&#041;&#041;;
&nbsp;</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaisha</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1222</link>
		<dc:creator>Kaisha</dc:creator>
		<pubDate>Tue, 26 Jul 2011 18:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1222</guid>
		<description>&lt;p&gt;I see this is an older thread, but I have a question pertaining to this so we&#039;ll try it here ;)&lt;/p&gt;

&lt;p&gt;I played around with rvalue references a while ago, but only recently tried to integrate them into existing code.  I have a message passing library I&#039;ve used for some time now and thought that move semantics were perfect for it (as it basically just forwards data around).  Unfortunetly I&#039;ve come across a problem.  The library dispatches based on type, so you can do something like:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;int&lt;/span&gt; a &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt; 
&lt;span style=&quot;color: #0000ff;&quot;&gt;float&lt;/span&gt; b &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#800080;&quot;&gt;10.0f&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt; 
obj &lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;&lt;/span&gt; Message&lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;a,b&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It will send the message to the object, which will forward it to obj&#039;s appropriate member function for processing.  And the Message function is similar to what you would expect, something like:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;template&lt;/span&gt; &lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;typename&lt;/span&gt; T1, &lt;span style=&quot;color: #0000ff;&quot;&gt;typename&lt;/span&gt; T1, ... , &lt;span style=&quot;color: #0000ff;&quot;&gt;typename&lt;/span&gt; TN&lt;span style=&quot;color: #000080;&quot;&gt;&gt;&lt;/span&gt;
Data&lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;/span&gt;T0,T1, … , TN&lt;span style=&quot;color: #000080;&quot;&gt;&gt;&lt;/span&gt; 
Message &lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;const&lt;/span&gt; T0&lt;span style=&quot;color: #000040;&quot;&gt;&amp;&lt;/span&gt; p0, &lt;span style=&quot;color: #0000ff;&quot;&gt;const&lt;/span&gt; T1&lt;span style=&quot;color: #000040;&quot;&gt;&amp;&lt;/span&gt; p1, … , &lt;span style=&quot;color: #0000ff;&quot;&gt;const&lt;/span&gt; TN&lt;span style=&quot;color: #000040;&quot;&gt;&amp;&lt;/span&gt; pN&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;&#123;&lt;/span&gt; … &lt;span style=&quot;color: #008000;&quot;&gt;&#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I used the boost pre-processor library to create the N instances (sorry, not trying to bore you guys, just trying to be clear).  Here-in lies the problem, when I&#039;m defining messages, I need to define the type to ensure dispatch is handled on the proper type (ie. like when passing pointers to polymorphic classes).  Now that&#039;s not always the case, but it was the case enough of the time that I defined all the messages like:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;auto&lt;/span&gt; MessageSomethingOrAnother &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; Message&lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;int&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;float&lt;/span&gt;,Obj&lt;span style=&quot;color: #000040;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt; 
obj &lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;&lt;/span&gt; MessageSomethingOrAnother&lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;5&lt;/span&gt;,&lt;span style=&quot;color: #0000dd;&quot;&gt;6&lt;/span&gt;,&lt;span style=&quot;color: #0000dd;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Makes it clear and easy to catch errors.  But now the magical r-value template rules don&#039;t apply, and I can&#039;t make use of move semantics.  In fact (as far as I can tell) I&#039;d require 2^n versions of Message just to handle the situation, which kinda defeats one of the major reasons why move semantics were put in, in the 1st place.  Now of course I could use:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;cpp&quot; style=&quot;font-family:monospace;&quot;&gt;obj &lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;&lt;/span&gt; Message&lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&lt;&lt;/span&gt;Obj&lt;span style=&quot;color: #000040;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#040;&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&#041;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But that&#039;s certainly harder to work with.  Am I missing something here (and I apoligize if I am, I&#039;m certainly no guru)?  Is there a way to have perfect forwarding without requiring all the template parameters of a function to be automatically deduced?  This seems like a bit of an oversight to me.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I see this is an older thread, but I have a question pertaining to this so we&#8217;ll try it here <img src='http://cpp-next.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<p>I played around with rvalue references a while ago, but only recently tried to integrate them into existing code.  I have a message passing library I&#8217;ve used for some time now and thought that move semantics were perfect for it (as it basically just forwards data around).  Unfortunetly I&#8217;ve come across a problem.  The library dispatches based on type, so you can do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">int</span> a <span style="color: #000080;">=</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span> 
<span style="color: #0000ff;">float</span> b <span style="color: #000080;">=</span> <span style="color:#800080;">10.0f</span><span style="color: #008080;">;</span> 
obj <span style="color: #000080;">&lt;&lt;</span> Message<span style="color: #008000;">&#40;</span>a,b<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>It will send the message to the object, which will forward it to obj&#8217;s appropriate member function for processing.  And the Message function is similar to what you would expect, something like:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">template</span> <span style="color: #000080;">&lt;</span><span style="color: #0000ff;">typename</span> T1, <span style="color: #0000ff;">typename</span> T1, ... , <span style="color: #0000ff;">typename</span> TN<span style="color: #000080;">&gt;</span>
Data<span style="color: #000080;">&lt;</span>T0,T1, … , TN<span style="color: #000080;">&gt;</span> 
Message <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> T0<span style="color: #000040;">&amp;</span> p0, <span style="color: #0000ff;">const</span> T1<span style="color: #000040;">&amp;</span> p1, … , <span style="color: #0000ff;">const</span> TN<span style="color: #000040;">&amp;</span> pN<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> … <span style="color: #008000;">&#125;</span></pre></div></div>

<p>I used the boost pre-processor library to create the N instances (sorry, not trying to bore you guys, just trying to be clear).  Here-in lies the problem, when I&#8217;m defining messages, I need to define the type to ensure dispatch is handled on the proper type (ie. like when passing pointers to polymorphic classes).  Now that&#8217;s not always the case, but it was the case enough of the time that I defined all the messages like:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">auto</span> MessageSomethingOrAnother <span style="color: #000080;">=</span> Message<span style="color: #000080;">&lt;</span><span style="color: #0000ff;">int</span>,<span style="color: #0000ff;">float</span>,Obj<span style="color: #000040;">*</span><span style="color: #000080;">&gt;</span><span style="color: #008080;">;</span> 
obj <span style="color: #000080;">&lt;&lt;</span> MessageSomethingOrAnother<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">5</span>,<span style="color: #0000dd;">6</span>,<span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Makes it clear and easy to catch errors.  But now the magical r-value template rules don&#8217;t apply, and I can&#8217;t make use of move semantics.  In fact (as far as I can tell) I&#8217;d require 2^n versions of Message just to handle the situation, which kinda defeats one of the major reasons why move semantics were put in, in the 1st place.  Now of course I could use:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">obj <span style="color: #000080;">&lt;&lt;</span> Message<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">static_cast</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">int</span><span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">5</span><span style="color: #008000;">&#41;</span>,<span style="color: #0000ff;">static_cast</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">float</span><span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">6</span><span style="color: #008000;">&#41;</span>,<span style="color: #0000ff;">static_cast</span><span style="color: #000080;">&lt;</span>Obj<span style="color: #000040;">*</span><span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>But that&#8217;s certainly harder to work with.  Am I missing something here (and I apoligize if I am, I&#8217;m certainly no guru)?  Is there a way to have perfect forwarding without requiring all the template parameters of a function to be automatically deduced?  This seems like a bit of an oversight to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Unique and shared ownership &#124; Andrzej&#039;s C++ blog</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-1114</link>
		<dc:creator>Unique and shared ownership &#124; Andrzej&#039;s C++ blog</dc:creator>
		<pubDate>Mon, 27 Jun 2011 22:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-1114</guid>
		<description>&lt;p&gt;[...] not have enough room to describe this concept, but it has been well described by many authors (see here and here). In short, this is how it works. You need your object to be able to store a null state, a [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] not have enough room to describe this concept, but it has been well described by many authors (see here and here). In short, this is how it works. You need your object to be able to store a null state, a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-179</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Sat, 20 Nov 2010 23:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-179</guid>
		<description>&lt;p&gt;You&#039;re missing the subtlety of the template argument deduction and reference-collapsing rules we describe &lt;a href=&quot;http://cpp-next.com/archive/2009/12/onward-forward/&quot; rel=&quot;nofollow&quot;&gt;in a later article&lt;/a&gt;.  Only rvalues can bind to rvalue references, but when the argument is an lvalue, &lt;code&gt;T&lt;/code&gt; is deduced to be &lt;code&gt;U&amp;&lt;/code&gt; and &lt;code&gt;T&amp;&amp;&lt;/code&gt; is therefore also equivalent to &lt;code&gt;U&amp;&lt;/code&gt;, i.e. it is an lvalue reference.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You&#8217;re missing the subtlety of the template argument deduction and reference-collapsing rules we describe <a href="http://cpp-next.com/archive/2009/12/onward-forward/" rel="nofollow">in a later article</a>.  Only rvalues can bind to rvalue references, but when the argument is an lvalue, <code>T</code> is deduced to be <code>U&amp;</code> and <code>T&amp;&amp;</code> is therefore also equivalent to <code>U&amp;</code>, i.e. it is an lvalue reference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-178</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Thu, 18 Nov 2010 20:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-178</guid>
		<description>&lt;p&gt;There is a subtlety that confuses me: in &lt;a href=&quot;http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2812.html&quot; rel=&quot;nofollow&quot;&gt;N2812&lt;/a&gt;, and in gcc implementation, the function move is defined as:&lt;/p&gt;

&lt;pre&gt;template&lt;typename _Tp&gt;
    inline typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;
    move&#040;_Tp&amp;&amp; __t&#041;
    &#123; return static_cast&lt;typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;&gt;&#040;__t&#041;; &#125;&lt;/pre&gt;

&lt;p&gt;However, as far as I understand, the whole point of N2812 is that only rvalues should bind to T&amp;&amp;. Then only rvalues will bind to std::move(T&amp;&amp;) as declared above. But if std::move can only be passed rvalues, what&#039;s the point of calling it in the first place ?!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>There is a subtlety that confuses me: in <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2812.html" rel="nofollow">N2812</a>, and in gcc implementation, the function move is defined as:</p>

<pre>template&lt;typename _Tp&gt;
    inline typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;
    move&#040;_Tp&amp;&amp; __t&#041;
    &#123; return static_cast&lt;typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;&gt;&#040;__t&#041;; &#125;</pre>

<p>However, as far as I understand, the whole point of N2812 is that only rvalues should bind to T&amp;&amp;. Then only rvalues will bind to std::move(T&amp;&amp;) as declared above. But if std::move can only be passed rvalues, what&#8217;s the point of calling it in the first place ?!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Watanabe</title>
		<link>http://cpp-next.com/archive/2009/09/move-it-with-rvalue-references/comment-page-1/#comment-177</link>
		<dc:creator>Steven Watanabe</dc:creator>
		<pubDate>Wed, 28 Oct 2009 03:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=366#comment-177</guid>
		<description>&lt;p&gt;Fixed.  Thanks for pointing it out.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Fixed.  Thanks for pointing it out.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

