<?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: How to Remove Duplicates from an Associative Container in C++	</title>
	<atom:link href="https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Mon, 26 Nov 2018 12:04:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.4</generator>
	<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1493</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Mon, 26 Nov 2018 12:04:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1493</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1326&quot;&gt;jft&lt;/a&gt;.

Oops yes. This is now fixed, the sentence I meant to write is: &quot;In C++11, insertion adds elements at the upper bound of the range containing equivalent keys.&quot;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1326">jft</a>.</p>
<p>Oops yes. This is now fixed, the sentence I meant to write is: &#8220;In C++11, insertion adds elements at the upper bound of the range containing equivalent keys.&#8221;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1376</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 07 Oct 2018 16:18:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1376</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1327&quot;&gt;Benoît Thouy&lt;/a&gt;.

Yes indeed, fixed now thanks.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1327">Benoît Thouy</a>.</p>
<p>Yes indeed, fixed now thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1375</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 07 Oct 2018 16:13:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1375</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1330&quot;&gt;jft&lt;/a&gt;.

A possible use case would be for a multi map that allows duplicates, but at some point we&#039;d like to clean the multi map of the duplicate keys, for instance]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1330">jft</a>.</p>
<p>A possible use case would be for a multi map that allows duplicates, but at some point we&#8217;d like to clean the multi map of the duplicate keys, for instance</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dannftk		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1357</link>

		<dc:creator><![CDATA[dannftk]]></dc:creator>
		<pubDate>Wed, 03 Oct 2018 11:31:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1357</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1327&quot;&gt;Benoît Thouy&lt;/a&gt;.

Yes, indeed, I also noticed]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1327">Benoît Thouy</a>.</p>
<p>Yes, indeed, I also noticed</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Miguel Raggi		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1331</link>

		<dc:creator><![CDATA[Miguel Raggi]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 16:50:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1331</guid>

					<description><![CDATA[This is why I always prefer map of vectors instead of multimap :)]]></description>
			<content:encoded><![CDATA[<p>This is why I always prefer map of vectors instead of multimap 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1330</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 12:03:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1330</guid>

					<description><![CDATA[&quot;We will only look at keys to determine whether two elements are duplicates.&quot;


If you are only considering keys (with potentially different associated values), then which key do you keep? With multi-map the ordering of equal keys is not defined (AFAIK). If the (key, value) pair is identical, then I see the value in removing them (but why where identical ones allowed to be inserted? - quicker to insert everything and remove later?). But if you are removing elements based only on key value, you&#039;ll then end up with only 1 element for each key - so why use multi-map, why not just use map and report an error (or something) for duplicate keys??]]></description>
			<content:encoded><![CDATA[<p>&#8220;We will only look at keys to determine whether two elements are duplicates.&#8221;</p>
<p>If you are only considering keys (with potentially different associated values), then which key do you keep? With multi-map the ordering of equal keys is not defined (AFAIK). If the (key, value) pair is identical, then I see the value in removing them (but why where identical ones allowed to be inserted? &#8211; quicker to insert everything and remove later?). But if you are removing elements based only on key value, you&#8217;ll then end up with only 1 element for each key &#8211; so why use multi-map, why not just use map and report an error (or something) for duplicate keys??</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eric Roussel		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1329</link>

		<dc:creator><![CDATA[Eric Roussel]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 11:51:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1329</guid>

					<description><![CDATA[Some C++14 (draft) standard references that explain why this is working:


multimap/multiset: [23.2.4/10] &quot;The fundamental property of iterators of associative containers is that they iterate through the containers in the non-descending order of keys&quot;
=&#062; the standard ensures that the iteration is done in order and that then you can compare two consecutive elements.


unordered_multimap/set: [23.2.5/6] &quot;In containers that support equivalent keys, elements with equivalent keys are adjacent to each other in the iteration order of the container.&quot;
=&#062; As you mentioned in the text, the standard ensures that equivalent keys will be seen as adjacent in iteration order.]]></description>
			<content:encoded><![CDATA[<p>Some C++14 (draft) standard references that explain why this is working:</p>
<p>multimap/multiset: [23.2.4/10] &#8220;The fundamental property of iterators of associative containers is that they iterate through the containers in the non-descending order of keys&#8221;<br />
=&gt; the standard ensures that the iteration is done in order and that then you can compare two consecutive elements.</p>
<p>unordered_multimap/set: [23.2.5/6] &#8220;In containers that support equivalent keys, elements with equivalent keys are adjacent to each other in the iteration order of the container.&#8221;<br />
=&gt; As you mentioned in the text, the standard ensures that equivalent keys will be seen as adjacent in iteration order.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eric Roussel		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1328</link>

		<dc:creator><![CDATA[Eric Roussel]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 10:55:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1328</guid>

					<description><![CDATA[Several issues in the text:

1. first, that&#039;s the fourth article in the serie.

2. &quot;The other don’t have duplicates, by definition.&quot; -&#062; &quot;the others&quot; (with an s)

3. &quot;Note that before C++11, we didn’t know which of the duplicates remain&quot; -&#062; &quot;remains&quot; (with an s)

4. &quot;Here we make `it` point the second element of the container, and `previousIt` it to the first element.&quot; -&#062; &quot;Here we make `it` point *to* the second element of the container, and `previousIt` -it- to the first element.&quot; (&quot;point to&quot;, and remove an extra &quot;it&quot; after &quot;previousIt&quot;).

5. &quot;To solve this we can provide default values for this policy, that would be correspond to the various cases.&quot; -&#062; remove &quot;be&quot;: &quot;... that would correspond ...&quot;

6. &quot;So we’ll have to make do with key_eq, and pass the keys to it ourselves.&quot; -&#062; remove &quot;make&quot;]]></description>
			<content:encoded><![CDATA[<p>Several issues in the text:</p>
<p>1. first, that&#8217;s the fourth article in the serie.</p>
<p>2. &#8220;The other don’t have duplicates, by definition.&#8221; -&gt; &#8220;the others&#8221; (with an s)</p>
<p>3. &#8220;Note that before C++11, we didn’t know which of the duplicates remain&#8221; -&gt; &#8220;remains&#8221; (with an s)</p>
<p>4. &#8220;Here we make `it` point the second element of the container, and `previousIt` it to the first element.&#8221; -&gt; &#8220;Here we make `it` point *to* the second element of the container, and `previousIt` -it- to the first element.&#8221; (&#8220;point to&#8221;, and remove an extra &#8220;it&#8221; after &#8220;previousIt&#8221;).</p>
<p>5. &#8220;To solve this we can provide default values for this policy, that would be correspond to the various cases.&#8221; -&gt; remove &#8220;be&#8221;: &#8220;&#8230; that would correspond &#8230;&#8221;</p>
<p>6. &#8220;So we’ll have to make do with key_eq, and pass the keys to it ourselves.&#8221; -&gt; remove &#8220;make&#8221;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Benoît Thouy		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1327</link>

		<dc:creator><![CDATA[Benoît Thouy]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 09:51:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1327</guid>

					<description><![CDATA[The code of the policy seems wrong, it&#039;s twice the same test -- forgot to swap element1 and element2?]]></description>
			<content:encoded><![CDATA[<p>The code of the policy seems wrong, it&#8217;s twice the same test &#8212; forgot to swap element1 and element2?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/09/25/remove-duplicates-associative-container-cpp/#comment-1326</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 07:32:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2974#comment-1326</guid>

					<description><![CDATA[In C++11, insertion doesn


I think the editing went slightly wrong here....]]></description>
			<content:encoded><![CDATA[<p>In C++11, insertion doesn</p>
<p>I think the editing went slightly wrong here&#8230;.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
