kblib 0.2.3
General utilities library for modern C++
kblib::nums::max_t Struct Reference

Shorthand for std::numeric_limits::max(). More...

#include <kblib/stats.h>

Public Member Functions

template<typename T , std::enable_if_t< std::numeric_limits< T >::is_specialized, void > * = nullptr>
constexpr operator T () const noexcept(noexcept(std::numeric_limits< T >::max()))
 
template<typename L , typename R >
constexpr auto operator() (L &&lhs, R &&rhs) const noexcept -> decltype(auto)
 Return the larger of two values. Returns lhs if equal. More...
 

Static Public Member Functions

template<typename T >
static constexpr auto of () noexcept(noexcept(std::numeric_limits< T >::max()))
 

Friends

constexpr friend auto operator== (max_t, max_t) -> std::true_type
 
constexpr friend auto operator!= (max_t, max_t) -> std::false_type
 
constexpr friend auto operator< (max_t, max_t) -> std::false_type
 
constexpr friend auto operator> (max_t, max_t) -> std::false_type
 
constexpr friend auto operator<= (max_t, max_t) -> std::true_type
 
constexpr friend auto operator>= (max_t, max_t) -> std::true_type
 
template<typename T >
constexpr friend auto operator== (T t, max_t) -> bool
 
template<typename T >
constexpr friend auto operator== (max_t, T t) -> bool
 
template<typename T >
constexpr friend auto operator!= (T t, max_t) -> bool
 
template<typename T >
constexpr friend auto operator!= (max_t, T t) -> bool
 
template<typename T >
constexpr friend auto operator< (T t, max_t) -> bool
 
template<typename T >
constexpr friend auto operator< (max_t, T t) -> bool
 
template<typename T >
constexpr friend auto operator> (T t, max_t) -> bool
 
template<typename T >
constexpr friend auto operator> (max_t, T t) -> bool
 
template<typename T >
constexpr friend auto operator<= (T t, max_t) -> bool
 
template<typename T >
constexpr friend auto operator<= (max_t, T t) -> bool
 
template<typename T >
constexpr friend auto operator>= (T t, max_t) -> bool
 
template<typename T >
constexpr friend auto operator>= (max_t, T t) -> bool
 

Detailed Description

Shorthand for std::numeric_limits::max().

Implicitly converts to the maximum representable value of any numeric type. For unsigned destination types, -1 is shorter, but much less clear. For signed destination types, there is no concise representation for a generic maximum.

Also serves as a max(a, b) function object.

Definition at line 194 of file stats.h.

Member Function Documentation

◆ of()

template<typename T >
static constexpr auto kblib::nums::max_t::of ( )
inlinestaticconstexprnoexcept

Definition at line 203 of file stats.h.

◆ operator T()

template<typename T , std::enable_if_t< std::numeric_limits< T >::is_specialized, void > * = nullptr>
constexpr kblib::nums::max_t::operator T ( ) const
inlineconstexprnoexcept

Definition at line 198 of file stats.h.

◆ operator()()

template<typename L , typename R >
constexpr auto kblib::nums::max_t::operator() ( L &&  lhs,
R &&  rhs 
) const -> decltype(auto)
inlineconstexprnoexcept

Return the larger of two values. Returns lhs if equal.

Definition at line 212 of file stats.h.

Friends And Related Function Documentation

◆ operator!= [1/3]

constexpr friend auto operator!= ( max_t  ,
max_t   
) -> std::false_type
friend

Definition at line 222 of file stats.h.

◆ operator!= [2/3]

template<typename T >
constexpr friend auto operator!= ( max_t  ,
t 
) -> bool
friend

Definition at line 256 of file stats.h.

◆ operator!= [3/3]

template<typename T >
constexpr friend auto operator!= ( t,
max_t   
) -> bool
friend

Definition at line 252 of file stats.h.

◆ operator< [1/3]

constexpr friend auto operator< ( max_t  ,
max_t   
) -> std::false_type
friend

Definition at line 226 of file stats.h.

◆ operator< [2/3]

template<typename T >
constexpr friend auto operator< ( max_t  ,
t 
) -> bool
friend

Definition at line 265 of file stats.h.

◆ operator< [3/3]

template<typename T >
constexpr friend auto operator< ( t,
max_t   
) -> bool
friend

Definition at line 261 of file stats.h.

◆ operator<= [1/3]

constexpr friend auto operator<= ( max_t  ,
max_t   
) -> std::true_type
friend

Definition at line 234 of file stats.h.

◆ operator<= [2/3]

template<typename T >
constexpr friend auto operator<= ( max_t  ,
t 
) -> bool
friend

Definition at line 282 of file stats.h.

◆ operator<= [3/3]

template<typename T >
constexpr friend auto operator<= ( t,
max_t   
) -> bool
friend

Definition at line 278 of file stats.h.

◆ operator== [1/3]

constexpr friend auto operator== ( max_t  ,
max_t   
) -> std::true_type
friend

Definition at line 218 of file stats.h.

◆ operator== [2/3]

template<typename T >
constexpr friend auto operator== ( max_t  ,
t 
) -> bool
friend

Definition at line 248 of file stats.h.

◆ operator== [3/3]

template<typename T >
constexpr friend auto operator== ( t,
max_t   
) -> bool
friend

Definition at line 244 of file stats.h.

◆ operator> [1/3]

constexpr friend auto operator> ( max_t  ,
max_t   
) -> std::false_type
friend

Definition at line 230 of file stats.h.

◆ operator> [2/3]

template<typename T >
constexpr friend auto operator> ( max_t  ,
t 
) -> bool
friend

Definition at line 273 of file stats.h.

◆ operator> [3/3]

template<typename T >
constexpr friend auto operator> ( t,
max_t   
) -> bool
friend

Definition at line 269 of file stats.h.

◆ operator>= [1/3]

constexpr friend auto operator>= ( max_t  ,
max_t   
) -> std::true_type
friend

Definition at line 238 of file stats.h.

◆ operator>= [2/3]

template<typename T >
constexpr friend auto operator>= ( max_t  ,
t 
) -> bool
friend

Definition at line 290 of file stats.h.

◆ operator>= [3/3]

template<typename T >
constexpr friend auto operator>= ( t,
max_t   
) -> bool
friend

Definition at line 286 of file stats.h.


The documentation for this struct was generated from the following file: