This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: More test results...
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Phil Edwards <phil at jaj dot com>, libstdc++ at gcc dot gnu dot org
- Date: Thu, 14 Mar 2002 07:32:21 -0800 (PST)
- Subject: Re: More test results...
> No, but the patch under discussion changes several static data members to
> be inherited, so the mangled name is different. If the default is wrong
> for a type, it must be overridden in the (derived) specialization, so the
> mangled name depends on whether or not the default is correct.
Hmm. Well, numeric_limits only has meaning as a specialization. For the
required specializations, no derivation is required. It stands to reason
that non-required, user-defined specializations would also not be
derivations. So, I'm not quite sure what you are getting at with this
particular argument.
The idea that now __numeric_limits_base* is in the exported symbols list
is the bit that personally makes me nervous. I thought this was the part
that you were nervous about.
Here, try this:
#include <limits>
class B { };
namespace std
{
template<>
struct numeric_limits<B>
{
public:
static const bool is_specialized = false;
static B min() throw();
static B max() throw();
static const int digits = 0;
static const int digits10 = 0;
static const bool is_signed = false;
static const bool is_integer = false;
static const bool is_exact = false;
static const int radix = 0;
static B epsilon() throw();
static B round_error() throw();
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
static B infinity() throw();
static B quiet_NaN() throw();
static B signaling_NaN() throw();
static B denorm_min() throw();
static const bool is_iec559 = false;
static const bool is_bounded = false;
static const bool is_modulo = false;
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
const bool numeric_limits<B>::is_specialized;
const int numeric_limits<B>::digits;
const int numeric_limits<B>::digits10;
const bool numeric_limits<B>::is_signed;
const bool numeric_limits<B>::is_integer;
const bool numeric_limits<B>::is_exact;
const int numeric_limits<B>::radix;
const int numeric_limits<B>::min_exponent;
const int numeric_limits<B>::min_exponent10;
const int numeric_limits<B>::max_exponent;
const int numeric_limits<B>::max_exponent10;
const bool numeric_limits<B>::has_infinity;
const bool numeric_limits<B>::has_quiet_NaN;
const bool numeric_limits<B>::has_signaling_NaN;
const float_denorm_style numeric_limits<B>::has_denorm;
const bool numeric_limits<B>::has_denorm_loss;
const bool numeric_limits<B>::is_iec559;
const bool numeric_limits<B>::is_bounded;
const bool numeric_limits<B>::is_modulo;
const bool numeric_limits<B>::traps;
const bool numeric_limits<B>::tinyness_before;
const float_round_style numeric_limits<B>::round_style;
}
int main()
{
bool b = std::numeric_limits<B>::has_denorm_loss;
return 0;
}
%nm a.out | grep numeric_limits
080a3084 B _ZNSt14numeric_limitsI1BE10has_denormE
080a308a B _ZNSt14numeric_limitsI1BE10is_boundedE
080a3069 B _ZNSt14numeric_limitsI1BE10is_integerE
080a3090 B _ZNSt14numeric_limitsI1BE11round_styleE
080a3080 B _ZNSt14numeric_limitsI1BE12has_infinityE
080a3078 B _ZNSt14numeric_limitsI1BE12max_exponentE
080a3070 B _ZNSt14numeric_limitsI1BE12min_exponentE
080a3081 B _ZNSt14numeric_limitsI1BE13has_quiet_NaNE
080a305c B _ZNSt14numeric_limitsI1BE14is_specializedE
080a307c B _ZNSt14numeric_limitsI1BE14max_exponent10E
080a3074 B _ZNSt14numeric_limitsI1BE14min_exponent10E
080a3088 B _ZNSt14numeric_limitsI1BE15has_denorm_lossE
080a308d B _ZNSt14numeric_limitsI1BE15tinyness_beforeE
080a3082 B _ZNSt14numeric_limitsI1BE17has_signaling_NaNE
080a306c B _ZNSt14numeric_limitsI1BE5radixE
080a308c B _ZNSt14numeric_limitsI1BE5trapsE
080a3060 B _ZNSt14numeric_limitsI1BE6digitsE
080a3064 B _ZNSt14numeric_limitsI1BE8digits10E
080a306a B _ZNSt14numeric_limitsI1BE8is_exactE
080a3089 B _ZNSt14numeric_limitsI1BE9is_iec559E
080a308b B _ZNSt14numeric_limitsI1BE9is_moduloE
080a3068 B _ZNSt14numeric_limitsI1BE9is_signedE
-benjamin