Semantics of ^^, Version 3 (Final?)

Rainer Deyke rainerd at eldwood.com
Wed Dec 9 02:18:22 PST 2009


Don wrote:
> Rainer Deyke wrote:
>> Not quite.  Under the proposal, -1^^-1 works (i.e. produces the correct
>> result) at compile time but fails at runtime.
> 
> It won't pass CTFE.

pure int f() { return -1; }
void g(int)(int);
g!(f() ^^ f())(0); // Works.
g!(0)(f() ^^ f()); // Runtime error?

'f() ^^ f()' can be a compile-time constant, but isn't guaranteed to be
evaluated at compile time.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list