
On 30/09/11 09:35, Mathias Gaunard wrote:
On 30/09/2011 06:20, Antony Polukhin wrote:
As was mentioned in `[boost] to_string(v)` 1) Functions to_string and to_wstring are part of the upcoming C++0x standard. However, there are no functions for char16_t and char32_t conversions. 2) Some users can't use C++11 in some projects for quite some time, but can use boost. 3) "to_string(5)" is a lot shorter than "lexical_cast<std::string>(5)". Some users would like to use a shorter form.
Is there interest in stoi, stoll, stof, to_string, to_wstring, to_u16string, stod and other functions for char, wchar_t, char16_t and char32_t conversions? Shall I add them to lexical_cast library, or as a separate conversion library?
Fast implementations of these things are already available from Spirit, do you plan on reusing them?
to_string is defined in terms of sprintf [1], which depends on the locale (at least for the decimal point character [2], possibly for other things), so I doubt that the Spirit implementations would be correct (at least, not if used naively). I think lexical_cast would also not be correct, since it has a different locale-dependence from sprintf. [1] N3290 [string.conversions] p7 [2] N1570 7.1.1 p2 John Bytheway