<?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: Variadic CRTP: An Opt-in for Class Features, at Compile Time	</title>
	<atom:link href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Tue, 14 Aug 2018 06:11:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1219</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Tue, 14 Aug 2018 06:11:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1219</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1216&quot;&gt;Carsten Ditzel&lt;/a&gt;.

Thanks! :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1216">Carsten Ditzel</a>.</p>
<p>Thanks! 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Carsten Ditzel		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1216</link>

		<dc:creator><![CDATA[Carsten Ditzel]]></dc:creator>
		<pubDate>Mon, 13 Aug 2018 07:56:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1216</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1214&quot;&gt;Jonathan Boccara&lt;/a&gt;.

thanks Jonathan. appreciate the conciseness and clarity of your blog. Keep up the good work]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1214">Jonathan Boccara</a>.</p>
<p>thanks Jonathan. appreciate the conciseness and clarity of your blog. Keep up the good work</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1214</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 12 Aug 2018 12:39:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1214</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1211&quot;&gt;Carsten Ditzel&lt;/a&gt;.

Given the implementation of ObjectCounter, I think indeed that this is the same idea as the one in this article. The Point gains the `live` method from ObjectCounter as one of its opt-in skills.
And yes at first glance I agree with you for the compile error of the Point class.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1211">Carsten Ditzel</a>.</p>
<p>Given the implementation of ObjectCounter, I think indeed that this is the same idea as the one in this article. The Point gains the `live` method from ObjectCounter as one of its opt-in skills.<br />
And yes at first glance I agree with you for the compile error of the Point class.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Carsten Ditzel		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1211</link>

		<dc:creator><![CDATA[Carsten Ditzel]]></dc:creator>
		<pubDate>Fri, 10 Aug 2018 09:01:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1211</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1209&quot;&gt;Jonathan Boccara&lt;/a&gt;.

___________________________________________________________
#include 
template
class ObjectCounter {
private:
inline static std::size_t count = 0; // number of existing objects
protected:
// default constructor
ObjectCounter() {
++count;
}
// copy constructor
ObjectCounter (ObjectCounter const&#038;) {
++count;
}
// move constructor
ObjectCounter (ObjectCounter &#038;&#038;) {
++count;
}
// destructor
~ObjectCounter() {
--count;
}
public:
// return number of existing objects:
static std::size_t live() {
return count;
}
};

However, I believe that there are errors in the Point code snippet, wouldn&#039;t you agree?
I think the first template parameter should be a template template parameter and the part in which Point passes itself up to its base classes should reflect that Point itself is a class template. The code as it is, does not compile on gcc 7.3, does it for you? I think it has to read 
__________________________________________________________
template&#060;template typename... Mixins&#062;
class Point : public Mixins&#060;Point&#062;...
{
public:
double x, y;
Point() : Mixins()..., x(0.0), y(0.0) { }
Point(double x, double y) : Mixins()..., x(x), y(y) { }
};]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1209">Jonathan Boccara</a>.</p>
<p>___________________________________________________________<br />
#include<br />
template<br />
class ObjectCounter {<br />
private:<br />
inline static std::size_t count = 0; // number of existing objects<br />
protected:<br />
// default constructor<br />
ObjectCounter() {<br />
++count;<br />
}<br />
// copy constructor<br />
ObjectCounter (ObjectCounter const&amp;) {<br />
++count;<br />
}<br />
// move constructor<br />
ObjectCounter (ObjectCounter &amp;&amp;) {<br />
++count;<br />
}<br />
// destructor<br />
~ObjectCounter() {<br />
&#8211;count;<br />
}<br />
public:<br />
// return number of existing objects:<br />
static std::size_t live() {<br />
return count;<br />
}<br />
};</p>
<p>However, I believe that there are errors in the Point code snippet, wouldn&#8217;t you agree?<br />
I think the first template parameter should be a template template parameter and the part in which Point passes itself up to its base classes should reflect that Point itself is a class template. The code as it is, does not compile on gcc 7.3, does it for you? I think it has to read<br />
__________________________________________________________<br />
template&lt;template typename&#8230; Mixins&gt;<br />
class Point : public Mixins&lt;Point&gt;&#8230;<br />
{<br />
public:<br />
double x, y;<br />
Point() : Mixins()&#8230;, x(0.0), y(0.0) { }<br />
Point(double x, double y) : Mixins()&#8230;, x(x), y(y) { }<br />
};</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Carsten Ditzel		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1210</link>

		<dc:creator><![CDATA[Carsten Ditzel]]></dc:creator>
		<pubDate>Fri, 10 Aug 2018 07:55:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1210</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1209&quot;&gt;Jonathan Boccara&lt;/a&gt;.

of course, 
_________________________________________________________________
template
class ObjectCounter {
private:
inline static std::size_t count = 0; // number of existing objects
protected:
// default constructor
ObjectCounter() {
++count;
}
// copy constructor
ObjectCounter (ObjectCounter const&#038;) {
++count;
}
// move constructor
ObjectCounter (ObjectCounter &#038;&#038;) {
++count;
}
// destructor
~ObjectCounter() {
--count;
}
public:
// return number of existing objects:
static std::size_t live() {
return count;
}
};
______________________________________________________________

However, despite the similarity between the Point snippet and your variadic crtp, I believe, that there are mistakes in the point code, wouldnt you agree? At least on gcc7.3 it does not compile for reasons of, what I think are, a missing template template parameter and a missing ellipsis in the expression when point passes itself as a template parameter to its base class]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1209">Jonathan Boccara</a>.</p>
<p>of course,<br />
_________________________________________________________________<br />
template<br />
class ObjectCounter {<br />
private:<br />
inline static std::size_t count = 0; // number of existing objects<br />
protected:<br />
// default constructor<br />
ObjectCounter() {<br />
++count;<br />
}<br />
// copy constructor<br />
ObjectCounter (ObjectCounter const&amp;) {<br />
++count;<br />
}<br />
// move constructor<br />
ObjectCounter (ObjectCounter &amp;&amp;) {<br />
++count;<br />
}<br />
// destructor<br />
~ObjectCounter() {<br />
&#8211;count;<br />
}<br />
public:<br />
// return number of existing objects:<br />
static std::size_t live() {<br />
return count;<br />
}<br />
};<br />
______________________________________________________________</p>
<p>However, despite the similarity between the Point snippet and your variadic crtp, I believe, that there are mistakes in the point code, wouldnt you agree? At least on gcc7.3 it does not compile for reasons of, what I think are, a missing template template parameter and a missing ellipsis in the expression when point passes itself as a template parameter to its base class</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1209</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Thu, 09 Aug 2018 23:02:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1209</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1208&quot;&gt;Carsten Ditzel&lt;/a&gt;.

At first glance it does look like the curious mixin indeed.
Would you have the code of ObjectCounter please, to make sure I understand how this example works?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1208">Carsten Ditzel</a>.</p>
<p>At first glance it does look like the curious mixin indeed.<br />
Would you have the code of ObjectCounter please, to make sure I understand how this example works?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Carsten Ditzel		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1208</link>

		<dc:creator><![CDATA[Carsten Ditzel]]></dc:creator>
		<pubDate>Thu, 09 Aug 2018 12:06:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1208</guid>

					<description><![CDATA[Let me start of by saying that I love your blog and appreciate the work you put into this webpage.

As to the topic at hand: I wonder if this variadic crtp that you elaborated on is in fact the very same thing than the so called &quot;curious mixin&quot; described in http://tmplbook.com/. 

__________________________________________________________
Mixins can be made more powerful by combining them with the Curiously
Recurring Template Pattern (CRTP) .
Here, each of the mixins is actually a class template that will be provided with
the type of the derived class, allowing additional customization to that derived
class. A CRTP-mixin version of Point would be written as follows: 

template&#060;template... Mixins&#062;
class Point : public Mixins...
{
public:
double x, y;
Point() : Mixins()..., x(0.0), y(0.0) { }
Point(double x, double y) : Mixins()..., x(x), y(y) { }
};

This formulation requires some more work for each class that will be mixed in,
so classes such as Label and Color will need to become class templates.
However, the mixed-in classes can now tailor their behavior to the specific
instance of the derived class they’ve been mixed into. For example, we can mix
the previously discussed ObjectCounter template into Point to count the
number of points created by Polygon and compose that mixin with other
application-specific mixins as well.
___________________________________________________________________

What is your opinion on this matter?]]></description>
			<content:encoded><![CDATA[<p>Let me start of by saying that I love your blog and appreciate the work you put into this webpage.</p>
<p>As to the topic at hand: I wonder if this variadic crtp that you elaborated on is in fact the very same thing than the so called &#8220;curious mixin&#8221; described in <a href="http://tmplbook.com/" rel="nofollow ugc">http://tmplbook.com/</a>. </p>
<p>__________________________________________________________<br />
Mixins can be made more powerful by combining them with the Curiously<br />
Recurring Template Pattern (CRTP) .<br />
Here, each of the mixins is actually a class template that will be provided with<br />
the type of the derived class, allowing additional customization to that derived<br />
class. A CRTP-mixin version of Point would be written as follows: </p>
<p>template&lt;template&#8230; Mixins&gt;<br />
class Point : public Mixins&#8230;<br />
{<br />
public:<br />
double x, y;<br />
Point() : Mixins()&#8230;, x(0.0), y(0.0) { }<br />
Point(double x, double y) : Mixins()&#8230;, x(x), y(y) { }<br />
};</p>
<p>This formulation requires some more work for each class that will be mixed in,<br />
so classes such as Label and Color will need to become class templates.<br />
However, the mixed-in classes can now tailor their behavior to the specific<br />
instance of the derived class they’ve been mixed into. For example, we can mix<br />
the previously discussed ObjectCounter template into Point to count the<br />
number of points created by Polygon and compose that mixin with other<br />
application-specific mixins as well.<br />
___________________________________________________________________</p>
<p>What is your opinion on this matter?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nicolas Mellado		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1178</link>

		<dc:creator><![CDATA[Nicolas Mellado]]></dc:creator>
		<pubDate>Fri, 27 Jul 2018 12:42:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1178</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1177&quot;&gt;Jonathan Boccara&lt;/a&gt;.

I like this one better, it&#039;s self contained.
Of course I guess it depends on the application case.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1177">Jonathan Boccara</a>.</p>
<p>I like this one better, it&#8217;s self contained.<br />
Of course I guess it depends on the application case.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1177</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Fri, 27 Jul 2018 12:25:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1177</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1175&quot;&gt;Nicolas Mellado&lt;/a&gt;.

Thank you for the great question!
I have another solution to work around the issue: http://coliru.stacked-crooked.com/a/86a8338eba2f17c1
And yes, that&#039;s a good topic for another post :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1175">Nicolas Mellado</a>.</p>
<p>Thank you for the great question!<br />
I have another solution to work around the issue: <a href="http://coliru.stacked-crooked.com/a/86a8338eba2f17c1" rel="nofollow ugc">http://coliru.stacked-crooked.com/a/86a8338eba2f17c1</a><br />
And yes, that&#8217;s a good topic for another post 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nicolas Mellado		</title>
		<link>https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1175</link>

		<dc:creator><![CDATA[Nicolas Mellado]]></dc:creator>
		<pubDate>Fri, 27 Jul 2018 11:56:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3858#comment-1175</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1170&quot;&gt;Jonathan Boccara&lt;/a&gt;.

Great !
Thanks a lot Jonathan.
All these improvements deserve a new post ;)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/06/22/variadic-crtp-opt-in-for-class-features-at-compile-time/#comment-1170">Jonathan Boccara</a>.</p>
<p>Great !<br />
Thanks a lot Jonathan.<br />
All these improvements deserve a new post 😉</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
