Boost C++ Libraries: Ticket #12884: to_string() https://svn.boost.org/trac10/ticket/12884 <p> Hi, </p> <p> Is to_string() here supposed to match to_string() in boost\exception\to_string.hpp? </p> <p> class shared_array2 : public boost::iterator_range&lt;T*&gt; {}; </p> <p> typedef shared_array2&lt;unsigned char&gt; shared_data; </p> <p> to_string(shared_data()); </p> <p> I really didn't expect this to_string() to be found here.. is it a feature or is it a bug? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12884 Trac 1.4.3 Emil Dotchevski Mon, 06 Mar 2017 21:13:07 GMT <link>https://svn.boost.org/trac10/ticket/12884#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:1</guid> <description> <p> What's the context of this problem? Boost Exception defines to_string but *only* for types that define operator&lt;&lt; for std::ostream (using enable_if). The Boost Exception definition, if available is generic, so if there is another suitable to_string overload it will be more specific and will be preferred by any overload resolution. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 06 Mar 2017 21:26:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12884#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:2</guid> <description> <p> I was expecting a compile-time error, I was not expecting some to_string() from Boost being called. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Mon, 06 Mar 2017 22:52:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12884#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:3</guid> <description> <p> I'm guessing that you get this because your type defines operator&lt;&lt; for std::ostream, which enables boost::to_string. Can you confirm? If that's the case it may be possible to fix this, since the to_string overload is not documented. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 07 Mar 2017 08:16:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12884#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:4</guid> <description> <p> Yes, boost::iterator_range defines operator&lt;&lt; and my type derives from it. </p> <p> Is to_string() supposed to be a private interface? If so, shouldn't it be in a private namespace? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Tue, 07 Mar 2017 18:35:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12884#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:5</guid> <description> <p> No, it is not a private interface. What I meant is that the documentation doesn't specify that Boost Exception defines a to_string overload, only that it will call it if it can find it: www.boost.org/doc/libs/release/libs/exception/doc/diagnostic_information.html </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 08 Mar 2017 13:26:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12884#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:6</guid> <description> <p> It does: "for which Boost Exception defines a generic overload." </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Wed, 08 Mar 2017 18:52:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12884#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12884#comment:7</guid> <description> <p> Indeed, I stand corrected. </p> </description> <category>Ticket</category> </item> </channel> </rss>