Weirdness with numeric_limits in new special functions
Paolo Carlini
pcarlini@suse.de
Sun May 13 15:00:00 GMT 2007
Hi Ed,
> I started working on this but then work flared up bug time.
>
> I think I can return to this a week from now or maybe during this week.
Ok, great.
> I also remembered that we use these template functions that promote
> the types of all the arguments according to the rules set forth in the
> standard and in TR1. One of which is that if an integer is supplied
> in a slot expecting some floating point type then the integer is
> promoted to double and the appropriate overload is called. These
> functions are in common.h. I think this sufficiently blocks calling
> with integral _Tp.
In my opinion, this is a much less urgent issue: eventually, in C++0x,
concepts will make sure templates are instantiated for a restricted set
of types. In fact, we could also use now enable_if here and in many
other places too, but, in my opinion, we are way to late given that
C++0x is around the corner. Thus, if you are short of time (we always
are ;) I would say, let's make sure the behavior of the various
functions is 100% correct and consistent when instantiated for the
correct types and let's document the types of the arguments in comments.
Thanks,
Paolo.
More information about the Libstdc++
mailing list