<?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: &#8220;auto to stick&#8221; and Changing Your Style	</title>
	<atom:link href="https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Fri, 16 Nov 2018 13:24:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.4</generator>
	<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1470</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Fri, 16 Nov 2018 13:24:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1470</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1466&quot;&gt;Florian Schmidt&lt;/a&gt;.

Yes! Well spotted Florian, this is now fixed. Thanks!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1466">Florian Schmidt</a>.</p>
<p>Yes! Well spotted Florian, this is now fixed. Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Florian Schmidt		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1466</link>

		<dc:creator><![CDATA[Florian Schmidt]]></dc:creator>
		<pubDate>Thu, 15 Nov 2018 14:38:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1466</guid>

					<description><![CDATA[Thanks for this informative post, I have a question on

auto X = x(); // no way to interpret this as a function declaration

Is it possible you switched type X and variable name x, or did I miss something?]]></description>
			<content:encoded><![CDATA[<p>Thanks for this informative post, I have a question on</p>
<p>auto X = x(); // no way to interpret this as a function declaration</p>
<p>Is it possible you switched type X and variable name x, or did I miss something?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1443</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Thu, 08 Nov 2018 11:54:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1443</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1431&quot;&gt;Mateus Furquim&lt;/a&gt;.

Yes it is using braces initialization, here is an &lt;a href=&quot;http://coliru.stacked-crooked.com/a/7a7be2e5c9153460&quot; rel=&quot;nofollow&quot;&gt;example&lt;/a&gt; that compiles.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1431">Mateus Furquim</a>.</p>
<p>Yes it is using braces initialization, here is an <a href="http://coliru.stacked-crooked.com/a/7a7be2e5c9153460" rel="nofollow">example</a> that compiles.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mateus Furquim		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1431</link>

		<dc:creator><![CDATA[Mateus Furquim]]></dc:creator>
		<pubDate>Thu, 01 Nov 2018 00:34:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1431</guid>

					<description><![CDATA[s this line of code in the post correct?
`auto name = std::string{&quot;Arthur&quot;};`
It is using `{` instead of `(`.]]></description>
			<content:encoded><![CDATA[<p>s this line of code in the post correct?<br />
`auto name = std::string{&#8220;Arthur&#8221;};`<br />
It is using `{` instead of `(`.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Akim Demaille		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1418</link>

		<dc:creator><![CDATA[Akim Demaille]]></dc:creator>
		<pubDate>Sat, 27 Oct 2018 12:50:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1418</guid>

					<description><![CDATA[I&#039;m using auto almost always.  And I also use const almost always: I love to see when &quot;variables&quot; are actually just constants.  The compiler knows by reading the code, but the newcomers arriving to a piece of code have an immediate benefit to see that a variable is actually just a convenient name for a value rather than a location in memory.

So my wildest dream in C++ would be to no longer write auto, but _only_ const.

```
const myWidget = Widget{42};
const end = vector.end();


const client = [&#038;]
  {
    auto peers = Peers{};
    peers.emplace_back(std::make_unique&#060;UnavailablePeer&#062;(11));
    peers.emplace_back(std::make_unique&#060;Peer&#062;(12, servers[1]));
    peers.emplace_back(std::make_unique&#060;Peer&#062;(13, servers[2]));
    return paxos::Client(3, std::move(peers));
  }();```

etc.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using auto almost always.  And I also use const almost always: I love to see when &#8220;variables&#8221; are actually just constants.  The compiler knows by reading the code, but the newcomers arriving to a piece of code have an immediate benefit to see that a variable is actually just a convenient name for a value rather than a location in memory.</p>
<p>So my wildest dream in C++ would be to no longer write auto, but _only_ const.</p>
<p>&#8220;`<br />
const myWidget = Widget{42};<br />
const end = vector.end();</p>
<p>const client = [&amp;]<br />
  {<br />
    auto peers = Peers{};<br />
    peers.emplace_back(std::make_unique&lt;UnavailablePeer&gt;(11));<br />
    peers.emplace_back(std::make_unique&lt;Peer&gt;(12, servers[1]));<br />
    peers.emplace_back(std::make_unique&lt;Peer&gt;(13, servers[2]));<br />
    return paxos::Client(3, std::move(peers));<br />
  }();&#8220;`</p>
<p>etc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Oleksandr Prokopenko		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1384</link>

		<dc:creator><![CDATA[Oleksandr Prokopenko]]></dc:creator>
		<pubDate>Thu, 11 Oct 2018 10:14:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1384</guid>

					<description><![CDATA[float x = 42;
is more self-documentary. And using this argument, in five years your colleague will refactor the same line of code by replacing auto with generic Number:
Number  x = 42.f;
float-&#062;auto-&#062;Number... I am wondering you have enough time to keep your code base up with this &#039;marketing&#039; of auto.]]></description>
			<content:encoded><![CDATA[<p>float x = 42;<br />
is more self-documentary. And using this argument, in five years your colleague will refactor the same line of code by replacing auto with generic Number:<br />
Number  x = 42.f;<br />
float-&gt;auto-&gt;Number&#8230; I am wondering you have enough time to keep your code base up with this &#8216;marketing&#8217; of auto.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aymen Schehaider		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1353</link>

		<dc:creator><![CDATA[Aymen Schehaider]]></dc:creator>
		<pubDate>Tue, 02 Oct 2018 09:50:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1353</guid>

					<description><![CDATA[Yeah Ready to adopt &quot;auto to stick&quot;  at work.]]></description>
			<content:encoded><![CDATA[<p>Yeah Ready to adopt &#8220;auto to stick&#8221;  at work.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Paul Cook		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1351</link>

		<dc:creator><![CDATA[Paul Cook]]></dc:creator>
		<pubDate>Tue, 02 Oct 2018 05:31:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1351</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1339&quot;&gt;Furkan Üzümcü&lt;/a&gt;.

I thought that. The user would have accidentally written

auto x - 42.;

and accidentally declared a double instead of a float, which would cause all sorts of potential confusion.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1339">Furkan Üzümcü</a>.</p>
<p>I thought that. The user would have accidentally written</p>
<p>auto x &#8211; 42.;</p>
<p>and accidentally declared a double instead of a float, which would cause all sorts of potential confusion.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Paul Cook		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1350</link>

		<dc:creator><![CDATA[Paul Cook]]></dc:creator>
		<pubDate>Tue, 02 Oct 2018 05:28:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1350</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1347&quot;&gt;Rud Merriam&lt;/a&gt;.

Simple answer - scope overloading:

Your proposed syntax:

x = 20;

void f()
{
    x = 10; // do I mean to change outer x or declare a new variable?
}]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1347">Rud Merriam</a>.</p>
<p>Simple answer &#8211; scope overloading:</p>
<p>Your proposed syntax:</p>
<p>x = 20;</p>
<p>void f()<br />
{<br />
    x = 10; // do I mean to change outer x or declare a new variable?<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shafik Yaghmour		</title>
		<link>https://www.fluentcpp.com/2018/09/28/auto-stick-changing-style/#comment-1349</link>

		<dc:creator><![CDATA[Shafik Yaghmour]]></dc:creator>
		<pubDate>Mon, 01 Oct 2018 23:18:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3022#comment-1349</guid>

					<description><![CDATA[Note

        float x = 42.;

Is not a narrowing conversion because it is a constant expression that after conversion can fit into the range of the destination after conversion. See [dcl.init.list]p7.2 http://eel.is/c++draft/dcl.init.list#7.2]]></description>
			<content:encoded><![CDATA[<p>Note</p>
<p>        float x = 42.;</p>
<p>Is not a narrowing conversion because it is a constant expression that after conversion can fit into the range of the destination after conversion. See [dcl.init.list]p7.2 <a href="http://eel.is/c++draft/dcl.init.list#7.2" rel="nofollow ugc">http://eel.is/c++draft/dcl.init.list#7.2</a></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
