This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Weirdness with numeric_limits in new special functions


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.


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