From: Howard Hinnant (hinnant_at_[hidden])
Date: 2001-06-07 12:03:45
On Thursday, June 7, 2001, at 12:28 PM, Darin Adler wrote:
>> Also, should Line A read:
>> s << o.widen(()
>> << x.real()
>> << o.widen(',')
>> << x.imag()
>> << o.widen()); // Line A
>> (As in add a call to "widen()" on any formated character in case
>> the char type.)
> It does seem that this would be necessary. But since the code I quoted
> from the standard, there must either be a reason that calls to widen
> t needed, or a defect in the standard. I can't find an item in the
> issues list, so it might be time to submit a defect report.
The standard has the namespace scope operator (184.108.40.206):
template<class charT, class traits>
>> Which of course brings up the question, if I had a "stringOfChars" do I
>> to loop through each one calling "widen()" on them individually?
> If efficiency is a concern, you can instead call the underlying widen
> <ctype> that works on an array of characters. The code would be
> roughly like:
> std::use_facet< std::ctype<char_type> >(o.getloc())
> .widen(str_start, str_end, result_buffer);
> Metrowerks adds a non-standard overload that widens a std::string. You
> be able to write your own as a free function template if you find this
> comes up a lot. We could put that into some boost library if we find
> a common requirement.
> PS to Howard Hinnant: The Metrowerks non-standard overload for
> is only half there in <ios>. It's there in the _MSL_NO_LOCALE case, but
> not in the normal case.
When locale support is turned off, there is a (non-standard) member
function of basic_ios called widen which takes a string.
When locale support is turned on, there is a (non-standard) member
function of ctype called widen which takes a string.
I put these in just as an aid in implementing the lib. I'm surprised
anybody noticed! :-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk