S
Saeed Amrollahi
Dear All
Hi
I usually use the following function for built-in types to std::string
conversion:
// convert a type (typically built-in type) to std::string
template<class T>
inline std::string ToStdStr(const T& t)
{
std::istringstream s;
s << t;
return s.str();
}
What is the equivalent function for std::wstring conversion?
Unfortunately the following code doesn't work:
// convert a type (typically built-in type) to std::wstring
template<class T>
inline std::wstring ToWideStdStr(const T& t)
{
std::wistringstream s;
s << t;
return s.str();
}
In other words, I am looking for the << operator for wstring. Does it
relate to locale?
Thanks in advance.
Regards,
Saeed Amrollahi
Hi
I usually use the following function for built-in types to std::string
conversion:
// convert a type (typically built-in type) to std::string
template<class T>
inline std::string ToStdStr(const T& t)
{
std::istringstream s;
s << t;
return s.str();
}
What is the equivalent function for std::wstring conversion?
Unfortunately the following code doesn't work:
// convert a type (typically built-in type) to std::wstring
template<class T>
inline std::wstring ToWideStdStr(const T& t)
{
std::wistringstream s;
s << t;
return s.str();
}
In other words, I am looking for the << operator for wstring. Does it
relate to locale?
Thanks in advance.
Regards,
Saeed Amrollahi