We need a way to make functions pure and/or nothrow based on the

bearophile bearophileHUGS at lycos.com
Sun Nov 14 04:34:44 PST 2010


> @optional_tag(isPure!F, pure) int[] map(F)(F f, int[] data) {
>     int[] res;
>     foreach (x; data)
>         res ~= f(x);
>     return res;
> }

This may not suffice to correctly tell apart strong pure functions from weak pure ones...

Bye,
bearophile


More information about the Digitalmars-d mailing list