Conditional Pure?

%u wfunction at hotmail.com
Sat Jan 22 14:41:08 PST 2011


> I think this is useless. If this is possible, then you just mark every single
not-pure function in the program with @conditionally_pure, and we are back to the
beginning.


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.


More information about the Digitalmars-d mailing list