<?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 Convert a String to an int in C++	</title>
	<atom:link href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Sun, 06 Jan 2019 10:47:07 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: JIm Anderson		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1236</link>

		<dc:creator><![CDATA[JIm Anderson]]></dc:creator>
		<pubDate>Mon, 20 Aug 2018 12:59:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1236</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1235&quot;&gt;jft&lt;/a&gt;.

Fair enough!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1235">jft</a>.</p>
<p>Fair enough!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1235</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Mon, 20 Aug 2018 12:04:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1235</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1232&quot;&gt;JIm Anderson&lt;/a&gt;.

&quot;The if statement in the middle is horribly unreadable, and, as near as I
 can tell, for no good reason.   Granted, putting the decl of `n` inside
 the if statement limits the scope of the variable, but that seems like a
 tiny gain.  Jamming three lines together seems unreadable.&quot;


To quote a famous saying... One person&#039;s meat is another person&#039;s poison... :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1232">JIm Anderson</a>.</p>
<p>&#8220;The if statement in the middle is horribly unreadable, and, as near as I<br />
 can tell, for no good reason.   Granted, putting the decl of `n` inside<br />
 the if statement limits the scope of the variable, but that seems like a<br />
 tiny gain.  Jamming three lines together seems unreadable.&#8221;</p>
<p>To quote a famous saying&#8230; One person&#8217;s meat is another person&#8217;s poison&#8230; 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JIm Anderson		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1232</link>

		<dc:creator><![CDATA[JIm Anderson]]></dc:creator>
		<pubDate>Sat, 18 Aug 2018 20:48:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1232</guid>

					<description><![CDATA[Thanks for the aritcle.  It was interesting and educational, but I&#039;d like to call you on the second example:


The if statement in the middle is horribly unreadable, and, as near as I can tell, for no good reason.   Granted, putting the decl of `n` inside the if statement limits the scope of the variable, but that seems like a tiny gain.  Jamming three lines together seems unreadable.


How about splitting it into:
    str = last;
    const auto n = strtoul(str), const_cast(&#038;last), 10);
    if (last != str)   
       nos.push_back(n);


I could well have missed something in this translation, but I tihnk that does the same thing, and doesn&#039;t require the reader to stop and remember what the `;` operator does in the middle of an expression.


I really enjoyed this article, don&#039;t get me wrong!  I just got tripped up on this one. ;)


Thanks for writing this!  I&#039;m looking forward to reading the performance followup!]]></description>
			<content:encoded><![CDATA[<p>Thanks for the aritcle.  It was interesting and educational, but I&#8217;d like to call you on the second example:</p>
<p>The if statement in the middle is horribly unreadable, and, as near as I can tell, for no good reason.   Granted, putting the decl of `n` inside the if statement limits the scope of the variable, but that seems like a tiny gain.  Jamming three lines together seems unreadable.</p>
<p>How about splitting it into:<br />
    str = last;<br />
    const auto n = strtoul(str), const_cast(&amp;last), 10);<br />
    if (last != str)<br />
       nos.push_back(n);</p>
<p>I could well have missed something in this translation, but I tihnk that does the same thing, and doesn&#8217;t require the reader to stop and remember what the `;` operator does in the middle of an expression.</p>
<p>I really enjoyed this article, don&#8217;t get me wrong!  I just got tripped up on this one. 😉</p>
<p>Thanks for writing this!  I&#8217;m looking forward to reading the performance followup!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1176</link>

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

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1174&quot;&gt;jft&lt;/a&gt;.

Updated too, thanks.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1174">jft</a>.</p>
<p>Updated too, thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1174</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Fri, 27 Jul 2018 11:50:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1174</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1172&quot;&gt;Jonathan Boccara&lt;/a&gt;.

The updated coliru link is http://coliru.stacked-crooked.com/a/c9d1852be539aa44]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1172">Jonathan Boccara</a>.</p>
<p>The updated coliru link is <a href="http://coliru.stacked-crooked.com/a/c9d1852be539aa44" rel="nofollow ugc">http://coliru.stacked-crooked.com/a/c9d1852be539aa44</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1172</link>

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

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1155&quot;&gt;jft&lt;/a&gt;.

Updated in the body of the article]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1155">jft</a>.</p>
<p>Updated in the body of the article</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Bartlomiej Filipek		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1163</link>

		<dc:creator><![CDATA[Bartlomiej Filipek]]></dc:creator>
		<pubDate>Fri, 27 Jul 2018 05:49:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1163</guid>

					<description><![CDATA[Thanks for the post!

I&#039;d also add that from_chars* are locale-independent functions, so probably that&#039;s why they can be optimized.]]></description>
			<content:encoded><![CDATA[<p>Thanks for the post!</p>
<p>I&#8217;d also add that from_chars* are locale-independent functions, so probably that&#8217;s why they can be optimized.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1161</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Thu, 26 Jul 2018 09:59:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1161</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1159&quot;&gt;Jakob Truelsen&lt;/a&gt;.

Yes. But within the context of this blog &quot; we will dissect their usages with the 
example of obtaining a vector of unsigned integers from a string, with 
the numbers within the string separated by multiple spaces.&quot;In this case the numbers are space terminated (including the last number) and so atol() or strtoul() work as expected.


However, this aspect of string_view should have been pointed out. Thanks for the clarification.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1159">Jakob Truelsen</a>.</p>
<p>Yes. But within the context of this blog &#8221; we will dissect their usages with the<br />
example of obtaining a vector of unsigned integers from a string, with<br />
the numbers within the string separated by multiple spaces.&#8221;In this case the numbers are space terminated (including the last number) and so atol() or strtoul() work as expected.</p>
<p>However, this aspect of string_view should have been pointed out. Thanks for the clarification.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1160</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Thu, 26 Jul 2018 09:48:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1160</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1158&quot;&gt;Vincent Zalzal&lt;/a&gt;.

Sorry, no. It wasn&#039;t coded as the emphasis was on the performance.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1158">Vincent Zalzal</a>.</p>
<p>Sorry, no. It wasn&#8217;t coded as the emphasis was on the performance.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jakob Truelsen		</title>
		<link>https://www.fluentcpp.com/2018/07/24/how-to-convert-a-string-to-an-int-in-c/#comment-1159</link>

		<dc:creator><![CDATA[Jakob Truelsen]]></dc:creator>
		<pubDate>Thu, 26 Jul 2018 07:24:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=4004#comment-1159</guid>

					<description><![CDATA[I think the information in the Accepts std::string_view row is wrong. You cannot parse a string_view.data() to 
atol() or strtoul(). As the returned data is not 0 terminated. Given the string &quot;1234&quot; we can create a string view of the first three chars, but parsing that to atol() does not yield 123 as expected but instead 1234.]]></description>
			<content:encoded><![CDATA[<p>I think the information in the Accepts std::string_view row is wrong. You cannot parse a string_view.data() to<br />
atol() or strtoul(). As the returned data is not 0 terminated. Given the string &#8220;1234&#8221; we can create a string view of the first three chars, but parsing that to atol() does not yield 123 as expected but instead 1234.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
