HomeManualTopicsTypesSymbols

std_types::generic_array/std::map_reduce

combines a map and a reduce operation into a single operation

Parameters

self
the array to work on
map_function
the function to apply to each element of the array
reduce_function (default: append)
the function to apply to pairs of values
_unit (default: undefined)
the value to return for empty arrays

Results

None

Description

Does not create an intermediate array to hold the "mapped" values.

Topic

Lists

Implements

std::map_reduce combines a map and a reduce operation into a single operation

See also

std::map applies a function to all items of a collection
std::reduce computes a kind of sum from the items of a collection