C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why isn't the nonspecialized numeric_limits empty?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Prateek R Karandikar
Guest





PostPosted: Wed May 19, 2004 8:18 pm    Post subject: Why isn't the nonspecialized numeric_limits empty? Reply with quote



Why isn't nonspecialized numeric_limits empty? All its members ( of
the nonspecialized class) are meaningless anyway. The nonspecialized
char_traits is empty. Why not numeric_limits? Or both (char_traits and
numeric_limits) could have declared and not defined :

template<typename T> struct numeric_limits;

template<> struct numeric_limits<bool> {/*...*/};
/*...*/

Why do the numeric_limits specializations for integral types also have
members relevant only to only floating-point types? It seems wierd to
talk about numeric_limits<int>::round_error.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]

Back to top
Prateek R Karandikar
Guest





PostPosted: Sat Jun 12, 2004 6:21 pm    Post subject: Re: Why isn't the nonspecialized numeric_limits empty? Reply with quote



Anything wrong in it being empty?

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
To iterate is human, to recurse divine.
-L. Peter Deutsch
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]

Back to top
Terje Sletteb?
Guest





PostPosted: Sun Jun 13, 2004 8:36 pm    Post subject: Re: Why isn't the nonspecialized numeric_limits empty? Reply with quote



[email]kprateek88 (AT) yahoo (DOT) com[/email] (Prateek R Karandikar) wrote in message news:<607f883e.0406120927.2a4bd460 (AT) posting (DOT) google.com>...
Quote:
Anything wrong in it being empty?

std::numeric_limts has a lot of problems, also, besides this, such as
min/max not being integral constant expressions (althought Boost has a
component that fixes this:
[url]http://www.boost.org/libs/integer/integer_traits.html)[/url]. See e.g.:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#201

"[post-Toronto: The opinion of the LWG is that the wording in the
standard, as well as the wording of the proposed resolution, is
flawed. The term "arithmetic types" is well defined in C and C++, and
it is not clear that the term is being used correctly. It is also not
clear that the term "implementation dependent" has any useful meaning
in this context. The biggest problem is that numeric_limits seems to
be intended both for built-in types and for user-defined types, and
the standard doesn't make it clear how numeric_limits applies to each
of those cases. A wholesale review of numeric_limits is needed. A
paper would be welcome.]"

as well as:

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#184 (bool
is neither signed nor unsigned)

There was also a thread about numeric_limits a few years ago
([url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=73611vs31id2ejf4qjpbpatcml4jadgluc%404ax.com)[/url].

Regards,

Terje

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.