[v3] c++0x std::ratio implementation

Paolo Carlini paolo.carlini@oracle.com
Sat Jul 5 10:23:00 GMT 2008


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

Ok.


> 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 <ratio> the use of the various limit macros, which, according to C99, in C++ are not defined in <stdint.h> when __STDC_LIMIT_MACROS is not defined. In fact we have a problem here, because, in C++0x, the availability of those limit macros in <cstdint> is supposed to be *independent* of the feature macro to be defined and since our <cstdint> includes <stdint.h> it suffices that the user includes once the latter without defining the feature macro for the following inclusion of <cstdint> to become a NOP, 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...
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Changelog_ratio_less.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080705/35a3c0a8/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_ratio_less.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080705/35a3c0a8/attachment-0001.txt>


More information about the Libstdc++ mailing list