On Mon, 28 Apr 2008 15:52:17 +1200, Ian Collins <ian->
wrote:
> David Thompson wrote:
> > On Mon, 14 Apr 2008 09:04:49 -0700, Keith Thompson <kst->
> > wrote:
> > <snip>
> >> I don't think pointers would be a problem. For example, C++ did
> >> change the semantics of const. In essence, if an object is declared
> >
> > including a 'static' (classwide) data member
> >
> >> "const" and its initializer is a constant expression, then any
> >
> > and of an integer or enumeration type (in C++ enum types are distinct,
> > not just aliases for integer types as they are in C)
> >
> >> reference to the object is a constant expression. This allows <snip>
> >
> > But most of the places C (or C++) requires a constant expression do
> > require integer (constant expression), including the example you gave
> > of a case label, and this feature is enough for those.
> >
> Which feature?
The feature of C++ that Keith described and I slightly corrected, that
a const variable(!) of integer or enum type initialized by a constant
expression is acceptable in a constant expression. (And the which, or
something like it, the upthread discussion suggested for C.)
- formerly david.thompson1 || achar(64) || worldnet.att.net
|