On Monday, 11 March 2013 at 19:25:47 UTC, Andrei Alexandrescu wrote:
On 3/11/13 1:39 PM, Ali Çehreli wrote:
This has become a C++ thread but... :)

On 03/11/2013 02:30 AM, FG wrote:

> the good old stream code:
>
> std::stringstream ss; ss << number; out = ss.str();
>
> Seriously? If I could at least chain that...
>
> out = std::stringstream(number).str();
>
> Unfortunately, no.

We consider Boost a part of the C++ standard:

#include <boost/lexical_cast.hpp>

using namespace boost;

// ...

out = lexical_cast<string>(number);

Problem with that it's it's incredibly slow (both ways).

Andrei

Speaking of which, I noticed Facebook's Folly had a conv.h with a to<>. Was that inspired by Phobos' std.conv?

https://github.com/facebook/folly/blob/master/folly/docs/Conv.md

Reply via email to