Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 4th, 2008, 12:01 PM
Paolo Carlini
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
c++0x std::ratio implementation

Updated patch.

Thanks. I'm looking into it. Note that, currently at least, we cannot assume <cstdintto be non-trivial on all the platforms supported by GCC, that is, std::intmax_t may well be unavailable. The code and the tests require guards

Paolo.

Reply With Quote
  #2  
Old July 4th, 2008, 02:01 PM
Paolo Carlini
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
c++0x std::ratio implementation

Hi,

With something like __GLIBCXX_HAS_STDINT_H? , even if stdint.h
is
defined, its still not guaranteed to have intmax_t? But if it
doesn't,
won't including cstdint give a compiler error (due to "using
::intmax_t)?

Can we assume that if INTMAX_MAX is defined, then intmax_t is
available?

We already have _GLIBCXX_USE_C99_STDINT_TR1, we have only to use it, consistently, to wrap both code using <cstdint(the header itself can be included unconditionally) and the corresponding testcases.

If you can do that, + the small stylistic changes and resubmit we can commit very soon

Paolo.

Reply With Quote
  #3  
Old July 5th, 2008, 07:20 AM
Paolo Carlini
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
c++0x std::ratio implementation

Hi,

Attached is a patch that short-cuts ratio_less when denominators
are equal or signs differ. This prevents overflow in a few cases
(test case provided).




Also, I added some doxygen documentation to std::ratio class.
However, when I built the documentation (html) it didn't look like it
was picking up the header. Does something need modification for
doxygen to pick it up.

Let's ask Benjamin

I'm committing the below, which avoids in <ratiothe use of the various limit macros, which, according to C99, in C++ are not defined in <stdint.hwhen __STDC_LIMIT_MACRS is not defined. In fact we have a problem here, because, in C++0x, the availability of those limit macros in <cstdintis supposed to be *independent* of the feature macro to be defined and since our <cstdintincludes <stdint.hit suffices that the user includes once the latter without defining the feature macro for the following inclusion of <cstdintto become a NP, thus the limit macros remain forever unavailable grunt. In fact this requirement in C++0x seems to me largely contrary to the resolution of DR 456, I have to study the issue a little more
Attached Files
File Type: txt Changelog_ratio_less.txt (474 Bytes, 6 views)
File Type: txt patch_ratio_less.txt (5.9 KB, 8 views)

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Development > c++0x std::ratio implementation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway