|constant expressions firstname.lastname@example.org (glen herrmannsfeldt) (2009-01-13)|
|Re: constant expressions DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-01-15)|
|Re: constant expressions email@example.com (George Neuner) (2009-01-16)|
|From:||Hans-Peter Diettrich <DrDiettrich1@aol.com>|
|Date:||Thu, 15 Jan 2009 02:32:06 +0100|
|Posted-Date:||15 Jan 2009 05:37:06 EST|
glen herrmannsfeldt schrieb:
> I know compilers have done compile time evaluation of scalar constant
> expressions for many years. I wonder about the state of the art in
> compile time evaluation of constant array expressions. I would
> include the case of arrays in initialized variables that are known at
> compile time not to change.
It's a matter of the operations, that are allowed in constant
expressions. When array member selection is considered such a
"constant operation", then a compiler has to implement indexing into
constant arrays as part of the evaluation of constant expressions.
> Do any compilers now do compile time
> evaluation of complicated array expressions?
The "constant expression evaluator" can be seen as part of a
compiler, interpreting any expression and returning both a flag,
whether the expression really was a constant expression, and, if true,
also returning the according constant value.
Return to the
Search the comp.compilers archives again.