HomeManualTopicsTypesSymbols

std_types::binary_table/std::reduce

computes a kind of sum from the values stored in the table

Parameters

self
the table to build the "sum" from
function
the function to apply to pairs of values
unit (default: undefined)
the value to return for empty tables

Results

None

Description

There is no guarantee in which order the values will be reduced (folded).

So the reduction function must obey to the law of assosiativity!

Topic

Tables

Implements

std::reduce computes a kind of sum from the items of a collection

See also

std::map applies a function to all items of a collection
std::map_reduce combines a map and a reduce operation into a single operation