Re: [Boost-bugs] [Boost C++ Libraries] #6186: lexical_cast on vs2005 with wchar_t-

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-13 15:57:03


#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):

 Replying to [comment:4 cheng.yang <luckyangcheng@…>]:
> On line 1.48_v2\boost\lexical_cast.hpp 1454
>
> The code is like this:
> bool operator>>(CharT& output) { return
 shr_xchar(output); }
> The line should be changed to:
>
> #ifndef BOOST_NO_INTRINSIC_WCHAR_T
> bool operator>>(wchar_t& output) {
 return shr_xchar(output); }
> #endif
>
> Because there is already operator>> for short, char, and unnecessary for
 CharT overload.
> Compared with the operator<<, we can easy get to know that it should be
 prepared for wchar_t, and should be encapsulated by
 BOOST_NO_INTRINSIC_WCHAR_T macro.

 Your solution is good, but it will break the behavior.
 When BOOST_NO_INTRINSIC_WCHAR_T is defined, {{{unsigned short}}} must
 behave as {{{wchar_t}}}, as a lexical character. Your solution will leave
 {{{unsigned int}}} integral (not lexical) behavior.

 Bugfix is already in trunk, you can try it. As soon as it rolls through
 regression tests, it will be merged to trunk. After that (and other
 bugfixes), some refactoring will be done and better support for char16_t
 and char32_t types will be added to lexical_cast library.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6186#comment:5>
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