<?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 on: Three Kinds of Concept&#160;Maps</title>
	<atom:link href="http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/feed/" rel="self" type="application/rss+xml" />
	<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/</link>
	<description>The next generation of C++</description>
	<lastBuildDate>Fri, 10 Sep 2010 03:19:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Rizky Herucakra</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-371</link>
		<dc:creator>Rizky Herucakra</dc:creator>
		<pubDate>Thu, 10 Dec 2009 11:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-371</guid>
		<description>&lt;p&gt;sorry for late reply, I have been in a place where Internet connection is privileged (and I am not priviledged :-D )&lt;/p&gt;

&lt;p&gt;Yes, My entire comment is about trivial post-hoc mapping. sorry for not being clear earlier.&lt;/p&gt;

&lt;p&gt;you said :
&quot;A ForwardIterator could masquerade as a BidirectionalIterator in exactly the same way as InputIterators often masquerade as ForwardIterators. In practice, it’s less likely to be an issue with BidirectionalIterator, since it is syntactically more distinguished from ForwardIterator than ForwardIterator is from InputIterator. But it’s just a question of degree.&quot;&lt;/p&gt;

&lt;p&gt;My reply is :
I may defer this to my reply to Mr.Gregor reply, but can you give me your version about the expanded version of this statement, especially I do not understand about ForwardIterator masquerading as BidirectionalIterator, since both concept can be differentiated syntactically (isn&#039;t it ?).&lt;/p&gt;

&lt;p&gt;you said : 
&quot;I have two questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Were you planning to document somewhere that it’s a BidirectionalIterator?&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Were you planning to embed an iterator_category typedef?
&quot;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Is it enough to have an iterator the required operator/operations (operator ++ , -- , *, etc.) to be recognized as BidirectionalIterator? I am aware that it is possible to define types that conform syntactically to BidirectionalIterator Syntactically but does not conform to it semantically. But I am consenting adult, and I am quite willing to take responsibility of my action.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why do we still need iterator_category typedef if we already have concept ?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;you said &quot;
&quot;Can you explain in what way it clarifies those roles? Is that experience of clarification due to the changes N2906 would make to those roles, or simply to the paper’s explanatory text? If the former, how did the specification sans-N2906 changes make those roles unclear?&quot;&lt;/p&gt;

&lt;p&gt;My answer:
 I personally has a little theory, something like this:
If there is a type T and a concept C, there are two things that need to be done with T and C&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check if T is a model of C. Let&#039;s call this &quot;Discrimination Role&quot;&lt;/li&gt;
&lt;li&gt;If T is too different with C&#039;s archetype, force T to become model of C by adding more information . Let&#039;s call this &quot;Adaptation Role&quot;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With N2906, the Discrimination Role is primarily the job of type checker and concept declaration. concept_map primary role is adaptation role. This is possible because N2906 makes the default in favor to what we call auto concept. Let&#039;s talk about default later. By not making the default favoring auto concept, we give concept_map much more responsibility to Discrimination role, thus making the role somewhat overlap with type checker.&lt;/p&gt;

&lt;p&gt;&quot;Are you saying that concept maps should never be used in other situations, or that you should never be forced to write concept maps in other situations, or something else?&quot;&lt;/p&gt;

&lt;p&gt;Why should I state the obvious that a type with operator (++ , --, * ) and has appropriate semantic (which I guarantee myself) is bidirectional iterator. I mean, It&#039;s more work and it&#039;s verbose, right? and more importantly template without concept in principle does not require anything like that.&lt;/p&gt;

&lt;p&gt;&quot;I assume you’re just ignoring post-hoc adaptive mapping now, because if you ever want to do that, you need a concept map, auto concept or not.&quot;&lt;/p&gt;

&lt;p&gt;I think concept_map in post-hoc adaptive mapping is essential, My question is why we need it in trivial post-hoc mapping (well, not really. I actually ask why something as trivial as BidirectionalIterator is not auto concept, but it come close in spirit).&lt;/p&gt;

&lt;p&gt;As additional note, I think N2906 is proposing elimination non-auto concept in the name only, since, as you said, it still possible for us to define something like non-auto concept. However it is achieved by making the refinement explicit, and taking analogy from inheritance, it will require more thought to do that. So, I guess (may be wrong, I do not write N2906) it is all about shifting the default in favor to auto concept.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>sorry for late reply, I have been in a place where Internet connection is privileged (and I am not priviledged <img src='http://cpp-next.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  )</p>

<p>Yes, My entire comment is about trivial post-hoc mapping. sorry for not being clear earlier.</p>

<p>you said :
&#8220;A ForwardIterator could masquerade as a BidirectionalIterator in exactly the same way as InputIterators often masquerade as ForwardIterators. In practice, it’s less likely to be an issue with BidirectionalIterator, since it is syntactically more distinguished from ForwardIterator than ForwardIterator is from InputIterator. But it’s just a question of degree.&#8221;</p>

<p>My reply is :
I may defer this to my reply to Mr.Gregor reply, but can you give me your version about the expanded version of this statement, especially I do not understand about ForwardIterator masquerading as BidirectionalIterator, since both concept can be differentiated syntactically (isn&#8217;t it ?).</p>

<p>you said : 
&#8220;I have two questions:</p>

<ol>
<li>Were you planning to document somewhere that it’s a BidirectionalIterator?</li>
<li><p>Were you planning to embed an iterator_category typedef?
&#8220;</p>

<ol>
<li><p>Is it enough to have an iterator the required operator/operations (operator ++ , &#8212; , *, etc.) to be recognized as BidirectionalIterator? I am aware that it is possible to define types that conform syntactically to BidirectionalIterator Syntactically but does not conform to it semantically. But I am consenting adult, and I am quite willing to take responsibility of my action.</p></li>
<li><p>Why do we still need iterator_category typedef if we already have concept ?</p></li>
</ol></li>
</ol>

<p>you said &#8221;
&#8220;Can you explain in what way it clarifies those roles? Is that experience of clarification due to the changes N2906 would make to those roles, or simply to the paper’s explanatory text? If the former, how did the specification sans-N2906 changes make those roles unclear?&#8221;</p>

<p>My answer:
 I personally has a little theory, something like this:
If there is a type T and a concept C, there are two things that need to be done with T and C</p>

<ol>
<li>Check if T is a model of C. Let&#8217;s call this &#8220;Discrimination Role&#8221;</li>
<li>If T is too different with C&#8217;s archetype, force T to become model of C by adding more information . Let&#8217;s call this &#8220;Adaptation Role&#8221;</li>
</ol>

<p>With N2906, the Discrimination Role is primarily the job of type checker and concept declaration. concept_map primary role is adaptation role. This is possible because N2906 makes the default in favor to what we call auto concept. Let&#8217;s talk about default later. By not making the default favoring auto concept, we give concept_map much more responsibility to Discrimination role, thus making the role somewhat overlap with type checker.</p>

<p>&#8220;Are you saying that concept maps should never be used in other situations, or that you should never be forced to write concept maps in other situations, or something else?&#8221;</p>

<p>Why should I state the obvious that a type with operator (++ , &#8211;, * ) and has appropriate semantic (which I guarantee myself) is bidirectional iterator. I mean, It&#8217;s more work and it&#8217;s verbose, right? and more importantly template without concept in principle does not require anything like that.</p>

<p>&#8220;I assume you’re just ignoring post-hoc adaptive mapping now, because if you ever want to do that, you need a concept map, auto concept or not.&#8221;</p>

<p>I think concept_map in post-hoc adaptive mapping is essential, My question is why we need it in trivial post-hoc mapping (well, not really. I actually ask why something as trivial as BidirectionalIterator is not auto concept, but it come close in spirit).</p>

<p>As additional note, I think N2906 is proposing elimination non-auto concept in the name only, since, as you said, it still possible for us to define something like non-auto concept. However it is achieved by making the refinement explicit, and taking analogy from inheritance, it will require more thought to do that. So, I guess (may be wrong, I do not write N2906) it is all about shifting the default in favor to auto concept.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-297</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Tue, 24 Nov 2009 17:22:26 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-297</guid>
		<description>&lt;p&gt;Great question; that would be ambiguous.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Great question; that would be ambiguous.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: akrzemi1</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-294</link>
		<dc:creator>akrzemi1</dc:creator>
		<pubDate>Mon, 23 Nov 2009 15:57:25 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-294</guid>
		<description>&lt;p&gt;Regarding the Stack example:&lt;/p&gt;

&lt;pre&gt;template&lt;BackInsertionSequence Cont&gt; concept_map Stack&lt;Cont&gt; &#123;/*...*/&#125;&lt;/pre&gt;

&lt;p&gt;It seams there are two ways of saying that every instance of concept A is also an instance of concept B: one is the concept map as you describe; the other is concept refinement. Would concept-based function overloading work for the concept_map way too? I.e. if I have two function overloads: one for &lt;code&gt;BackInsertionSequence&lt;/code&gt; and one for &lt;code&gt;Stack&lt;/code&gt; and I call it for &lt;code&gt;vector&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;std::vector&lt;int&gt; vec;
function&#040;vec&#041;;&lt;/pre&gt;

&lt;p&gt;Will the compiler prefer either overload, or will I have an ambiguity?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Regarding the Stack example:</p>

<pre>template&lt;BackInsertionSequence Cont&gt; concept_map Stack&lt;Cont&gt; &#123;/*...*/&#125;</pre>

<p>It seams there are two ways of saying that every instance of concept A is also an instance of concept B: one is the concept map as you describe; the other is concept refinement. Would concept-based function overloading work for the concept_map way too? I.e. if I have two function overloads: one for <code>BackInsertionSequence</code> and one for <code>Stack</code> and I call it for <code>vector</code>:</p>

<pre>std::vector&lt;int&gt; vec;
function&#40;vec&#41;;</pre>

<p>Will the compiler prefer either overload, or will I have an ambiguity?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Andrzej Krzemienski</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-293</link>
		<dc:creator>Andrzej Krzemienski</dc:creator>
		<pubDate>Sun, 22 Nov 2009 20:58:29 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-293</guid>
		<description>&lt;blockquote cite=&quot;comment-292&quot;&gt;

&lt;strong&gt;&lt;a href=&quot;#comment-292&quot; rel=&quot;nofollow&quot;&gt;Doug Gregor&lt;/a&gt;&lt;/strong&gt;: That definition is there for exposition purposes, to call out the relationship between the value_type of ‘Cont’ when viewed as a BackInsertionContainer vs. when ‘Cont’ is viewed as a Stack. The definition is technically redundant, since &lt;code&gt;Cont::value_type&lt;/code&gt; is just a shorthand for &lt;code&gt;BackInsertionContaienr&lt;Cont&gt;::value_type&lt;/code&gt;.
&#160;&#160;

&lt;/blockquote&gt;

&lt;p&gt;I am not sure I understand. Do you mean that omitting the typedef will work, like that:&lt;/p&gt;

&lt;pre&gt;template&lt;BackInsertionSequence Cont&gt;
concept_map Stack&lt;Cont&gt;
&#123;
  void push&#040;Cont &amp;c, const value_type &amp;x&#041;
  &#123; c.push_back&#040;x&#041;; &#125;
  ...
&#125;&lt;/pre&gt;

&lt;p&gt;I thought that only by writing the concept map, I already state that if &lt;code&gt;Cont&lt;/code&gt; which is any &lt;code&gt;BackInsertionSequence&lt;/code&gt; has member typedef &lt;code&gt;value_type&lt;/code&gt; (which it always does), and &lt;code&gt;Stack&lt;/code&gt;&#039;s concept requires the member typedef of the same name. The two should be matched automatically.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<blockquote cite="comment-292">

<strong><a href="#comment-292" rel="nofollow">Doug Gregor</a></strong>: That definition is there for exposition purposes, to call out the relationship between the value_type of ‘Cont’ when viewed as a BackInsertionContainer vs. when ‘Cont’ is viewed as a Stack. The definition is technically redundant, since <code>Cont::value_type</code> is just a shorthand for <code>BackInsertionContaienr&lt;Cont&gt;::value_type</code>.
&nbsp;&nbsp;

</blockquote>

<p>I am not sure I understand. Do you mean that omitting the typedef will work, like that:</p>

<pre>template&lt;BackInsertionSequence Cont&gt;
concept_map Stack&lt;Cont&gt;
&#123;
  void push&#40;Cont &amp;c, const value_type &amp;x&#41;
  &#123; c.push_back&#40;x&#41;; &#125;
  ...
&#125;</pre>

<p>I thought that only by writing the concept map, I already state that if <code>Cont</code> which is any <code>BackInsertionSequence</code> has member typedef <code>value_type</code> (which it always does), and <code>Stack</code>&#8216;s concept requires the member typedef of the same name. The two should be matched automatically.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Gregor</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-292</link>
		<dc:creator>Doug Gregor</dc:creator>
		<pubDate>Sat, 21 Nov 2009 17:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-292</guid>
		<description>&lt;blockquote cite=&quot;comment-289&quot;&gt;

&lt;strong&gt;&lt;a href=&quot;#comment-289&quot; rel=&quot;nofollow&quot;&gt;Andrzej Krzemienski&lt;/a&gt;&lt;/strong&gt;: Hi,
It was said that in the concept map we only list members that are not structurally identical to that of the concept. Why then the following definition in the concept_map Stack example:
typedef Cont::value_type value_type;
Regards.
&#160;&#160;

&lt;/blockquote&gt;

&lt;p&gt;That definition is there for exposition purposes, to call out the relationship between the value_type of &#039;Cont&#039; when viewed as a BackInsertionContainer vs. when &#039;Cont&#039; is viewed as a Stack. The definition is technically redundant, since &lt;code&gt;Cont::value_type&lt;/code&gt; is just a shorthand for &lt;code&gt;BackInsertionContaienr&lt;Cont&gt;::value_type&lt;/code&gt;.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<blockquote cite="comment-289">

<strong><a href="#comment-289" rel="nofollow">Andrzej Krzemienski</a></strong>: Hi,
It was said that in the concept map we only list members that are not structurally identical to that of the concept. Why then the following definition in the concept_map Stack example:
typedef Cont::value_type value_type;
Regards.
&nbsp;&nbsp;

</blockquote>

<p>That definition is there for exposition purposes, to call out the relationship between the value_type of &#8216;Cont&#8217; when viewed as a BackInsertionContainer vs. when &#8216;Cont&#8217; is viewed as a Stack. The definition is technically redundant, since <code>Cont::value_type</code> is just a shorthand for <code>BackInsertionContaienr&lt;Cont&gt;::value_type</code>.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Siek</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-291</link>
		<dc:creator>Jeremy Siek</dc:creator>
		<pubDate>Sat, 21 Nov 2009 07:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-291</guid>
		<description>&lt;p&gt;Hi Robert,&lt;/p&gt;

&lt;p&gt;Yes, such concept maps can coexist in a single program. During the development of the concepts proposal, I wrote the following paper to argue in favor of this, using the term &quot;scoped concept maps&quot;.&lt;/p&gt;

&lt;p&gt;http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2098.pdf&lt;/p&gt;

&lt;p&gt;Subsequently, this idea was accepted and incorporated into the draft standard.&lt;/p&gt;

&lt;p&gt;The way for such concept maps to coexist is for them to be defined in separate namespaces.
To control which concept map is used, you can choose to import one or the other of the concept maps from its namespace
(there&#039;s a new kind of using directive for concept maps).&lt;/p&gt;

&lt;p&gt;The standardese for scoped concept maps is available in the following paper:&lt;/p&gt;

&lt;p&gt;http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2414.pdf&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Robert,</p>

<p>Yes, such concept maps can coexist in a single program. During the development of the concepts proposal, I wrote the following paper to argue in favor of this, using the term &#8220;scoped concept maps&#8221;.</p>

<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2098.pdf" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2098.pdf</a></p>

<p>Subsequently, this idea was accepted and incorporated into the draft standard.</p>

<p>The way for such concept maps to coexist is for them to be defined in separate namespaces.
To control which concept map is used, you can choose to import one or the other of the concept maps from its namespace
(there&#8217;s a new kind of using directive for concept maps).</p>

<p>The standardese for scoped concept maps is available in the following paper:</p>

<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2414.pdf" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2414.pdf</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Rybarczyk</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-290</link>
		<dc:creator>Robert Rybarczyk</dc:creator>
		<pubDate>Fri, 20 Nov 2009 22:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-290</guid>
		<description>&lt;p&gt;A data type may meet requirements of a concept in more than one way. For example int can be made into a Monoid with + and 0 as identity, or with * and 1. Is this possible for such concept maps to coexist in a single program, and how can I control which one is picked by a code that uses given concept?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>A data type may meet requirements of a concept in more than one way. For example int can be made into a Monoid with + and 0 as identity, or with * and 1. Is this possible for such concept maps to coexist in a single program, and how can I control which one is picked by a code that uses given concept?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Andrzej Krzemienski</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-289</link>
		<dc:creator>Andrzej Krzemienski</dc:creator>
		<pubDate>Fri, 20 Nov 2009 16:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-289</guid>
		<description>&lt;p&gt;Hi,
It was said that in the concept map we only list members that are not structurally identical to that of the concept. Why then the following definition in the concept_map Stack example:&lt;/p&gt;

&lt;p&gt;typedef Cont::value_type value_type;&lt;/p&gt;

&lt;p&gt;Regards.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,
It was said that in the concept map we only list members that are not structurally identical to that of the concept. Why then the following definition in the concept_map Stack example:</p>

<p>typedef Cont::value_type value_type;</p>

<p>Regards.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Gregor</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-288</link>
		<dc:creator>Doug Gregor</dc:creator>
		<pubDate>Fri, 20 Nov 2009 16:18:52 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-288</guid>
		<description>&lt;blockquote cite=&quot;comment-285&quot;&gt;

&lt;strong&gt;&lt;a href=&quot;#comment-285&quot; rel=&quot;nofollow&quot;&gt;Rizky Herucakra&lt;/a&gt;&lt;/strong&gt;: 
Why isn’t BidirectionalIterator auto concept ?
 specifically, BidirectionalIterator does not have problem like ForwardIterator and InputIterator.&lt;/blockquote&gt;

&lt;p&gt;It potentially has the same problem, since one could easily have a ForwardIterator with an &lt;code&gt;operator--&lt;/code&gt; that doesn&#039;t have the meaning required for it to be a BidirectionalIterator. However, we (as a community) have a lot of experience with the iterators, and such an type is rather unlikely. The BidirectionalIterator concept is so widely used that it&#039;s possible it could be auto and it probably would never matter. However...&lt;/p&gt;

&lt;p&gt;The decision to make a concept &quot;auto&quot; or not is something that&#039;s generally done when we initially write the concept, before we&#039;ve had the years of experience we have with iterators. Given that the ForwardIterator and InputIterator concepts &lt;em&gt;look&lt;/em&gt; syntactically different, I&#039;m willing to bet that many people would have made ForwardIterator &quot;auto&quot;. Then, after a bunch of code was written without concept maps, we&#039;d hit the first istream_iterator instance and we would have a serious problem: ForwardIterator would have to become non-auto and now we have to write a bunch of concept maps to fix &lt;em&gt;existing&lt;/em&gt; code. Concepts evolve over time, as we find more models of those concepts (&quot;hey, we can provide iteration through a stream with this interface!&quot;) that change our understanding of existing concepts and introduce new concepts (e.g., putting MultiPassInputIterator between InputIterator and ForwardIterator in the concept hierarchy). Non-auto concepts allow such seamless evolution, because the user has stated their intentions; auto concepts make evolution harder, because we have to guess at the intentions of users.&lt;/p&gt;

&lt;p&gt;So, unless you&#039;re dealing with some really simple syntactic concept, I would not make a concept auto.&lt;/p&gt;

&lt;blockquote&gt;
 By not making it auto concept, we have to write concept_map with empty body since I already make my iterator class conform structurally (thus there is nothing to map).&lt;/blockquote&gt;

&lt;p&gt;When you write your iterator class, you already make an explicit statement that your iterator conforms to the BidirectionalIterator concept. It looks like this:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre class=&quot;cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;typedef&lt;/span&gt; std&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;bidirectional_iterator_tag&lt;/span&gt; iterator_category&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;A concept map is the same kind of statement, but a concept map actually has teeth: the compiler will check that assumption, to make sure you got all of the various operators and their variants declared correctly. Once you&#039;ve been able to compile the concept map, you know that you&#039;ve met the syntactic requirements of the concept, and there will be no surprises, either now (&quot;why didn&#039;t it pick the BidirectionalIterator overload over the InputIterator one? I could swear that I implemented all of the requirements of BidirectionalIterator...&quot;) or later (&quot;someone must have tweaked the interface to my iterator type, because now it&#039;s failing to get used as a BidirectionalIterator&quot;).&lt;/p&gt;

&lt;blockquote&gt;
I personally like N2906, since it clarifies the role of concept and concept map.&lt;/blockquote&gt;

&lt;p&gt;N2906 presents a different view of concept maps. It views concept maps more as a fix (when syntax doesn&#039;t line up) or as a necessary evil (when we&#039;re forced to use explicit refinement). I have a very different view: I view concept maps as a part of the generic programming process, documenting and enforcing the relationships between the types I write and the concepts they are meant to model.&lt;/p&gt;

&lt;blockquote&gt;
I personally dislike having to write concept map if I know that certain type already conform both structurally and semantically to a concept. I think writing concept map should be reserved to a situation where there are concepts that has same syntactical requirement but different semantic requirement, and I think those kind of concepts are rare. By making concept not auto by default, I believe we choose the wrong default.
&#160;&#160;&lt;/blockquote&gt;

&lt;p&gt;How do you &quot;know&quot; that a certain type already conforms both structurally and semantically? Aside from the most trivial of concepts, it&#039;s a significant amount of work to make sure that your type meets every single requirement of a particular concept. Testing that type with an algorithm or two doesn&#039;t really help, because not all algorithms use all of the requirements of the concept.&lt;/p&gt;

&lt;p&gt;I work on a C++ compiler (written in C++), and I was shocked at how many broken iterator types we had that were in continuous use: we&#039;re missing iterator_category&#039;s and &quot;pointer&quot; types and &quot;difference_type&quot;s and so on, sometimes we have bad return types for &lt;code&gt;operator++&lt;/code&gt;/&lt;code&gt;operator--&lt;/code&gt;, etc. These iterator types &quot;work&quot; with some templates, fail with others, etc., because they are wrong even though the author &quot;knew&quot; that the type conforms to the appropriate iterator concept.&lt;/p&gt;

&lt;p&gt;By writing a concept map, I know that I have met the syntactic requirements of a concept because the compiler has checked that for me. Anything less than that is a guess, and a hedge that things won&#039;t get changed in the future.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<blockquote cite="comment-285">

<strong><a href="#comment-285" rel="nofollow">Rizky Herucakra</a></strong>: 
Why isn’t BidirectionalIterator auto concept ?
 specifically, BidirectionalIterator does not have problem like ForwardIterator and InputIterator.</blockquote>

<p>It potentially has the same problem, since one could easily have a ForwardIterator with an <code>operator--</code> that doesn&#8217;t have the meaning required for it to be a BidirectionalIterator. However, we (as a community) have a lot of experience with the iterators, and such an type is rather unlikely. The BidirectionalIterator concept is so widely used that it&#8217;s possible it could be auto and it probably would never matter. However&#8230;</p>

<p>The decision to make a concept &#8220;auto&#8221; or not is something that&#8217;s generally done when we initially write the concept, before we&#8217;ve had the years of experience we have with iterators. Given that the ForwardIterator and InputIterator concepts <em>look</em> syntactically different, I&#8217;m willing to bet that many people would have made ForwardIterator &#8220;auto&#8221;. Then, after a bunch of code was written without concept maps, we&#8217;d hit the first istream_iterator instance and we would have a serious problem: ForwardIterator would have to become non-auto and now we have to write a bunch of concept maps to fix <em>existing</em> code. Concepts evolve over time, as we find more models of those concepts (&#8220;hey, we can provide iteration through a stream with this interface!&#8221;) that change our understanding of existing concepts and introduce new concepts (e.g., putting MultiPassInputIterator between InputIterator and ForwardIterator in the concept hierarchy). Non-auto concepts allow such seamless evolution, because the user has stated their intentions; auto concepts make evolution harder, because we have to guess at the intentions of users.</p>

<p>So, unless you&#8217;re dealing with some really simple syntactic concept, I would not make a concept auto.</p>

<blockquote>
 By not making it auto concept, we have to write concept_map with empty body since I already make my iterator class conform structurally (thus there is nothing to map).</blockquote>

<p>When you write your iterator class, you already make an explicit statement that your iterator conforms to the BidirectionalIterator concept. It looks like this:</p>

<div class="wp_syntax">
<div class="code">
<pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">typedef</span> std<span style="color: #008080;">::</span><span style="color: #007788;">bidirectional_iterator_tag</span> iterator_category<span style="color: #008080;">;</span></pre>
</div>
</div>

<p>A concept map is the same kind of statement, but a concept map actually has teeth: the compiler will check that assumption, to make sure you got all of the various operators and their variants declared correctly. Once you&#8217;ve been able to compile the concept map, you know that you&#8217;ve met the syntactic requirements of the concept, and there will be no surprises, either now (&#8220;why didn&#8217;t it pick the BidirectionalIterator overload over the InputIterator one? I could swear that I implemented all of the requirements of BidirectionalIterator&#8230;&#8221;) or later (&#8220;someone must have tweaked the interface to my iterator type, because now it&#8217;s failing to get used as a BidirectionalIterator&#8221;).</p>

<blockquote>
I personally like N2906, since it clarifies the role of concept and concept map.</blockquote>

<p>N2906 presents a different view of concept maps. It views concept maps more as a fix (when syntax doesn&#8217;t line up) or as a necessary evil (when we&#8217;re forced to use explicit refinement). I have a very different view: I view concept maps as a part of the generic programming process, documenting and enforcing the relationships between the types I write and the concepts they are meant to model.</p>

<blockquote>
I personally dislike having to write concept map if I know that certain type already conform both structurally and semantically to a concept. I think writing concept map should be reserved to a situation where there are concepts that has same syntactical requirement but different semantic requirement, and I think those kind of concepts are rare. By making concept not auto by default, I believe we choose the wrong default.
&nbsp;&nbsp;</blockquote>

<p>How do you &#8220;know&#8221; that a certain type already conforms both structurally and semantically? Aside from the most trivial of concepts, it&#8217;s a significant amount of work to make sure that your type meets every single requirement of a particular concept. Testing that type with an algorithm or two doesn&#8217;t really help, because not all algorithms use all of the requirements of the concept.</p>

<p>I work on a C++ compiler (written in C++), and I was shocked at how many broken iterator types we had that were in continuous use: we&#8217;re missing iterator_category&#8217;s and &#8220;pointer&#8221; types and &#8220;difference_type&#8221;s and so on, sometimes we have bad return types for <code>operator++</code>/<code>operator--</code>, etc. These iterator types &#8220;work&#8221; with some templates, fail with others, etc., because they are wrong even though the author &#8220;knew&#8221; that the type conforms to the appropriate iterator concept.</p>

<p>By writing a concept map, I know that I have met the syntactic requirements of a concept because the compiler has checked that for me. Anything less than that is a guess, and a hedge that things won&#8217;t get changed in the future.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Abrahams</title>
		<link>http://cpp-next.com/archive/2009/11/three-kinds-of-concept-maps/comment-page-1/#comment-287</link>
		<dc:creator>Dave Abrahams</dc:creator>
		<pubDate>Fri, 20 Nov 2009 07:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://cpp-next.com/?p=639#comment-287</guid>
		<description>&lt;blockquote cite=&quot;comment-285&quot;&gt;

&lt;strong&gt;&lt;a href=&quot;#comment-285&quot; rel=&quot;nofollow&quot;&gt;Rizky Herucakra&lt;/a&gt;&lt;/strong&gt;: Why isn’t BidirectionalIterator auto concept?
&lt;/blockquote&gt;

&lt;p&gt;I defer to Doug on the actual reasons, since he wrote the wording, but I can give you my opinion: because it doesn&#039;t need to be, and it wouldn&#039;t buy you much.&lt;/p&gt;

&lt;blockquote cite=&quot;comment-285&quot;&gt;
specifically, BidirectionalIterator does not have problem like ForwardIterator and InputIterator. 
&lt;/blockquote&gt;

&lt;p&gt;In principle, it does.  A ForwardIterator could masquerade as a BidirectionalIterator in exactly the same way as InputIterators often masquerade as ForwardIterators.  In practice, it&#039;s less likely to be an issue with BidirectionalIterator, since it is syntactically more distinguished from ForwardIterator than ForwardIterator is from InputIterator.  But it&#039;s just a question of degree.&lt;/p&gt;

&lt;blockquote cite=&quot;comment-285&quot;&gt;
By not making it auto concept, we have to write concept_map with empty body since I already make my iterator class conform structurally (thus there is nothing to map).
&lt;/blockquote&gt;

&lt;p&gt;I have two questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Were you planning to document somewhere that it&#039;s a BidirectionalIterator? &lt;/li&gt;
&lt;li&gt;Were you planning to embed an &lt;code&gt;iterator_category&lt;/code&gt; typedef?&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote cite=&quot;comment-285&quot;&gt;

I personally like N2906, since it clarifies the role of concept and concept map.
&lt;/blockquote&gt;

&lt;p&gt;Can you explain in what way it clarifies those roles?  Is that experience of clarification due to the changes N2906 would make to those roles, or simply to the paper&#039;s explanatory text? If the former, how did the specification sans-N2906 changes make those roles unclear?&lt;/p&gt;

&lt;blockquote cite=&quot;comment-285&quot;&gt;
I personally dislike having to write concept map if I know that certain type already conform both structurally and semantically to a concept.
&lt;/blockquote&gt;

&lt;p&gt;Okay, here&#039;s where this article is relevant.  Are you talking about trivial post-hoc mapping now?&lt;/p&gt;

&lt;blockquote cite=&quot;comment-285&quot;&gt;
I think writing concept map should be reserved to a situation where there are concepts that has same syntactical requirement but different semantic requirement, 
&lt;/blockquote&gt;

&lt;p&gt;Are you saying that concept maps should never be used in other situations, or that you should never be &lt;em&gt;forced&lt;/em&gt; to write concept maps in other situations, or something else?&lt;/p&gt;

&lt;p&gt;I assume you&#039;re just ignoring post-hoc adaptive mapping now, because if you ever want to do that, you need a concept map, &lt;code&gt;auto&lt;/code&gt; concept or not.&lt;/p&gt;

&lt;blockquote cite=&quot;comment-285&quot;&gt;
and I think those kind of concepts are rare. By making concept not auto by default, I believe we choose the wrong default.
&lt;/blockquote&gt;

&lt;p&gt;That is the argument made by N2906.&lt;sup id=&quot;fnref:bs&quot;&gt;&lt;a href=&quot;#fn:bs&quot; rel=&quot;footnote&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; It&#039;s an easy argument to understand.  The basis of countervailing arguments is much more subtle, and requires careful analysis of the different ways in which concepts and concept maps are used.  That&#039;s why we&#039;re running this article series.  Once you look at the issue with awareness of these distinctions, I think the imperative to make concepts &lt;code&gt;auto&lt;/code&gt; by default is far less compelling, but we need one more article to finish laying that groundwork.  Of course, by the end, you may still think concepts should be &lt;code&gt;auto&lt;/code&gt; by default, and that&#039;s fine.  In the meantime, I encourage you to try thinking about the issue in terms of the concept and concept map classifications we&#039;ve laid out, and see if it changes anything for you.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:bs&quot;&gt;
&lt;p&gt;N2906 suggests a much more radical remedy than changing the default, though, by proposing that non-&lt;code&gt;auto&lt;/code&gt; concepts be eliminated altogether.  That said, by introducing explicit refinement, it would allow the creation of something that acts exactly like a non-&lt;code&gt;auto&lt;/code&gt; concept, so it&#039;s hard for me to see the point of that change.&#160;&lt;a href=&quot;#fnref:bs&quot; rev=&quot;footnote&quot; rel=&quot;nofollow&quot;&gt;&#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<blockquote cite="comment-285">

<strong><a href="#comment-285" rel="nofollow">Rizky Herucakra</a></strong>: Why isn’t BidirectionalIterator auto concept?
</blockquote>

<p>I defer to Doug on the actual reasons, since he wrote the wording, but I can give you my opinion: because it doesn&#8217;t need to be, and it wouldn&#8217;t buy you much.</p>

<blockquote cite="comment-285">
specifically, BidirectionalIterator does not have problem like ForwardIterator and InputIterator. 
</blockquote>

<p>In principle, it does.  A ForwardIterator could masquerade as a BidirectionalIterator in exactly the same way as InputIterators often masquerade as ForwardIterators.  In practice, it&#8217;s less likely to be an issue with BidirectionalIterator, since it is syntactically more distinguished from ForwardIterator than ForwardIterator is from InputIterator.  But it&#8217;s just a question of degree.</p>

<blockquote cite="comment-285">
By not making it auto concept, we have to write concept_map with empty body since I already make my iterator class conform structurally (thus there is nothing to map).
</blockquote>

<p>I have two questions:</p>

<ol>
<li>Were you planning to document somewhere that it&#8217;s a BidirectionalIterator? </li>
<li>Were you planning to embed an <code>iterator_category</code> typedef?</li>
</ol>

<blockquote cite="comment-285">

I personally like N2906, since it clarifies the role of concept and concept map.
</blockquote>

<p>Can you explain in what way it clarifies those roles?  Is that experience of clarification due to the changes N2906 would make to those roles, or simply to the paper&#8217;s explanatory text? If the former, how did the specification sans-N2906 changes make those roles unclear?</p>

<blockquote cite="comment-285">
I personally dislike having to write concept map if I know that certain type already conform both structurally and semantically to a concept.
</blockquote>

<p>Okay, here&#8217;s where this article is relevant.  Are you talking about trivial post-hoc mapping now?</p>

<blockquote cite="comment-285">
I think writing concept map should be reserved to a situation where there are concepts that has same syntactical requirement but different semantic requirement, 
</blockquote>

<p>Are you saying that concept maps should never be used in other situations, or that you should never be <em>forced</em> to write concept maps in other situations, or something else?</p>

<p>I assume you&#8217;re just ignoring post-hoc adaptive mapping now, because if you ever want to do that, you need a concept map, <code>auto</code> concept or not.</p>

<blockquote cite="comment-285">
and I think those kind of concepts are rare. By making concept not auto by default, I believe we choose the wrong default.
</blockquote>

<p>That is the argument made by N2906.<sup id="fnref:bs"><a href="#fn:bs" rel="footnote" rel="nofollow">1</a></sup> It&#8217;s an easy argument to understand.  The basis of countervailing arguments is much more subtle, and requires careful analysis of the different ways in which concepts and concept maps are used.  That&#8217;s why we&#8217;re running this article series.  Once you look at the issue with awareness of these distinctions, I think the imperative to make concepts <code>auto</code> by default is far less compelling, but we need one more article to finish laying that groundwork.  Of course, by the end, you may still think concepts should be <code>auto</code> by default, and that&#8217;s fine.  In the meantime, I encourage you to try thinking about the issue in terms of the concept and concept map classifications we&#8217;ve laid out, and see if it changes anything for you.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:bs">
<p>N2906 suggests a much more radical remedy than changing the default, though, by proposing that non-<code>auto</code> concepts be eliminated altogether.  That said, by introducing explicit refinement, it would allow the creation of something that acts exactly like a non-<code>auto</code> concept, so it&#8217;s hard for me to see the point of that change.&#160;<a href="#fnref:bs" rev="footnote" rel="nofollow">&#8617;</a></p>
</li>

</ol>
</div>]]></content:encoded>
	</item>
</channel>
</rss>
