absl::c_transform

Performs a transformation using a binary predicate. Stores the result in output. Applies binary_op to the first N elements of input1 and input2, where N = min(size(input1), size(input2)).

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename InputSequence1,
    typename InputSequence2,
    typename OutputRange,
    typename BinaryOp>
constexpr
std::common_type_t</* implementation-defined */, /* implementation-defined */>
c_transform(
    InputSequence1 const& input1,
    InputSequence2 const& input2,
    OutputRange&& output,
    BinaryOp&& binary_op);

Description

The output container must be large enough to hold all N elements; this function does not resize output.

Return Value

This overload returns no value; the results are written into output.

Parameters

NameDescription
input1The first input container.
input2The second input container.
outputThe destination container receiving the transformed elements.
binary_opThe binary operation applied to element pairs.