|
std::to_wstring(3.1415926); 를
std::to_wstring(3.1415926L); 로
방코 님이 쓰신 글 :
: 안녕하세요,
: 빌더 xe4에서 타켓플랫폼을 win64로 한후 (C++11지원)
: cpluscplus.com사이트의 to_wstring함수 예제인 아래 코드를 컴파일하면 call to 'to_wstring' is ambiguous라는 에러가 뜹니다.
: mingw컴파일러에서는 정상적으로 컴파일, 실행되는데 xe4 64비트에서는 또다른 설정이 필요한지 궁금합니다.
:
: // to_wstring example
: #include <iostream> // std::wcout
: #include <string> // std::wstring, std::to_wstring
:
: int main ()
: {
: std::wstring pi = L"pi is " + std::to_wstring(3.1415926);
: std::wstring perfect = std::to_wstring(1+2+4+7+14) + L" is a perfect number";
: std::wcout << pi << L'\n';
: std::wcout << perfect << L'\n';
: return 0;
: }
|