
22 Dec
2007
22 Dec
'07
9:51 a.m.
On Sat, 22 Dec 2007 16:26:18 +0200, Miguel Mitrofanov
Lazy constant in C:
int C1 (){ return 7; } C1 is computed only when you apply the operator () to it.
But that's not the point of lazyness. Lazy value is computed only ONCE.
Ok. I guess I cannot be sure I'll call C1 only once. How about this int C1(){ static c1=-9999; if(c1==-9999){ c1=7 } return c1 }