<?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 Use Tag Dispatching In Your Code Effectively	</title>
	<atom:link href="https://www.fluentcpp.com/2018/04/27/tag-dispatching/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Tue, 01 May 2018 11:46: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: nivenfres		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-952</link>

		<dc:creator><![CDATA[nivenfres]]></dc:creator>
		<pubDate>Tue, 01 May 2018 11:46:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-952</guid>

					<description><![CDATA[I actually started doing this to make constexpr and non-constexpr versions of functions (since they can&#039;t co-exist with the same name).  I added a use_constexpr{}, so I could explicitly call the constexpr one when I needed to.]]></description>
			<content:encoded><![CDATA[<p>I actually started doing this to make constexpr and non-constexpr versions of functions (since they can&#8217;t co-exist with the same name).  I added a use_constexpr{}, so I could explicitly call the constexpr one when I needed to.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-951</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Mon, 30 Apr 2018 11:41:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-951</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-946&quot;&gt;Krzysztow&lt;/a&gt;.

Yep, agreed, I find this reasonable too. The constructor arguably has a little edge over the method to express that it constructs the object, what do you think?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-946">Krzysztow</a>.</p>
<p>Yep, agreed, I find this reasonable too. The constructor arguably has a little edge over the method to express that it constructs the object, what do you think?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vincent Zalzal		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-950</link>

		<dc:creator><![CDATA[Vincent Zalzal]]></dc:creator>
		<pubDate>Mon, 30 Apr 2018 10:51:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-950</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-949&quot;&gt;Florian Wolters&lt;/a&gt;.

I haven&#039;t read that book, I may give it a go! Thanks.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-949">Florian Wolters</a>.</p>
<p>I haven&#8217;t read that book, I may give it a go! Thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Florian Wolters		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-949</link>

		<dc:creator><![CDATA[Florian Wolters]]></dc:creator>
		<pubDate>Mon, 30 Apr 2018 09:01:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-949</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-947&quot;&gt;Vincent Zalzal&lt;/a&gt;.

It has a name already: Creation Method (refer to the Implementation Patterns book by Kent Beck). Do no use the GoF OOP design pattern name Factory Method for it, imo. Some people call this kind of static class function Static Factory Method, though I think that term should be avoided. This has almost nothing to do with the OOP pattern, despite the fact that an instance of a class is created. The OOP pattern applies DI to the Factory class, to decouple object creation.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-947">Vincent Zalzal</a>.</p>
<p>It has a name already: Creation Method (refer to the Implementation Patterns book by Kent Beck). Do no use the GoF OOP design pattern name Factory Method for it, imo. Some people call this kind of static class function Static Factory Method, though I think that term should be avoided. This has almost nothing to do with the OOP pattern, despite the fact that an instance of a class is created. The OOP pattern applies DI to the Factory class, to decouple object creation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vincent Zalzal		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-948</link>

		<dc:creator><![CDATA[Vincent Zalzal]]></dc:creator>
		<pubDate>Sat, 28 Apr 2018 17:27:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-948</guid>

					<description><![CDATA[About the STL, I think the natural choice to handle different implementations would have been the use of Concepts. Even in the old SGI documentation way back in 1997-98, the word concept was already used to describe the type of iterators (and other things). Unfortunately, we still don&#039;t have standard concepts :(

I don&#039;t know what is the currently proposed syntax, but an example of implementation for std::advance could be:
&lt;pre&gt;&lt;code&gt;
template &#060;ForwardIterator Iterator, typename Distance&#062;
void advance(Iterator&#038; it, Distance n)
{
    while (--n &#062;= 0)
        ++it;
}
 
template &#060;RandomAccessIterator Iterator, typename Distance&#062;
void advance(Iterator&#038; it, Distance n)
{
    it += n;
}
&lt;/code&gt;&lt;/pre&gt;

We can do something similar with SFINAE (e.g. with std::enable_if), but the syntax gets ugly real quick.]]></description>
			<content:encoded><![CDATA[<p>About the STL, I think the natural choice to handle different implementations would have been the use of Concepts. Even in the old SGI documentation way back in 1997-98, the word concept was already used to describe the type of iterators (and other things). Unfortunately, we still don&#8217;t have standard concepts 🙁</p>
<p>I don&#8217;t know what is the currently proposed syntax, but an example of implementation for std::advance could be:</p>
<pre><code>
template &lt;ForwardIterator Iterator, typename Distance&gt;
void advance(Iterator&amp; it, Distance n)
{
    while (--n &gt;= 0)
        ++it;
}
 
template &lt;RandomAccessIterator Iterator, typename Distance&gt;
void advance(Iterator&amp; it, Distance n)
{
    it += n;
}
</code></pre>
<p>We can do something similar with SFINAE (e.g. with std::enable_if), but the syntax gets ugly real quick.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vincent Zalzal		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-947</link>

		<dc:creator><![CDATA[Vincent Zalzal]]></dc:creator>
		<pubDate>Sat, 28 Apr 2018 17:15:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-947</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-946&quot;&gt;Krzysztow&lt;/a&gt;.

When I can, I use the &quot;static constructor&quot; technique too. I call it &quot;factory method&quot; though, even if it is stretching the definition a little. I use this syntax, which doesn&#039;t repeat MyClass:
&lt;pre&gt;&lt;code&gt;
auto x = MyClass::makeThatWay();
&lt;/code&gt;&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-946">Krzysztow</a>.</p>
<p>When I can, I use the &#8220;static constructor&#8221; technique too. I call it &#8220;factory method&#8221; though, even if it is stretching the definition a little. I use this syntax, which doesn&#8217;t repeat MyClass:</p>
<pre><code>
auto x = MyClass::makeThatWay();
</code></pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Krzysztow		</title>
		<link>https://www.fluentcpp.com/2018/04/27/tag-dispatching/#comment-946</link>

		<dc:creator><![CDATA[Krzysztow]]></dc:creator>
		<pubDate>Fri, 27 Apr 2018 09:29:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1777#comment-946</guid>

					<description><![CDATA[Hi. Thanks for a post, as always useful. What about using static constructors? With compiler return value optimization, there shouldn&#039;t be any performance hit.

Then	

MyClassM  x(MyClass::constructThatWay);

Would become:
	
MyClassM  x(MyClass::constructThatWay());

Thanks.]]></description>
			<content:encoded><![CDATA[<p>Hi. Thanks for a post, as always useful. What about using static constructors? With compiler return value optimization, there shouldn&#8217;t be any performance hit.</p>
<p>Then	</p>
<p>MyClassM  x(MyClass::constructThatWay);</p>
<p>Would become:</p>
<p>MyClassM  x(MyClass::constructThatWay());</p>
<p>Thanks.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
