<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Inserting several elements into an STL container efficiently	</title>
	<atom:link href="https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Mon, 18 Sep 2017 07:11:50 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.4</generator>
	<item>
		<title>
		By: Sandro Bartolini		</title>
		<link>https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-187</link>

		<dc:creator><![CDATA[Sandro Bartolini]]></dc:creator>
		<pubDate>Tue, 28 Mar 2017 09:57:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=930#comment-187</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-186&quot;&gt;Robert Jones&lt;/a&gt;.

For sure. I agree with you. If you know the number in advance back_inserter is not the most recommendable idiom. Furthermore, in general it is better a &quot;oneliner&quot; solution, if available, compared to a pair of statement (as in the case of reserve + copy) to do a conceptual operation.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-186">Robert Jones</a>.</p>
<p>For sure. I agree with you. If you know the number in advance back_inserter is not the most recommendable idiom. Furthermore, in general it is better a &#8220;oneliner&#8221; solution, if available, compared to a pair of statement (as in the case of reserve + copy) to do a conceptual operation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Robert Jones		</title>
		<link>https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-186</link>

		<dc:creator><![CDATA[Robert Jones]]></dc:creator>
		<pubDate>Tue, 28 Mar 2017 09:36:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=930#comment-186</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-185&quot;&gt;Sandro bartolini&lt;/a&gt;.

I was going to express much the same sentiment, that the reallocation issue is defeated by reserve, but  on reflection if you know how much to reserve you probably (though not necessarily) have all the elements in advance, so adding them one by one is not the most natural expression of intent. I grant you it&#039;s a moot point. In fairness to Jonathan&#039;s excellent blog site I had considered his use of back_inserter( ) as being for exposition, rather than a recommendation of the idiom.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-185">Sandro bartolini</a>.</p>
<p>I was going to express much the same sentiment, that the reallocation issue is defeated by reserve, but  on reflection if you know how much to reserve you probably (though not necessarily) have all the elements in advance, so adding them one by one is not the most natural expression of intent. I grant you it&#8217;s a moot point. In fairness to Jonathan&#8217;s excellent blog site I had considered his use of back_inserter( ) as being for exposition, rather than a recommendation of the idiom.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sandro bartolini		</title>
		<link>https://www.fluentcpp.com/2017/03/28/inserting-several-elements-into-an-stl-container/#comment-185</link>

		<dc:creator><![CDATA[Sandro bartolini]]></dc:creator>
		<pubDate>Tue, 28 Mar 2017 09:00:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=930#comment-185</guid>

					<description><![CDATA[Nice post! In addition, a good companion of &quot;std::copy &#038; std::back_inserter&quot; pair is a preliminary v.reserve(&quot;new_size&quot;) in the cases, like the ones above, where the final size of the target container is known. This way, back_inserter becomes really cheap and can be a reasonable alternative to the other methods described.]]></description>
			<content:encoded><![CDATA[<p>Nice post! In addition, a good companion of &#8220;std::copy &amp; std::back_inserter&#8221; pair is a preliminary v.reserve(&#8220;new_size&#8221;) in the cases, like the ones above, where the final size of the target container is known. This way, back_inserter becomes really cheap and can be a reasonable alternative to the other methods described.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
