calcHistogram

Calculate range value histogram.

HistogramType
calcHistogram
(
Range
HistogramType = int[(ElementType!Range).max + 1]
)
(
Range range
)
if (
isForwardRange!Range &&
(
isDynamicArray!HistogramType ||
isStaticArray!HistogramType
)
)
in { static if (isStaticArray!HistogramType) { static assert (HistogramType.init.length == (ElementType!Range.max + 1), "Invalid histogram size - if given histogram type is static array, it has to be of lenght T.max + 1"); } }

Parameters

HistogramType

(template parameter) Histogram type. Can be static or dynamic array, most commonly of 32 bit integer, of size T.max + 1, where T is element type of input range.

range
Type: Range

Input forward range, for which histogram is calculated.

Return Value

Type: HistogramType

Histogram for given forward range.

Meta