This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[c++0x] Ambiguity using std::to_string
- From: Germán Diago <germandiago at gmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 10 Nov 2009 09:24:51 +0100
- Subject: [c++0x] Ambiguity using std::to_string
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.