<?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: The Curiously Recurring Template Pattern (CRTP)	</title>
	<atom:link href="https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Mon, 18 Sep 2017 07:15:49 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.4</generator>
	<item>
		<title>
		By: Vladislav Kaplan		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-294</link>

		<dc:creator><![CDATA[Vladislav Kaplan]]></dc:creator>
		<pubDate>Tue, 23 May 2017 07:05:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-294</guid>

					<description><![CDATA[Thank you]]></description>
			<content:encoded><![CDATA[<p>Thank you</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-287</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 21 May 2017 09:58:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-287</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-286&quot;&gt;Martin Moene&lt;/a&gt;.

Cheers, done.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-286">Martin Moene</a>.</p>
<p>Cheers, done.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin Moene		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-286</link>

		<dc:creator><![CDATA[Martin Moene]]></dc:creator>
		<pubDate>Sat, 20 May 2017 14:24:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-286</guid>

					<description><![CDATA[s/itslef/itself/]]></description>
			<content:encoded><![CDATA[<p>s/itslef/itself/</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marek Kurdej		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-274</link>

		<dc:creator><![CDATA[Marek Kurdej]]></dc:creator>
		<pubDate>Mon, 15 May 2017 07:31:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-274</guid>

					<description><![CDATA[I was thinking about the last problem you mentioned: method hiding. It&#039;s maybe not the best solution, but you could have declared `doSomething()` in Base class as final (which implies virtual as well). Then, if you happen to override a function in a derived class, you&#039;ll get a message like &quot;error: overriding final function &#039;void Base::doSomething() [with T = Derived]&#039;&quot;. Hopefully, the compiler will not add any overhead beacause of the virtual function, as it is final and not really virtual in practice.]]></description>
			<content:encoded><![CDATA[<p>I was thinking about the last problem you mentioned: method hiding. It&#8217;s maybe not the best solution, but you could have declared `doSomething()` in Base class as final (which implies virtual as well). Then, if you happen to override a function in a derived class, you&#8217;ll get a message like &#8220;error: overriding final function &#8216;void Base::doSomething() [with T = Derived]'&#8221;. Hopefully, the compiler will not add any overhead beacause of the virtual function, as it is final and not really virtual in practice.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-272</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 14 May 2017 00:27:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-272</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-267&quot;&gt;Theldoria&lt;/a&gt;.

Yep good point, and adding the class keyword doesn&#039;t even fix it since template classes could not be befriended.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-267">Theldoria</a>.</p>
<p>Yep good point, and adding the class keyword doesn&#8217;t even fix it since template classes could not be befriended.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James Coplien		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-270</link>

		<dc:creator><![CDATA[James Coplien]]></dc:creator>
		<pubDate>Fri, 12 May 2017 18:30:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-270</guid>

					<description><![CDATA[See the original C++ Report article at: https://3aec1b23-a-eadc3f87-s-sites.googlegroups.com/a/gertrudandcope.com/info/Publications/InheritedTemplate.pdf]]></description>
			<content:encoded><![CDATA[<p>See the original C++ Report article at: <a href="https://3aec1b23-a-eadc3f87-s-sites.googlegroups.com/a/gertrudandcope.com/info/Publications/InheritedTemplate.pdf" rel="nofollow ugc">https://3aec1b23-a-eadc3f87-s-sites.googlegroups.com/a/gertrudandcope.com/info/Publications/InheritedTemplate.pdf</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Theldoria		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-267</link>

		<dc:creator><![CDATA[Theldoria]]></dc:creator>
		<pubDate>Fri, 12 May 2017 12:55:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-267</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-266&quot;&gt;Jonathan Boccara&lt;/a&gt;.

Note that this trick does not wok in C++03:

   error: in C++03 a class-key must be used when declaring a friend [-Werror=pedantic]
       friend T;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-266">Jonathan Boccara</a>.</p>
<p>Note that this trick does not wok in C++03:</p>
<p>   error: in C++03 a class-key must be used when declaring a friend [-Werror=pedantic]<br />
       friend T;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-266</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Fri, 12 May 2017 12:27:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-266</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-265&quot;&gt;Marek Kurdej&lt;/a&gt;.

Very cool. The reason why I didn&#039;t mention this technique is that... I didn&#039;t know it! :) Thanks a lot for sharing Marek. I&#039;ll include this in the post right away!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-265">Marek Kurdej</a>.</p>
<p>Very cool. The reason why I didn&#8217;t mention this technique is that&#8230; I didn&#8217;t know it! 🙂 Thanks a lot for sharing Marek. I&#8217;ll include this in the post right away!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marek Kurdej		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-265</link>

		<dc:creator><![CDATA[Marek Kurdej]]></dc:creator>
		<pubDate>Fri, 12 May 2017 09:05:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-265</guid>

					<description><![CDATA[Hi Jonathan,
While talking about the possible error of writing `class Derived2 : public Base`, you might have talked about the solution for this problem. Namely, you can declare the base class as: 

```
template 
class Base {
    friend T;
    Base() {}
};
```

Base&#039;s constructor is private, but derived class is a friend so e.g. in `Base` will allow only `Derived1` (but not `Derived2`) to access its constructor. Otherwise (if you commit the error mentioned above), you&#039;d get an error similar to `error: use of deleted function &#039;Derived2::Derived2()&#039;.]]></description>
			<content:encoded><![CDATA[<p>Hi Jonathan,<br />
While talking about the possible error of writing `class Derived2 : public Base`, you might have talked about the solution for this problem. Namely, you can declare the base class as: </p>
<p>&#8220;`<br />
template<br />
class Base {<br />
    friend T;<br />
    Base() {}<br />
};<br />
&#8220;`</p>
<p>Base&#8217;s constructor is private, but derived class is a friend so e.g. in `Base` will allow only `Derived1` (but not `Derived2`) to access its constructor. Otherwise (if you commit the error mentioned above), you&#8217;d get an error similar to `error: use of deleted function &#8216;Derived2::Derived2()&#8217;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-264</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Fri, 12 May 2017 08:37:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=736#comment-264</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-263&quot;&gt;Paul Cook&lt;/a&gt;.

Thanks Paul, tune in on Tuesday morning then!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/#comment-263">Paul Cook</a>.</p>
<p>Thanks Paul, tune in on Tuesday morning then!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
