On Sun, 31 Oct 2010 19:20:04 -0400, bearophile <bearophileh...@lycos.com>
wrote:
Simen kjaeraas:
They take both, in fact:
auto cubes = map!((a){ return a*a*a; })(arr);
But that needs to be compile-time constant, so if you have several
functions, you need to put them inside a typetuple, or duplicate the
code. And some idioms are just not possible.
I don't think it needs to be a compile-time constant.
I think one of the most horrible problems with documenting D templates is
it's impossible to tell what's possible without trying it.
-Steve