[cfe-dev] hexfloats in c++0x
Howard Hinnant
hhinnant at apple.com
Thu Jan 27 12:01:09 PST 2011
On Jan 27, 2011, at 2:48 PM, Douglas Gregor wrote:
>
> On Jan 27, 2011, at 10:50 AM, Howard Hinnant wrote:
>
>> Can we turn on support for hexfloats in -std=c++0x? It is already turned on in c++03 mode.
>>
>> get_double.pass.cpp:108:14: error: invalid suffix 'p' on integer constant
>> assert(v == 0x125p-1);
>> ^
>
> They're disabled in C++0x mode because they conflict with user-defined literals. We might be able to jump through some hoops to see if there's a literal operator named "p" or "P" in scope, but... yuck.
>
> Suggestions welcome!
<sigh> That's a serious design flaw / incompatibility in C++0x. hexfloat literals are one of the better features of C99. We even enshrined hex-float formatting in the C++0x library. What a mess...
-Howard
More information about the cfe-dev
mailing list