I am looking to convert integer types to string using std::to_string, but I saw this paragraph:
std::to_stringrelies onstd::localefor formatting purposes, and therefore concurrent calls tostd::to_stringfrom multiple threads may result in partial serialization of calls.
But I couldn't find anything else on this topic, Google didn't come up wit anything, as did MSDN. I am using Visual Studio 2013 if it matters.
Is this thread safe? If so, how?
setlocaleis not thread safe sostd::to_stringmight use a mutex to make sure multiple calls don't race if it calls that.std::to_stringinvolved locking a mutex.std::localeitself: it is immutable, so there is no possibility of read/write race