This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] libstdc++: Add hexfloat/defaultfloat io manipulators.


On 27 March 2014 23:56, Luke Allardyce wrote:
> It looks like the new standard also requires the precision to be
> ignored for hexfloat
>
>>For conversion from a floating-point type, if floatfield != (ios_base::fixed | ios_base:: scientific), str.precision() is specified as precision in the conversion specification. Otherwise, no precision is specified.

Thanks for pointing out that difference. We'll need a test for that.

> Also the old standard seems to require that ios_base::fixed |
> ios_base::scientific (or any other combination) falls through to the
> uppercase test; I was trying to use abi_tag for a solution as not only
> would two versions of _S_format_float be necessary, but also num_get
> due to the pre-instantiated templates for <char> and <wchar>, which
> led me to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642. It might
> just be more trouble than it's worth.

I don't think we need to worry about that, if I understand correctly
the combination of fixed|scientific has unspecified behaviour in
C++03, so we can make our implementation do exactly what it does in
C++11.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]