Generic code: @autoconst, @autopure, @autonothrow

bearophile bearophileHUGS at lycos.com
Sun Aug 29 05:06:33 PDT 2010


Brad Roberts:
> Abs _should_ be pure.  If the type being passed to it is incapable performing
> the algorithm purely, then the type isn't valid to be used with abs.

I agree. On the other hand if you use multiprecision GNU numbers, your large numbers aren't immutable, you are able to change their sign in-place. Is it an abs() or something different like inplaceAbs()?

Bye,
bearophile


More information about the Digitalmars-d mailing list