Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6186: lexical_cast on vs2005 with wchar_t-
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-14 04:38:43
#6186: lexical_cast on vs2005 with wchar_t-
-------------------------------+--------------------------------------------
Reporter: anonymous | Owner: apolukhin
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: lexical_cast
Version: Boost 1.48.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+--------------------------------------------
Comment (by apolukhin):
I made some more tests under VC with wchar_t- flag. Here is the test and
output is shown in comments:
{{{
#include <iostream>
#include <sstream>
using namespace std;
int main() {
cout << L'A' << endl; // 65
wcout << L'A' << endl; // A
cout << L"A" << endl; // 00147800
wcout << L"A" << endl; // A
wchar_t w;
stringstream ss;
ss << 65;
ss >> w;
wcout << w << endl; // A
wstringstream wss;
wss << 65;
wss >> w;
wcout << w << endl; // 6
return 0;
}
}}}
Exactly the same output without wchar_t- flag (+ compilation error on line
"ss >> w;").
Behavior depends on stream type that we are using.[[BR]]
[[BR]]
I`ll think about lexical_cast default behavior, shall it be treated as
char/wchar_t stream by default or shall it be something else. Current
documentation does not reflect it. All the thoughts will be posted here
and in documentation.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6186#comment:14> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC