<?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 Handle Multiple Types in Max Without A Cast	</title>
	<atom:link href="https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Mon, 18 Sep 2017 07:13:54 +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/2017/08/18/handle-multiple-types-max-without-cast/#comment-496</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 20 Aug 2017 20:58:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1443#comment-496</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-495&quot;&gt;Björn Fahller&lt;/a&gt;.

After experimentation and asking for opinions (including Arthur&#039;s) I believe there is no undefined behaviour here, because the temporary created by the implicit conversion lives until the end of the full expression, and this includes the copy into the object that receives the result of std::max.
You can have a look at &lt;a href=&quot;http://coliru.stacked-crooked.com/a/b0c544c55667cca6&quot; rel=&quot;nofollow&quot;&gt;this code&lt;/a&gt; that I put together to illustrate it.
Thanks for rising this point anyway, it&#039;s a really good question.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-495">Björn Fahller</a>.</p>
<p>After experimentation and asking for opinions (including Arthur&#8217;s) I believe there is no undefined behaviour here, because the temporary created by the implicit conversion lives until the end of the full expression, and this includes the copy into the object that receives the result of std::max.<br />
You can have a look at <a href="http://coliru.stacked-crooked.com/a/b0c544c55667cca6" rel="nofollow">this code</a> that I put together to illustrate it.<br />
Thanks for rising this point anyway, it&#8217;s a really good question.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Björn Fahller		</title>
		<link>https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-495</link>

		<dc:creator><![CDATA[Björn Fahller]]></dc:creator>
		<pubDate>Fri, 18 Aug 2017 11:53:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1443#comment-495</guid>

					<description><![CDATA[Wait a minute don&#039;t these calls to max() return a reference to a temporary? The result of f() is a short. A temporary int is implicitly created to bind to the const&#038; parameter. That parameter is then returned by reference.]]></description>
			<content:encoded><![CDATA[<p>Wait a minute don&#8217;t these calls to max() return a reference to a temporary? The result of f() is a short. A temporary int is implicitly created to bind to the const&amp; parameter. That parameter is then returned by reference.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-494</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Fri, 18 Aug 2017 09:56:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1443#comment-494</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-493&quot;&gt;rr0ki&lt;/a&gt;.

Thanks for sharing this rr0ki!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-493">rr0ki</a>.</p>
<p>Thanks for sharing this rr0ki!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: rr0ki		</title>
		<link>https://www.fluentcpp.com/2017/08/18/handle-multiple-types-max-without-cast/#comment-493</link>

		<dc:creator><![CDATA[rr0ki]]></dc:creator>
		<pubDate>Fri, 18 Aug 2017 09:35:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1443#comment-493</guid>

					<description><![CDATA[It is the good article to match in a season :)

This may be a bit redundant but I think that using std::common_type may lead to expressive code in specifying the type explicitly.

std::max&#060;std::common_type_t&#062;(f(),x);]]></description>
			<content:encoded><![CDATA[<p>It is the good article to match in a season 🙂</p>
<p>This may be a bit redundant but I think that using std::common_type may lead to expressive code in specifying the type explicitly.</p>
<p>std::max&lt;std::common_type_t&gt;(f(),x);</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
