map

Static array overload for std.algorithm.iteration.map.

typeof(fun(E.init))[n]
map
(
alias fun
E
size_t n
)
(
const E[n] src
)

Examples

import std.meta : AliasSeq;
foreach (E; AliasSeq!(int, double))
{
    enum n = 42;
    E[n] c;
    const result = c.map!(_ => _^^2);
    static assert(c.length == result.length);
    static assert(is(typeof(result) == const(E)[n]));
}

See Also

http://forum.dlang.org/thread/rqlittlysttwxwphlnmh@forum.dlang.org TODO Add to Phobos

Meta