Are member functions of std::wstring_convert thread safe?
Because std::wstring_convert
is part of the Standard Library, it follows certain rules when it comes to handling an object of such type from different threads.
In particular, because both to_bytes
and from_bytes
overloads are non-const
, it is not possible to use those members on any one particular object from different threads without synchronization. This makes sense, as codecvt conversions typically make use of a state_type
object. Using it without synchronization would lead to disaster.