reduceEx

Phobosのstd.algorithm.reduceの拡張です。 つまり、r.reduceEx!f(init)という呼び出しが有効になります。

  1. auto ref reduceEx(R r, E e)
    template reduceEx(f...)
    ref
    reduceEx
    (
    R
    E
    )
    (
    auto ref R r
    ,
    auto ref E e
    )
    if (
    is(typeof(std.algorithm.reduce!f(forward!e, forward!r)))
    )
    if (
    f.length >= 1
    )
  2. auto ref reduceEx(R r)

Members

Functions

reduceEx
auto ref reduceEx(R r, E e)
Undocumented in source. Be warned that the author may not have intended to support it.
reduceEx
auto ref reduceEx(R r)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

debug scope(failure) writefln("Unittest Failure :%s(%s) ", __FILE__, __LINE__);
debug scope(success) {writefln("Unittest Success :%s(%s)", __FILE__, __LINE__); stdout.flush();}

assert(reduceEx!"a+1"([1, 2, 3], 1) == reduce!"a+1"(1, [1, 2, 3]));
assert(reduceEx!"a+1"([1, 2, 3]) == reduce!"a+1"([1, 2, 3]));

Meta