Why this doesn’t compile on gcc?
#include <iostream>
#include <string>
int main() {
double f = 23.43;
std::wstring f_str = std::to_wstring(f);
std::wcout << f_str << std::endl;
return 0;
}
The error:
prog.cpp: In function ‘int main()’:
prog.cpp:6:26: error: ‘to_wstring’ is not a member of ‘std’
std::to_wstring()was added in C++11. The link in your answer, on ideone, is not using the C++11 compiler:It compiles fine: http://ideone.com/UO2FQM :