This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: V3 PATCH: numeric_limits<> support, fix PR/3865


Richard Henderson <rth@redhat.com> writes:

| On Tue, Sep 03, 2002 at 05:47:16PM -0600, Roger Sayle wrote:
| > I agree that if the above statement
| > where executed at run-time I'd expect a SIGFPE, but as an initializer
| > to a global constant?
| 
| What's the distinction in C++, where global constants *can* 
| be initialized at runtime?

Global const objects can be intiialized at runtime in C++.  

However, the description of numeric_limits<> goes far beyond that and
makes the additional requirement that the static data members of
numeric_limits<> be defined in a way that makes them behave as
integral constant expressions -- that constraint excludes runtime
initialization. 

In some way, it makes sense to me to evaluate the __builtin_xxx
helpers at compile-time.  Do you have some cases in mind which would
defeat that?

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]