<?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 Flatten Out A Nested Switch Statement	</title>
	<atom:link href="https://www.fluentcpp.com/2017/06/27/how-to-collapse-nested-switch-statements/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/06/27/how-to-collapse-nested-switch-statements/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Fri, 01 Jun 2018 13:58: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: jft		</title>
		<link>https://www.fluentcpp.com/2017/06/27/how-to-collapse-nested-switch-statements/#comment-1032</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Fri, 01 Jun 2018 13:58:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1309#comment-1032</guid>

					<description><![CDATA[Another way to consider is to have a lambda for each combination required and to use an associative container (eg map) to provide the association between the permitted combinations and the lambda. Consider

http://coliru.stacked-crooked.com/a/923e1eac7f99dbad

In this example, an unordered_map could be used but a hash function would need to be provided.....

Whilst this idea can be extended pretty much as needed, the mapping initialisation could become rather unwieldy and time-consuming. That is why it is marked as const static so that the initialisation only takes place the first time process() is called. Also the lambda&#039;s are const static as well so they are only initialised once. [Anything that is marked const at the beginning of a function (and cannot be constexpr) can also usually be const static so that initialisation is done only once and not once per call].]]></description>
			<content:encoded><![CDATA[<p>Another way to consider is to have a lambda for each combination required and to use an associative container (eg map) to provide the association between the permitted combinations and the lambda. Consider</p>
<p><a href="http://coliru.stacked-crooked.com/a/923e1eac7f99dbad" rel="nofollow ugc">http://coliru.stacked-crooked.com/a/923e1eac7f99dbad</a></p>
<p>In this example, an unordered_map could be used but a hash function would need to be provided&#8230;..</p>
<p>Whilst this idea can be extended pretty much as needed, the mapping initialisation could become rather unwieldy and time-consuming. That is why it is marked as const static so that the initialisation only takes place the first time process() is called. Also the lambda&#8217;s are const static as well so they are only initialised once. [Anything that is marked const at the beginning of a function (and cannot be constexpr) can also usually be const static so that initialisation is done only once and not once per call].</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: carlo locci		</title>
		<link>https://www.fluentcpp.com/2017/06/27/how-to-collapse-nested-switch-statements/#comment-368</link>

		<dc:creator><![CDATA[carlo locci]]></dc:creator>
		<pubDate>Tue, 27 Jun 2017 07:49:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1309#comment-368</guid>

					<description><![CDATA[Very interesting, thanks for sharing...]]></description>
			<content:encoded><![CDATA[<p>Very interesting, thanks for sharing&#8230;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
