<?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>Fri, 27 Jan 2012 17:36:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Robert Ramey</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1894</link>
		<dc:creator>Robert Ramey</dc:creator>
		<pubDate>Fri, 27 Jan 2012 17:36:04 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1894</guid>
		<description>&lt;p&gt;This is a great comment.  It well captures the ying/yang of C++ development.&lt;/p&gt;

&lt;p&gt;I think the solution is building applications in layers of abstraction.  This can permit all/most of the issues related to low level optimization to be addressed in lower layers while upper layers and ignore most of this.  This is why I&#039;m a fan of C++.  Unfortunately, I think a lot of programing shops miss and just start coding rather than building applications layer by layer.  Using C++ in this way causes lots of frustration and confusion.&lt;/p&gt;

&lt;p&gt;C++ is a toolbox for making other toolboxes.&lt;/p&gt;

&lt;p&gt;Robert Ramey&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is a great comment.  It well captures the ying/yang of C++ development.</p>

<p>I think the solution is building applications in layers of abstraction.  This can permit all/most of the issues related to low level optimization to be addressed in lower layers while upper layers and ignore most of this.  This is why I&#8217;m a fan of C++.  Unfortunately, I think a lot of programing shops miss and just start coding rather than building applications layer by layer.  Using C++ in this way causes lots of frustration and confusion.</p>

<p>C++ is a toolbox for making other toolboxes.</p>

<p>Robert Ramey</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1890</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Fri, 13 Jan 2012 19:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1890</guid>
		<description>&lt;p&gt;1000% agreed&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>1000% agreed</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-1889</link>
		<dc:creator>Howard Hinnant</dc:creator>
		<pubDate>Fri, 13 Jan 2012 18:10:11 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1889</guid>
		<description>&lt;p&gt;I think this article should be updated for C++11.  There are two things wrong with it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;
 It leaves the impression that one should &lt;strong&gt;always&lt;/strong&gt; write your assignment operator like so:
&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
T&amp; operator=(T x)    // x is a copy of the source; hard work already done
{
    swap(*this, x);  // trade our resources for x&#039;s
    return *this;    // our (old) resources get destroyed with x
}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;
But in some important cases, this is a large performance penalty.  Vector-like classes where heap memory can be reused during the copy assignment is a classic example.  I&#039;ve just written a short example showing as high as a 7X performance penalty.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
 In C++11 the correct way to write sorted is:
&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
std::vector&lt;std::string&gt;
sorted(std::vector&lt;std::string&gt; names)
{
    std::sort(names.begin(), names.end());
    return names;
}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;
Implicit return-by-move from by-value parameters is now required.
&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The basic point of the article is sound:  Passing by value is an important tool in the tool box.  But I&#039;ve seen too many references to this article that mistakenly throw design and testing out the window on this issue, and translate this article into &quot;&lt;strong&gt;always&lt;/strong&gt; pass by value&quot;.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think this article should be updated for C++11.  There are two things wrong with it:</p>

<ol>
<li>
<p>
 It leaves the impression that one should <strong>always</strong> write your assignment operator like so:
</p>

<blockquote><pre>
T&amp; operator=(T x)    // x is a copy of the source; hard work already done
{
    swap(*this, x);  // trade our resources for x's
    return *this;    // our (old) resources get destroyed with x
}
</pre></blockquote>

<p>
But in some important cases, this is a large performance penalty.  Vector-like classes where heap memory can be reused during the copy assignment is a classic example.  I&#8217;ve just written a short example showing as high as a 7X performance penalty.
</p>
</li>
<li>
<p>
 In C++11 the correct way to write sorted is:
</p>

<blockquote><pre>
std::vector&lt;std::string&gt;
sorted(std::vector&lt;std::string&gt; names)
{
    std::sort(names.begin(), names.end());
    return names;
}
</pre></blockquote>

<p>
Implicit return-by-move from by-value parameters is now required.
</p>
</li>
</ol>

<p>The basic point of the article is sound:  Passing by value is an important tool in the tool box.  But I&#8217;ve seen too many references to this article that mistakenly throw design and testing out the window on this issue, and translate this article into &#8220;<strong>always</strong> pass by value&#8221;.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Expressive C++: Playing with&#160;Syntax by Irit Katriel</title>
		<link>http://cpp-next.com/archive/2010/09/expressive-c-playing-with-syntax/comment-page-1/#comment-1880</link>
		<dc:creator>Irit Katriel</dc:creator>
		<pubDate>Fri, 30 Dec 2011 19:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=1679#comment-1880</guid>
		<description>&lt;p&gt;If you don&#039;t know the arity of each expression, so that this is valid:&lt;/p&gt;

&lt;p&gt;format( &quot;There are...&quot;, map(&quot;place&quot;, &quot;heaven &quot;, &quot;and &quot;, &quot;earth&quot;)
                           (&quot;thing&quot;, &quot;philosophy&quot;) );&lt;/p&gt;

&lt;p&gt;and you want to implement fill_map so that it maps the first string to the concatenation of the rest.&lt;/p&gt;

&lt;p&gt;Is that possible?  I am trying to do something similar with proto_arity, but not sure how.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you don&#8217;t know the arity of each expression, so that this is valid:</p>

<p>format( &#8220;There are&#8230;&#8221;, map(&#8220;place&#8221;, &#8220;heaven &#8220;, &#8220;and &#8220;, &#8220;earth&#8221;)
                           (&#8220;thing&#8221;, &#8220;philosophy&#8221;) );</p>

<p>and you want to implement fill_map so that it maps the first string to the concatenation of the rest.</p>

<p>Is that possible?  I am trying to do something similar with proto_arity, but not sure how.</p>

<p>Thank you.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Breakthrough for&#160;Concepts by alfC</title>
		<link>http://cpp-next.com/archive/2011/12/a-breakthrough-for-concepts/comment-page-1/#comment-1878</link>
		<dc:creator>alfC</dc:creator>
		<pubDate>Thu, 29 Dec 2011 05:04:02 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=4003#comment-1878</guid>
		<description>&lt;p&gt;No matter how long it will take; C++ will be a mathematical language (in the broad sense) at some point. That&#039;s why I was following the &quot;Algebraic Data Types in C++&quot; by Sankel with much interest, a pity that nothing else was published on that direction. -- Thanks for the nice article!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>No matter how long it will take; C++ will be a mathematical language (in the broad sense) at some point. That&#8217;s why I was following the &#8220;Algebraic Data Types in C++&#8221; by Sankel with much interest, a pity that nothing else was published on that direction. &#8212; Thanks for the nice article!</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Want Speed? Pass by&#160;Value. by Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/comment-page-1/#comment-1877</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Wed, 28 Dec 2011 22:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=188#comment-1877</guid>
		<description>&lt;p&gt;Hi Andrzej,&lt;/p&gt;

&lt;p&gt;I wish this were crisper, but I would say:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;operator=&lt;/code&gt; is unconditionally &lt;code&gt;noexcept&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;assignment from an lvalue is &lt;code&gt;noexcept&lt;/code&gt; if &lt;code&gt;T&lt;/code&gt;’s copy constructor is &lt;code&gt;noexcept&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;assignment from an rvalue is &lt;code&gt;noexcept&lt;/code&gt; if move-constructing a &lt;code&gt;T&lt;/code&gt; is &lt;code&gt;noexcept&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Andrzej,</p>

<p>I wish this were crisper, but I would say:</p>

<ul>
<li><code>operator=</code> is unconditionally <code>noexcept</code></li>
<li>assignment from an lvalue is <code>noexcept</code> if <code>T</code>’s copy constructor is <code>noexcept</code></li>
<li>assignment from an rvalue is <code>noexcept</code> if move-constructing a <code>T</code> is <code>noexcept</code></li>
</ul>]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Breakthrough for&#160;Concepts by Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2011/12/a-breakthrough-for-concepts/comment-page-1/#comment-1876</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Wed, 28 Dec 2011 20:36:31 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=4003#comment-1876</guid>
		<description>&lt;p&gt;I&#039;m not familiar with that work, but from &lt;a href=&quot;http://boost-extension.redshoelace.com/docs/boost/extension/boost_extension/introduction.html&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; I&#039;d be inclined to say that library is trying to do way more than I imagine would be included in any standard extensions for the support of shared libraries.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;m not familiar with that work, but from <a href="http://boost-extension.redshoelace.com/docs/boost/extension/boost_extension/introduction.html" rel="nofollow">this page</a> I&#8217;d be inclined to say that library is trying to do way more than I imagine would be included in any standard extensions for the support of shared libraries.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Breakthrough for&#160;Concepts by klaim</title>
		<link>http://cpp-next.com/archive/2011/12/a-breakthrough-for-concepts/comment-page-1/#comment-1875</link>
		<dc:creator>klaim</dc:creator>
		<pubDate>Wed, 28 Dec 2011 20:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=4003#comment-1875</guid>
		<description>&lt;p&gt;Oh ok, you mean there is still no way to manage &quot;plugins&quot; dynamically, like the boost::extension proposal (http://boost-extension.redshoelace.com/docs/boost/extension/index.html).&lt;/p&gt;

&lt;p&gt;So my understanding seems correct: modules could help with organising binaries/libraries/dependencies loaded on the executable beginning. 
However for plugins/extensions/modules-loaded-on-the-fly you still need something like boost::extension.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Oh ok, you mean there is still no way to manage &#8220;plugins&#8221; dynamically, like the boost::extension proposal (<a href="http://boost-extension.redshoelace.com/docs/boost/extension/index.html" rel="nofollow">http://boost-extension.redshoelace.com/docs/boost/extension/index.html</a>).</p>

<p>So my understanding seems correct: modules could help with organising binaries/libraries/dependencies loaded on the executable beginning. 
However for plugins/extensions/modules-loaded-on-the-fly you still need something like boost::extension.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Breakthrough for&#160;Concepts by Robert Ramey</title>
		<link>http://cpp-next.com/archive/2011/12/a-breakthrough-for-concepts/comment-page-1/#comment-1874</link>
		<dc:creator>Robert Ramey</dc:creator>
		<pubDate>Wed, 28 Dec 2011 17:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=4003#comment-1874</guid>
		<description>&lt;p&gt;&quot;it’s too easy for people not to write code that’s consistent with the abstractions.&quot;&lt;/p&gt;

&lt;p&gt;Right, also&lt;/p&gt;

&lt;p&gt;it&#039;s too easy for people to write code which is inconsistent with the abstractions and the error messages don&#039;t help much.&lt;/p&gt;

&lt;p&gt;I did make concepts as I described above.  They seemed to work as I hoped - though I certainly had concerns about how much compile time might be affected.  And I had a lot of reservations as to whether I was doing it right.  I uploaded the code to a trac item as a suggested enhancement to the mpl library.  I&#039;ll leave to the others to determine whether this has any value beyond my ?narrow? application.&lt;/p&gt;

&lt;p&gt;I did conclude that it was doable - but that it would be better if the concepts built into the library at the start rather than trying to add them on afterwards. That is, I felt that I could have made it work better if I had been willing to stick my fingers into the mpl library which is not ever going to happen.  Actually this exercise has led me to a few conclusions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the statement &quot;concepts can be applied to all template arguments&quot; is mostly true
&lt;li&gt;but making it mostly true requires more work in many cases than first meets the eye.
&lt;li&gt;it doesn&#039;t look to me that an enhancement to C++, e.g. conceptGCC, would change this situation  much.
&lt;li&gt;the best way to write a library is to develop the documentation, concepts, tests, and code simultaneously so that they are always consistent. I would contrast this with the normal method:

&lt;ol&gt;
&lt;li&gt;write the library code
&lt;li&gt;write the tests
&lt;li&gt;generate the documentation (with some tool)
&lt;li&gt;insert concepts for templates into the documentation
&lt;li&gt;graft on a tutorial to the documentation
&lt;li&gt;spend the next couple of years fixing up stuff.
&lt;/ol&gt;
&lt;/ol&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;it’s too easy for people not to write code that’s consistent with the abstractions.&#8221;</p>

<p>Right, also</p>

<p>it&#8217;s too easy for people to write code which is inconsistent with the abstractions and the error messages don&#8217;t help much.</p>

<p>I did make concepts as I described above.  They seemed to work as I hoped &#8211; though I certainly had concerns about how much compile time might be affected.  And I had a lot of reservations as to whether I was doing it right.  I uploaded the code to a trac item as a suggested enhancement to the mpl library.  I&#8217;ll leave to the others to determine whether this has any value beyond my ?narrow? application.</p>

<p>I did conclude that it was doable &#8211; but that it would be better if the concepts built into the library at the start rather than trying to add them on afterwards. That is, I felt that I could have made it work better if I had been willing to stick my fingers into the mpl library which is not ever going to happen.  Actually this exercise has led me to a few conclusions.</p>

<ol>
<li>the statement &#8220;concepts can be applied to all template arguments&#8221; is mostly true
</li><li>but making it mostly true requires more work in many cases than first meets the eye.
</li><li>it doesn&#8217;t look to me that an enhancement to C++, e.g. conceptGCC, would change this situation  much.
</li><li>the best way to write a library is to develop the documentation, concepts, tests, and code simultaneously so that they are always consistent. I would contrast this with the normal method:

<ol>
<li>write the library code
</li><li>write the tests
</li><li>generate the documentation (with some tool)
</li><li>insert concepts for templates into the documentation
</li><li>graft on a tutorial to the documentation
</li><li>spend the next couple of years fixing up stuff.
</li></ol>
</li></ol>]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Breakthrough for&#160;Concepts by Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2011/12/a-breakthrough-for-concepts/comment-page-1/#comment-1873</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Wed, 28 Dec 2011 15:59:07 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=4003#comment-1873</guid>
		<description>&lt;p&gt;Oh, well, yeah, you can tie symbol exposure to module-public-ness and then you avoid having to do it with declspecs or attributes.  So in that respect I guess it would address some issues of dynamic libraries.  But anyone wanting to fully integrate those into C++  still has to deal with load/initialization order and especially unload-ability, i.e. the &lt;em&gt;dynamic&lt;/em&gt; part ;-), with which modules don&#039;t help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Oh, well, yeah, you can tie symbol exposure to module-public-ness and then you avoid having to do it with declspecs or attributes.  So in that respect I guess it would address some issues of dynamic libraries.  But anyone wanting to fully integrate those into C++  still has to deal with load/initialization order and especially unload-ability, i.e. the <em>dynamic</em> part <img src='http://cpp-next.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> , with which modules don&#8217;t help.</p>]]></content:encoded>
	</item>
</channel>
</rss>

