On 2011-06-15 23:29:46 -0400, Charles McAnany <mcana...@rose-hulman.edu> said:

Ah, so does the compiler figure out which ones are strongly and weakly pure and then optimize as appropriate? Is there a way to indicate that a function is strongly pure? Because it would seem odd
to call a function you thought was pure and wind up with a mutated argument.

Just make sure all the parameters are either const or immutable or passed by copy and do not contain any pointer or reference. That'll make the function strongly pure, and the compiler will be able optimize.

--
Michel Fortin
michel.for...@michelf.com
http://michelf.com/

Reply via email to