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 

Proposed resolution of open request #416

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Daniel Krügler
Guest





PostPosted: Wed May 05, 2004 5:05 pm    Post subject: Proposed resolution of open request #416 Reply with quote



The current publicly visible resolution of

[url="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#416"]http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#416[/url]

says:

"Kona: the LWG does not believe this is a defect. The C macro definitions
are what they are; we've got a better mechanism, std::numeric_limits,
that is specified more precisely than the C limit macros. At most we should
add a nonnormative note recommending that users who care about the
exact types of limit quantities should use <limits> instead of <climits>
"

To my opinion this argumentation does not work well with template arguments of
integral type in std::numeric_limits, because the corresponding class template
provides static functions min() and max() instead of static constants which
are usable in ICE's. Of course the best solution would be the introduction of
an additional class template like boost::integer_traits, but such an proposal as
addition to the library does not yet exist, does it?

Thanks for listening,

Daniel


--- [ 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
Falk Tannhäuser
Guest





PostPosted: Wed May 05, 2004 5:58 pm    Post subject: Re: Proposed resolution of open request #416 Reply with quote



Quote:
To my opinion this argumentation does not work well with template arguments of
integral type in std::numeric_limits, because the corresponding class template
provides static functions min() and max() instead of static constants which
are usable in ICE's.
BTW: What was the rationale for having static functions min() and max() instead

of static constants in std::numeric_limits? I guess there was some good reason
for doing it this way, but I was unable to find it.

Falk

---
[ 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
Daniel Krügler
Guest





PostPosted: Thu May 06, 2004 3:17 pm    Post subject: Re: Proposed resolution of open request #416 Reply with quote



Good morning, Falk Tannhäuser:

Falk Tannhäuser schrieb:

Quote:
To my opinion this argumentation does not work well with template arguments of
integral type in std::numeric_limits, because the corresponding class template
provides static functions min() and max() instead of static constants which
are usable in ICE's.


BTW: What was the rationale for having static functions min() and max() instead
of static constants in std::numeric_limits? I guess there was some good reason
for doing it this way, but I was unable to find it.

Falk

This is due to the fact, that std::numeric_limits must take into account

arithmetic types (NB: This wording is a
correction of the standards' one, see open issue
[url]http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#201)[/url].
Not all arithmetic types (only its subset integral types) can take part
in ICE's (integral constant expressions),
which are the daily bread of MP techniques. I think one did consider
different interfaces for different template
parameters as a bad style, so one had to chose the least common
denominator for all supported types.

Greetings from Bremen,

Daniel


---
[ 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.