Community

Why is std.algorithm.reduce not marked pure? It makes it impossible to
do things like this:
pure const int product(int[] args) {
return reduce!"a * b"(args);
}
T
--
Life is unfair. Ask too much from it, and it may decide you don't deserve what you have now either.

On Tuesday, 6 March 2012 at 22:39:20 UTC, H. S. Teoh wrote:
> Why is std.algorithm.reduce not marked pure?
It doesn't have to be - templates are inferred to be
pure or not.
If you take the const off that signature, your example
works in today's dmd.