Infer purity of functions too?

bearophile bearophileHUGS at lycos.com
Mon Jul 18 13:01:08 PDT 2011


Maybe someone has already answered this question, but I don't remember it.

DMD 2.054 is able to infer if a template function is pure. Isn't it a good idea to use the same machinery to infer the unmarked functions too? A template may call a second function that's not annotated with 'pure' despite being pure. If the compiler is able to infer the purity of the second function, then both the template and the second function can be pure. This may offer optimization opportunities. Is doing this too much slow?

Bye and thank you,
bearophile


More information about the Digitalmars-d-learn mailing list