Daniel Davidson:

If you are agreeing that chain should be pure and it is just following all the calls and making all of them pure, until that happens by the professionals - is there a casting solution so I can fake a pure and move on?

chain is a template, and in Phobos often templates are not annotated with pure/nothrow, the compiler infers those attributes.

Regarding your code, perhaps you can put your call in an impure delegate and than cast it, but D has no direct means to "cast" purity, because it's highly unsafe and it's against the idea of having purity in the language.

So I suggest to replace the pure in your function/method tree with /*pure*/, and later fix the code if/when chains becomes pure.

Bye,
bearophile

Reply via email to