Conditional Pure?
bearophile
bearophileHUGS at lycos.com
Sat Jan 22 15:15:47 PST 2011
%u:
> Oh, but that's not what I meant! I meant something like this:
>
> int call(TFn)(TFn fn) pure(isPure!(TFn))
> if (isCallable!(TFn))
> {
> return fn(5);
> }
>
> This way we specify purity based on a static boolean.
I see. I'd like a more general-purpose solution, something that works with nothrow too and other future attributes too. So I have suggested:
http://d.puremagic.com/issues/show_bug.cgi?id=5125
Bye,
bearophile
More information about the Digitalmars-d
mailing list