Maximum

#include <m3ta/maximum>

Returns the greater of two values.

See Also

Minimum.

Functions

m3ta::maximum
template<typename T>
constexpr T
maximum(T value1, T value2) noexcept
Template Parameters:
 
  • T (automatically deduced) — Type of the values to compare.
Function Parameters:
 
  • value1 – First value to compare.
  • value2 – Second value to compare.

Returns

The greater of the two values.

Traits

m3ta::Maximum
template<typename T, T T_value1, T T_value2>
struct Maximum
Template Parameters:
 
  • T – Type of the values to check.
  • T_value1 – First value to compare.
  • T_value2 – Second value to compare.

Member Types

type

The type std::integral_constant<T, value> where value is the result of the function m3ta::maximum().

value_type

The type T.

Member Constants

static constexpr T value

The greater of the two values.

Aliases

m3ta::MaximumT
template<typename T, T T_value1, T T_value2>
using MaximumT = typename Maximum<T, T_value1, T_value2>::type;

Usage Examples

auto value = m3ta::maximum(1, 2); // 2

using Type = m3ta::MaximumT<int, 1, 2>; // std::integral_constant<int, 2>