indefinable type
Unknown W. Brackets
unknown at simplemachines.org
Mon Feb 20 23:02:37 PST 2006
I think you could use "static if (is(typeof(dg) T))" to do this, more or
less. Not sure, would have to mess with it.
Read more here:
http://www.digitalmars.com/d/expression.html#IsExpression
-[Unknown]
> dg is a delegate and must return a value of the same type as it self. What
> should "some_type" be to make this work?
>
> some_type delegate() dg;
>
> /*********/
> while( (dg = dg()) !is null){}
>
>
> (in case you are wondering this would act as a finite state machine)
>
>
More information about the Digitalmars-d-learn
mailing list