<?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: Using toString on Custom Types in C++	</title>
	<atom:link href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Tue, 04 Aug 2020 03:31:42 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: Darien Imai		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-724</link>

		<dc:creator><![CDATA[Darien Imai]]></dc:creator>
		<pubDate>Thu, 21 Dec 2017 21:05:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-724</guid>

					<description><![CDATA[Maybe stringify() would be a better name?]]></description>
			<content:encoded><![CDATA[<p>Maybe stringify() would be a better name?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-393</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Tue, 11 Jul 2017 10:10:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-393</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-392&quot;&gt;Duc Truong&lt;/a&gt;.

I suppose that I would leave formatting to another function, because there are so many out there.
On this topic I&#039;m preparing a big post that will be a complete guide to building strings in C++, that includes the various exisiting approaches to dealing with formatting. It should come out in a few weeks.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-392">Duc Truong</a>.</p>
<p>I suppose that I would leave formatting to another function, because there are so many out there.<br />
On this topic I&#8217;m preparing a big post that will be a complete guide to building strings in C++, that includes the various exisiting approaches to dealing with formatting. It should come out in a few weeks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Duc Truong		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-392</link>

		<dc:creator><![CDATA[Duc Truong]]></dc:creator>
		<pubDate>Tue, 11 Jul 2017 02:01:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-392</guid>

					<description><![CDATA[Thanks for the great article.
What if we want to add formatting to the to_string function for the value/object? Would you split that to separate functions, or add a formatting string to the parameter list?]]></description>
			<content:encoded><![CDATA[<p>Thanks for the great article.<br />
What if we want to add formatting to the to_string function for the value/object? Would you split that to separate functions, or add a formatting string to the parameter list?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-325</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Fri, 09 Jun 2017 08:17:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-325</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-309&quot;&gt;Martin Moene&lt;/a&gt;.

Thanks! This one is fixed now.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-309">Martin Moene</a>.</p>
<p>Thanks! This one is fixed now.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Houck		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-321</link>

		<dc:creator><![CDATA[Daniel Houck]]></dc:creator>
		<pubDate>Thu, 08 Jun 2017 01:13:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-321</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-312&quot;&gt;Fei Teng&lt;/a&gt;.

Those would be caught by the ostream&#039;s operator&#060;&#060; unless the conversions were explicit, but it would probably be good to check since in a lot of cases they would be.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-312">Fei Teng</a>.</p>
<p>Those would be caught by the ostream&#8217;s operator&lt;&lt; unless the conversions were explicit, but it would probably be good to check since in a lot of cases they would be.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Houck		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-320</link>

		<dc:creator><![CDATA[Daniel Houck]]></dc:creator>
		<pubDate>Thu, 08 Jun 2017 01:11:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-320</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-313&quot;&gt;Peter Feichtinger&lt;/a&gt;.

A couple libraries I need to use for work use a Print function; I wouldn&#039;t need to add separate specializations for each one if I just added one of these methods for that.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-313">Peter Feichtinger</a>.</p>
<p>A couple libraries I need to use for work use a Print function; I wouldn&#8217;t need to add separate specializations for each one if I just added one of these methods for that.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Peter Feichtinger		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-313</link>

		<dc:creator><![CDATA[Peter Feichtinger]]></dc:creator>
		<pubDate>Wed, 07 Jun 2017 16:23:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-313</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-311&quot;&gt;Daniel Houck&lt;/a&gt;.

Yeah, but you would have to add a specialization for the specific type in either case, or did I misunderstand your point?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-311">Daniel Houck</a>.</p>
<p>Yeah, but you would have to add a specialization for the specific type in either case, or did I misunderstand your point?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Fei Teng		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-312</link>

		<dc:creator><![CDATA[Fei Teng]]></dc:creator>
		<pubDate>Wed, 07 Jun 2017 15:57:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-312</guid>

					<description><![CDATA[I&#039;d also include 2 obvious conversions: operator std::string() and operator const char*().]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d also include 2 obvious conversions: operator std::string() and operator const char*().</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Houck		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-311</link>

		<dc:creator><![CDATA[Daniel Houck]]></dc:creator>
		<pubDate>Wed, 07 Jun 2017 14:44:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-311</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-310&quot;&gt;Peter Feichtinger&lt;/a&gt;.

For your first idea, this is true, but it doesn’t work if there’s a `to_string` member function, or a `Print` member function, or any of the other ways people have for writing their classes. This is an extensible system, and you’d want to use the specific syntaxes and ordering useful to you.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-310">Peter Feichtinger</a>.</p>
<p>For your first idea, this is true, but it doesn’t work if there’s a `to_string` member function, or a `Print` member function, or any of the other ways people have for writing their classes. This is an extensible system, and you’d want to use the specific syntaxes and ordering useful to you.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Peter Feichtinger		</title>
		<link>https://www.fluentcpp.com/2017/06/06/using-tostring-custom-types-cpp/#comment-310</link>

		<dc:creator><![CDATA[Peter Feichtinger]]></dc:creator>
		<pubDate>Wed, 07 Jun 2017 11:20:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1247#comment-310</guid>

					<description><![CDATA[I don&#039;t get why you split up the first two cases.
You could just use ADL and write something like `using std::to_string; return to_string(t);`, no?

And my next idea would be to provide a templated to_string which would just use ostringstream for types which don&#039;t have a to_string overload, then the unified syntax would be the one that&#039;s already there, to_string.]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t get why you split up the first two cases.<br />
You could just use ADL and write something like `using std::to_string; return to_string(t);`, no?</p>
<p>And my next idea would be to provide a templated to_string which would just use ostringstream for types which don&#8217;t have a to_string overload, then the unified syntax would be the one that&#8217;s already there, to_string.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
