This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Weirdness with numeric_limits in new special functions
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 13 May 2007 17:02:53 +0200
- Subject: Re: Weirdness with numeric_limits in new special functions
- References: <461E0356.9010909@suse.de> <461E37A5.6060005@verizon.net> <4646DD8B.1090603@suse.de> <46472172.1040501@verizon.net>
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.