C++ PATCH: Disallow floating-point literals in integral-constant expressions

Joe Buck Joe.Buck@synopsys.COM
Tue Feb 1 20:59:00 GMT 2005


On Tue, Feb 01, 2005 at 12:16:14PM -0800, Mark Mitchell wrote:
> My thinking is that we've been disallowing template parameters of 
> floating-point type for a while now.  If we really want to allow 
> constant expressions of floating-point type forever more, we ought to 
> also allow template parameters of floating-point type as well.

I would argue against allowing template parameters of floating-point
type, because you get two distinct functions instead of one because
of rounding errors: func<1.0> vs func<0.9999999999999>.

I have no objection to deprecating floating point static constants;
I just think we should follow our normal policy of issuing warnings first.

> Furthemore, deprecating the extension doesn't make it impossible for us 
> to keep it -- but it does make it easier to remove it.

Agreed.



More information about the Libstdc++ mailing list