How to break const
deadalnix
deadalnix at gmail.com
Mon Jun 18 07:48:36 PDT 2012
Le 18/06/2012 16:44, Mehrdad a écrit :
> Interesting, making the delegate `pure' doesn't change anything either.
>
> So 'pure' doesn't let you "infer something just by looking at the code
> either", right?
It does ! It tell you that the function have no side effect, and that
the function called with identical arguments will return identical results.
pure will not ensure constness or immutability. const and immutable are
made for that.
The fact that D decouple purity and immutability is a very nice design
decision and is explained nicely here :
http://klickverbot.at/blog/2012/05/purity-in-d/
More information about the Digitalmars-d
mailing list