🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3615

Re: 'const' in header files

#3615
From: yeager
Date: Fri, 08 Mar 1996 03:53
27 lines
1979 bytes
In <AD64B66E966816216@sleipner.nts.mh.se>, lars.farm@nts.mh.se (Lars Farm)
writes:

>I suggested that required behaviour was that these constants are not
>instantiated unless actually used, much like templates. Rather than leaving
>it as an optional optimization as it appears to be now. This should apply
>to any built in type. Thus invalidating stupid warnings about unused
>variables. If some compilers warn about this, and according to the thread
>in c.l.c++.moderated some do, then many users will have to revert to the
>#define style constants instead. Is that the intent of the language
>designers?

One area where such a requirement conflicts with existing rules would
be if the constant object has a constructor.  Then the existing rules
would not allow the constant to be omitted since the constructor must
be called (especially if it has detectable side effects) even if the
constant is not used in the particular compilation unit.

John Yeager
yeager@aosi.com
---
[ To submit articles: try just posting with your news-reader.
                      If that fails, use mailto:std-c++@ncar.ucar.edu
  FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu.
]
Technical Details
Message-ID: <4hqd3e$n7k@news.aosi.com>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
References: <AD5A0C5196681CA0D@sleipner.nts.mh.se> <31379F8F.7659@compuserve.com> <AD64B66E966816216@sleipner.nts.mh.se>

Show Full Headers
Complete Article Headers
From: yeager@aosi.com
Message-ID: <4hqd3e$n7k@news.aosi.com>
X-Original-Date: 8 Mar 1996 22:41:50 GMT
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 08 Mar 96 03:53:35 GMT
Approved: fjh@cs.mu.oz.au
Newsgroups: comp.std.c++
Subject: Re: 'const' in header files
Organization: Advanced OnLine Services Inc.
References: <AD5A0C5196681CA0D@sleipner.nts.mh.se> <31379F8F.7659@compuserve.com> <AD64B66E966816216@sleipner.nts.mh.se>
Reply-To: yeager@aosi.com
X-Newsreader: IBM NewsReader/2 v1.2.5
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMT+vZ+EDnX0m9pzZAQHougF+NyMxJQUThrV0tMcPj8eV8JCssvbLdtw0
 mfiDsboFzurdRPpmT+jCwW2CCIJPl2OV
 =ZUL9