[c++0x] Ambiguity using std::to_string

Germán Diago germandiago@gmail.com
Tue Nov 10 08:24:00 GMT 2009


Hello. I've been using std::to_string and I don't know if it's a bug,
but it's usability is horrible because:

int year;

std::to_string(year);

causes an ambiguity between long long double, long long int and long
long double.

So the way to avoid this is:

to_string((long long)year);

Shouldn't this be a better match for long long int? Because this way
of using it annoys me quite a bit and
it makes it unconfortable to use:

Maybe there should be an overload for every type including int, long
int, unsigned int, double, long double and float.
Would this prevent ambiguities?

I looked at the draft c++ standard (the last one available (N2960) )
and it does not include anything apart of
long long int and long long double.

Thanks.



More information about the Libstdc++ mailing list