On Thu, 26 Jul 2012 19:35:56 +0200 "David Piepgrass" <[email protected]> wrote: > For example if I do > > enum twoPi = computePi() + computePi(); > > I don't know if the compiler computes PI once or twice. Does > someone know? But if I define this template: >
You could toss a ctfeWriteln (or whatever it's named) into 'computePi' and find out. It shouldn't NEED to evaluate it twice since CTFE isn't allowed to have any global mutable state.
