This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 3.0.1 Freeze
Bo Thorsen <bo@sonofthor.dk> writes:
| On Tuesday 07 August 2001 02:21, Mark Mitchell wrote:
| > 1. Build a generic std_limits.h that has a structure like:
| >
| > #ifndef __glibcpp_int_bits
| > #define __glibcpp_int_bits 32
| > #endif
| >
| > #if __glibcpp_int_bits == 32
| > #ifndef __glibcpp_int_max
| > #define __glibcpp_int_max <right value>
| > #endif
| > #ifndef __glibcpp_long_max
| > #define __glibcpp_long_max <right value>
| > #endif
| > ...
| > #elif __glibcpp_int_bits == 64
| > ...
| > #endif
| >
| > <stuff involving __glibcpp_long_max>
|
| Why is it that most of you insist on macros instead of const ints? Afaik gcc
| will generate the exact same code for:
I'm not sure to fully undertand your question, but here is what will
happen in effect:
// #define goes here....
template<>
struct numeric_limits<int> {
const bool is_specialized = true;
static const int digits = __glibcpp_int_digits;
// and so on...
-- Gaby