Boost logo

Boost :

Subject: Re: [boost] Can someone (using Windows) check ticket #316?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-05-30 21:04:15


AMDG

Marshall Clow wrote:
> At 5:51 PM -0700 5/30/09, Steven Watanabe wrote:
>> The use of narrow in the else
>> branch is still wrong...
>
> What would be a good fix there (in #287) in the case where you can't
> use the locale?

The code that's there now is equivalent to
cast and hope for the best, since calling
narrow should have no effect once we've already
implicitly converted to char.

I can think of two alternatives:

std::wostream dummy;
ss << dummy.narrow(*beg++, 'X');

or

ss << boost::numeric_cast<char>(*beg++);

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk