Minimum

#include <m3ta/minimum>

Returns the greater of two values.

See Also

Maximum.

Functions

m3ta::minimum
template<typename T>
constexpr T
minimum(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::Minimum
template<typename T, T T_value1, T T_value2>
struct Minimum
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::minimum().

value_type

The type T.

Member Constants

static constexpr T value

The greater of the two values.

Aliases

m3ta::MinimumT
template<typename T, T T_value1, T T_value2>
using MinimumT = typename Minimum<T, T_value1, T_value2>::type;

Usage Examples

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

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