Recursive typedef

Markus Dangl danglm at in.tum.de
Thu Oct 5 10:29:19 PDT 2006


BCS schrieb:
> But it does make for a cool state machine!!!
> 
> State at = &seed;
> while(null !is at) at = cast(State)at();
> 
> or
> 
> state at = &seed;
> while(null !is at.use) at = cast(state)at.use();

That's exactly what i use it for - it's almost functional programming :)



More information about the Digitalmars-d-learn mailing list