Skip to content

iox::algorithm🔗

Functions🔗

Name
template <typename T >
constexpr T
max(const T & left)
Returns the maximum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which is required as generic recursive template endpoint.
template <typename T >
constexpr T
max(const T & left, const T & right)
Returns the maximum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which takes two arguments and returns the greater one.
template <typename T ,typename... Targs>
constexpr T
max(const T & left, const T & right, const Targs &... args)
Returns the maximum gained with operator<() of an arbitrary amount of variables of the same type.
template <typename T >
constexpr T
min(const T & left)
Returns the minimum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which is required as generic recursive template endpoint.
template <typename T >
constexpr T
min(const T & left, const T & right)
Returns the minimum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which takes two arguments and returns the smaller one.
template <typename T ,typename... Targs>
constexpr T
min(const T & left, const T & right, const Targs &... args)
Returns the minimum gained with operator<() of an arbitrary amount of variables of the same type.
template <typename T ,typename CompareType >
constexpr bool
doesContainType()
Returns true if T is equal to CompareType, otherwise false.
template <typename T ,typename CompareType ,typename Next ,typename... Remainder>
constexpr bool
doesContainType()
Returns true if T is contained the provided type list.
template <typename T >
constexpr bool
doesContainValue(const T)
Finalizes the recursion of doesContainValue.
template <typename T ,typename... ValueList>
constexpr bool
doesContainValue(const T value, const T firstValueListEntry, const ValueList... remainingValueListEntries)
Returns true if value of T is found in the ValueList, otherwise false.
template <typename Container >
Container
uniqueMergeSortedContainers(const Container & v1, const Container & v2)
Merging two sorted containers so that the result is a sorted container where every element is contained only once.

Functions Documentation🔗

function max🔗

template <typename T >
constexpr T max(
    const T & left
)

Returns the maximum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which is required as generic recursive template endpoint.

Parameters:

  • T type which implements operator<()
  • left value which should be compared

Return: returns the given argument left

function max🔗

template <typename T >
constexpr T max(
    const T & left,
    const T & right
)

Returns the maximum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which takes two arguments and returns the greater one.

Parameters:

  • T type which implements operator<()
  • left value which should be compared
  • right value which should be compared

Return: returns the maximum value of the set {left, right}

function max🔗

template <typename T ,
typename... Targs>
constexpr T max(
    const T & left,
    const T & right,
    const Targs &... args
)

Returns the maximum gained with operator<() of an arbitrary amount of variables of the same type.

Parameters:

  • T type which implements operator<()
  • left value which should be compared
  • right value which should be compared
  • args... an arbitrary amount of values

Return: returns the maximum value of the set {left, right, args...}

function min🔗

template <typename T >
constexpr T min(
    const T & left
)

Returns the minimum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which is required as generic recursive template endpoint.

Parameters:

  • T type which implements operator<()
  • left value which should be compared

Return: returns the given argument left

function min🔗

template <typename T >
constexpr T min(
    const T & left,
    const T & right
)

Returns the minimum gained with operator<() of an arbitrary amount of variables of the same type. Helper function which takes two arguments and returns the smaller one.

Parameters:

  • T type which implements operator<()
  • left value which should be compared
  • right value which should be compared

Return: returns the minimum of the set {left, right}

function min🔗

template <typename T ,
typename... Targs>
constexpr T min(
    const T & left,
    const T & right,
    const Targs &... args
)

Returns the minimum gained with operator<() of an arbitrary amount of variables of the same type.

Parameters:

  • T type which implements operator<()
  • left value which should be compared
  • right value which should be compared
  • args... an arbitrary amount of values

Return: returns the minimum of the set {left, right, args...}

function doesContainType🔗

template <typename T ,
typename CompareType >
constexpr bool doesContainType()

Returns true if T is equal to CompareType, otherwise false.

Parameters:

  • T type to compare to
  • CompareType the type to which T is compared

Return: true if the types T and CompareType are equal, otherwise false

function doesContainType🔗

template <typename T ,
typename CompareType ,
typename Next ,
typename... Remainder>
constexpr bool doesContainType()

Returns true if T is contained the provided type list.

Parameters:

  • T type to compare to
  • CompareTypeNextRemainder the type list in which T should be contained

Return: true if the T is contained in the type list, otherwise false

function doesContainValue🔗

template <typename T >
inline constexpr bool doesContainValue(
    const T
)

Finalizes the recursion of doesContainValue.

Parameters:

  • T type of the value to check

Return: always false

function doesContainValue🔗

template <typename T ,
typename... ValueList>
inline constexpr bool doesContainValue(
    const T value,
    const T firstValueListEntry,
    const ValueList... remainingValueListEntries
)

Returns true if value of T is found in the ValueList, otherwise false.

Parameters:

  • value to look for in the ValueList
  • firstValueListEntry is the first variadic argument of ValueList
  • remainingValueListEntries are the remaining variadic arguments of ValueList

Template Parameters:

  • T type of the value to check
  • ValueList is a list of values to check for a specific value

function uniqueMergeSortedContainers🔗

template <typename Container >
Container uniqueMergeSortedContainers(
    const Container & v1,
    const Container & v2
)

Merging two sorted containers so that the result is a sorted container where every element is contained only once.

Parameters:

  • v1 the first sorted input container
  • v2 the second sorted input container

Template Parameters:

  • Container container type which has to support emplace_back() and size()

Return: sorted container which contains the elements of v1 and v2 and where every element is unique


Updated on 18 December 2023 at 13:02:34 CET