carbon.algorithm

このモジュールは、標準ライブラリのstd.algorithmを強化します。

Public Imports

std.algorithm
public import std.algorithm;

Members

Functions

flatMap
auto flatMap(R r)

各要素にある関数を適用し、それらを結合します。 つまり、r.map!fun.concatと等価です

maxOf
ElementType!R maxOf(R range)
Undocumented in source. Be warned that the author may not have intended to support it.
minOf
ElementType!R minOf(R range)
Undocumented in source. Be warned that the author may not have intended to support it.
product
ElementType!R product(R range)
Undocumented in source. Be warned that the author may not have intended to support it.
scan
auto scan(R r)
auto scan(E iniValue, R r)

reduceは、レンジのすべての要素をたどりますが、scanはその途中結果を要素としてもつレンジです。

sum
ElementType!R sum(R range)

引数に与えられたレンジの総和を返します。 引数には、無限レンジを渡すことができません。

Templates

reduceEx
template reduceEx(f...)

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

tmap
template tmap(fun...)

tmap

Meta