<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Efficient argument passing in C++11, Part 3</title>
	<link>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/</link>
	<description>Boris Kolpackov's blog about software</description>
	<pubDate>Sun, 05 Apr 2026 17:37:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Boris Kolpackov</title>
		<link>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2183</link>
		<author>Boris Kolpackov</author>
		<pubDate>Fri, 06 Jul 2012 08:24:30 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2183</guid>
		<description>You are, of course, absolutely correct. I've applied the fixes and updated the archive. Thanks for reporting this!</description>
		<content:encoded><![CDATA[<p>You are, of course, absolutely correct. I&#8217;ve applied the fixes and updated the archive. Thanks for reporting this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: segfault</title>
		<link>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2182</link>
		<author>segfault</author>
		<pubDate>Fri, 06 Jul 2012 06:36:45 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2182</guid>
		<description>Here it is again with escaping the less-than:
typename std::aligned_storage&#60;sizeof (T), alignof (T)&#62;::type data;</description>
		<content:encoded><![CDATA[<p>Here it is again with escaping the less-than:<br />
typename std::aligned_storage&lt;sizeof (T), alignof (T)&gt;::type data;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: segfault</title>
		<link>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2181</link>
		<author>segfault</author>
		<pubDate>Fri, 06 Jul 2012 06:31:55 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2181</guid>
		<description>I tried this out (on gcc 4.7.1) with a in parameter and got a segfault.  The problem seems to be with struct storage.  The data field is defined as
[code]
std::aligned_storage data;
[/code]
when it should be
[code]
typename std::aligned_storage::type data;
[/code]
And the placement new should be *new(&#38;s.data) instead of *new(&#38;s).

Other than that, it is an interesting idea.</description>
		<content:encoded><![CDATA[<p>I tried this out (on gcc 4.7.1) with a in parameter and got a segfault.  The problem seems to be with struct storage.  The data field is defined as<br />
[code]<br />
std::aligned_storage data;<br />
[/code]<br />
when it should be<br />
[code]<br />
typename std::aligned_storage::type data;<br />
[/code]<br />
And the placement new should be *new(&amp;s.data) instead of *new(&amp;s).</p>
<p>Other than that, it is an interesting idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alexander turner</title>
		<link>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2178</link>
		<author>alexander turner</author>
		<pubDate>Wed, 04 Jul 2012 07:02:50 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2012/07/03/efficient-argument-passing-cxx11-part3/#comment-2178</guid>
		<description>Hi, this is a really thoughtful post. It seems tp me that there are differemt types of programming going on here. There is application programming in which one should stick to the c98 style as it is fast to implement and works. Then there is systems programming where crafting l r value overloads makes sense.  Then, if there are issues in a prpfile, late optimizing application code makes sense. Early optimising application code might well fall fowel of optimisers in different compilers. My general rule of thumb is that the more complex your code is the less able an optimiser is to deal with it.</description>
		<content:encoded><![CDATA[<p>Hi, this is a really thoughtful post. It seems tp me that there are differemt types of programming going on here. There is application programming in which one should stick to the c98 style as it is fast to implement and works. Then there is systems programming where crafting l r value overloads makes sense.  Then, if there are issues in a prpfile, late optimizing application code makes sense. Early optimising application code might well fall fowel of optimisers in different compilers. My general rule of thumb is that the more complex your code is the less able an optimiser is to deal with it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
