<?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 for C++Next</title>
	<atom:link href="http://cpp-next.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://cpp-next.com</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>Comment on Implicit Move&#160;Must Go by Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2010/10/implicit-move-must-go/comment-page-1/#comment-1935</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Mon, 30 Apr 2012 15:07:48 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=2711#comment-1935</guid>
		<description>&lt;p&gt;We do have it in C++11.  I don&#039;t think it&#039;ll be changed—the damage has been done; can&#039;t un-ring that bell. I don&#039;t know about the compiler warning; I haven&#039;t seen one&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>We do have it in C++11.  I don&#8217;t think it&#8217;ll be changed—the damage has been done; can&#8217;t un-ring that bell. I don&#8217;t know about the compiler warning; I haven&#8217;t seen one</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Implicit Move&#160;Must Go by Martin Ba</title>
		<link>http://cpp-next.com/archive/2010/10/implicit-move-must-go/comment-page-1/#comment-1934</link>
		<dc:creator>Martin Ba</dc:creator>
		<pubDate>Mon, 30 Apr 2012 06:45:15 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=2711#comment-1934</guid>
		<description>&lt;p&gt;@Dave - Since you linked this example on April 3rd 2012 ... is this still something you think might be changed in a future standard? (I mean, we do have implicit move in the current C++11 now, do we?)&lt;/p&gt;

&lt;p&gt;Has anyone come up with a sane compiler-warning regarding this issue?&lt;/p&gt;

&lt;p&gt;cheers,
Martin&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Dave &#8211; Since you linked this example on April 3rd 2012 &#8230; is this still something you think might be changed in a future standard? (I mean, we do have implicit move in the current C++11 now, do we?)</p>

<p>Has anyone come up with a sane compiler-warning regarding this issue?</p>

<p>cheers,
Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Implicit Move&#160;Must Go by Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2010/10/implicit-move-must-go/comment-page-1/#comment-1926</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Tue, 03 Apr 2012 01:48:05 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=2711#comment-1926</guid>
		<description>&lt;p&gt;Note: real-world manifestation of this issue can be observed at http://j.mp/implicit-move-bites-man&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Note: real-world manifestation of this issue can be observed at <a href="http://j.mp/implicit-move-bites-man" rel="nofollow">http://j.mp/implicit-move-bites-man</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Howard Hinnant</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1925</link>
		<dc:creator>Howard Hinnant</dc:creator>
		<pubDate>Mon, 02 Apr 2012 20:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1925</guid>
		<description>&lt;p&gt;That sounds right.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That sounds right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Andrea</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1924</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Mon, 02 Apr 2012 20:34:51 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1924</guid>
		<description>&lt;p&gt;Howard, thanks for your helpful reply. 
I think I&#039;m getting hold of it now. Can you just confirm my understanding is right when I say that:
When using vectors of object that have &quot;external&quot; resources (i.e. allocate memory on the heap as it is the case for strings), going through the route of invoking their constructor (as when doing ::new(end_) T(v[i]) in the copy constructor loop used when -DUSE_SWAP_ASSIGNMENT) makes you incur in the penalty of allocations even if those are placement news. Instead, the &lt;em&gt;p=&lt;/em&gt;q assignments in the plain old assignment operator&#039;s loop can re-use the already allocated memory on the destination (in particular when as in this case, the destination is a longer string) and make this approach more efficient.
As you suggested, using vectors of int (or I think more generally PODs/aggregate objects) levels out the difference of the two approaches because that extra price during the placement new has not to be payed.&lt;/p&gt;

&lt;p&gt;Andrea&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Howard, thanks for your helpful reply. 
I think I&#8217;m getting hold of it now. Can you just confirm my understanding is right when I say that:
When using vectors of object that have &#8220;external&#8221; resources (i.e. allocate memory on the heap as it is the case for strings), going through the route of invoking their constructor (as when doing ::new(end_) T(v[i]) in the copy constructor loop used when -DUSE_SWAP_ASSIGNMENT) makes you incur in the penalty of allocations even if those are placement news. Instead, the <em>p=</em>q assignments in the plain old assignment operator&#8217;s loop can re-use the already allocated memory on the destination (in particular when as in this case, the destination is a longer string) and make this approach more efficient.
As you suggested, using vectors of int (or I think more generally PODs/aggregate objects) levels out the difference of the two approaches because that extra price during the placement new has not to be payed.</p>

<p>Andrea</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Howard Hinnant</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1923</link>
		<dc:creator>Howard Hinnant</dc:creator>
		<pubDate>Fri, 30 Mar 2012 19:41:05 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1923</guid>
		<description>&lt;p&gt;Think of it this way:  the most efficient way to recycle something is to re-use it.  The copy assignment operator can sometimes re-use memory, instead of deallocating it and then allocating more.  That is what is happening in this example.  One way deallocates memory just to turn around and allocate it back.  The other way holds on to its memory and re-uses it for the new value.  The optimization is to simply avoid calling new/delete as much as you can.&lt;/p&gt;

&lt;p&gt;I imagine the difference you&#039;re seeing with gcc is that they are using a ref-counted string.  Try the experiment again, but using MyVector&lt;std::vector&lt;int&gt;&gt; instead.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Think of it this way:  the most efficient way to recycle something is to re-use it.  The copy assignment operator can sometimes re-use memory, instead of deallocating it and then allocating more.  That is what is happening in this example.  One way deallocates memory just to turn around and allocate it back.  The other way holds on to its memory and re-uses it for the new value.  The optimization is to simply avoid calling new/delete as much as you can.</p>

<p>I imagine the difference you&#8217;re seeing with gcc is that they are using a ref-counted string.  Try the experiment again, but using MyVector&lt;std::vector&lt;int&gt;&gt; instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Andrea</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1922</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Thu, 29 Mar 2012 16:16:50 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1922</guid>
		<description>&lt;p&gt;Wow! Tried to understand what&#039;s going on here...
Am I right in assuming the difference is in the 
::new(end_) T(v[i]) 
copy construction loop in cctor (used when -DUSE_SWAP_ASSIGNMENT) vs the
*p = *q 
assignment loop when using &quot;normal&quot; MyVector&amp; operator=(const MyVector &amp;) ???
But then why such a difference? There&#039;s a placement new up there (i.e. not real memory allocations, only string&#039;s cctor invocation), how can it be that worse than an assignment? I&#039;m sure I&#039;m missing something...
Also, testing on a mac with latest clang from trunk and gcc-4.7 built from sources, I can&#039;t see that timing difference when compiling with g++ -std=c+11. I.e., both old and swap-based assignments time almost the same as clang&#039;s best case. Is the different size of std::string (8 bytes in gnu&#039;s libstdc++ vs 24 bytes in clang&#039;s libc++) the cause of gcc&#039;s insensitivity to the kind of assignment used?&lt;/p&gt;

&lt;p&gt;Andrea&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Wow! Tried to understand what&#8217;s going on here&#8230;
Am I right in assuming the difference is in the 
::new(end_) T(v[i]) 
copy construction loop in cctor (used when -DUSE_SWAP_ASSIGNMENT) vs the
*p = *q 
assignment loop when using &#8220;normal&#8221; MyVector&amp; operator=(const MyVector &amp;) ???
But then why such a difference? There&#8217;s a placement new up there (i.e. not real memory allocations, only string&#8217;s cctor invocation), how can it be that worse than an assignment? I&#8217;m sure I&#8217;m missing something&#8230;
Also, testing on a mac with latest clang from trunk and gcc-4.7 built from sources, I can&#8217;t see that timing difference when compiling with g++ -std=c+11. I.e., both old and swap-based assignments time almost the same as clang&#8217;s best case. Is the different size of std::string (8 bytes in gnu&#8217;s libstdc++ vs 24 bytes in clang&#8217;s libc++) the cause of gcc&#8217;s insensitivity to the kind of assignment used?</p>

<p>Andrea</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Having it all: Pythy syntax for&#160;C++ by Paul</title>
		<link>http://cpp-next.com/archive/2011/11/having-it-all-pythy-syntax/comment-page-1/#comment-1918</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sat, 24 Mar 2012 16:11:51 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=3972#comment-1918</guid>
		<description>&lt;p&gt;I really hope this gets added to C++ soon. This would fix so many problems with lambdas. Currently, lambdas in C++, trap you in a monomorphic box that you can&#039;t get out. So, in C++11, I have to use named functions and Boost.Phoenix, just like I did in C++03.&lt;/p&gt;

&lt;p&gt;I know Bjarne Stroustrup had mentioned adding one new language feature for TR2(which it seems is no longer called TR2). However, polymorphic lambdas is not just a language feature, its more like a &quot;bug&quot; fix. At least, if the committee doesn&#039;t want to add polymorphic lambdas yet, they could at least improve type deduction for lambdas and the use of lambdas as class members, since polymorphic lambdas would open the door to local templates.&lt;/p&gt;

&lt;p&gt;Finally, I think that adding your proposed syntax for functions first, could be a nice transition into polymorphic lambdas.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I really hope this gets added to C++ soon. This would fix so many problems with lambdas. Currently, lambdas in C++, trap you in a monomorphic box that you can&#8217;t get out. So, in C++11, I have to use named functions and Boost.Phoenix, just like I did in C++03.</p>

<p>I know Bjarne Stroustrup had mentioned adding one new language feature for TR2(which it seems is no longer called TR2). However, polymorphic lambdas is not just a language feature, its more like a &#8220;bug&#8221; fix. At least, if the committee doesn&#8217;t want to add polymorphic lambdas yet, they could at least improve type deduction for lambdas and the use of lambdas as class members, since polymorphic lambdas would open the door to local templates.</p>

<p>Finally, I think that adding your proposed syntax for functions first, could be a nice transition into polymorphic lambdas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Implicit Move&#160;Must Go by CM</title>
		<link>http://cpp-next.com/archive/2010/10/implicit-move-must-go/comment-page-1/#comment-1917</link>
		<dc:creator>CM</dc:creator>
		<pubDate>Thu, 22 Mar 2012 16:51:14 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=2711#comment-1917</guid>
		<description>&lt;p&gt;Dave, you do not want to respond? but what about community? I am sure they are looking forward for us to continue... ;-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dave, you do not want to respond? but what about community? I am sure they are looking forward for us to continue&#8230; <img src='http://cpp-next.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Implicit Move&#160;Must Go by Marc</title>
		<link>http://cpp-next.com/archive/2010/10/implicit-move-must-go/comment-page-1/#comment-1916</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Wed, 21 Mar 2012 18:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=2711#comment-1916</guid>
		<description>&lt;blockquote cite=&quot;comment-1914&quot;&gt;

&lt;strong&gt;&lt;a href=&quot;#comment-1914&quot; rel=&quot;nofollow&quot;&gt;CM&lt;/a&gt;&lt;/strong&gt;: 
Can’t believe someone actually reads or tracks comments to 1 year old blog post…  

&lt;/blockquote&gt;

&lt;p&gt;Well, they set up a nice global RSS for the whole site...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<blockquote cite="comment-1914">

<strong><a href="#comment-1914" rel="nofollow">CM</a></strong>: 
Can’t believe someone actually reads or tracks comments to 1 year old blog post…  

</blockquote>

<p>Well, they set up a nice global RSS for the whole site&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

