Template Function otyca::transform_vector

Function Documentation

template<typename InputType, typename OutputType, typename Function>
std::vector<OutputType> otyca::transform_vector(const std::vector<InputType> &input, Function func)

Transforms a vector by applying a function to each element.

This function takes an input vector of type InputType and applies the provided transformation function to each element, returning a new vector of transformed elements of type OutputType.

Template Parameters:
  • InputType – The type of elements in the input vector.

  • OutputType – The type of elements in the output vector.

  • Function – The type of the transformation function.

Parameters:
  • input – The input vector to be transformed.

  • func – The function that will be applied to each element of the input vector.

Returns:

A new vector containing the transformed elements.