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

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Sep 1 03:40:00 GMT 2002


Richard Henderson <rth@redhat.com> writes:

| On Fri, Aug 30, 2002 at 12:43:55PM +0200, Gabriel Dos Reis wrote:
| > |   if (wchar_t(-1) < 0)
| > 
| > I'm afraid this doesn't solve the problem:  We want something at the
| > preprocessor level.
| 
| For what purpose? 

Initialization values for several const static (integral) data members of
numeric_limits<wchar_t> depend on whether or not wchar_t is signed.

| Can't you do everything you need at the C++
| and let constant folding do its job?

That would be an easier path to take weren't there constraints on how
the integral static data members of numeric_limits<wchar_t> have to be
initialized. 

It may be possible to use internal templates specializations to arrive
at something, but the one I have
  (1) breaks V3 binary interface;
  (2) isn't cleaner nor easier than the __WCHAR_UNSIGNED__ path.

There may be other possibilities.  I would be glad to look at them if
presented. 

-- Gaby



More information about the Libstdc++ mailing list