HomeManualTopicsTypesSymbols

std_types::generic_list/std::map_reduce

combines a map and a reduce operation into a single operation

Parameters

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

Results

None

Description

Does not create an intermediate list 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