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 >
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 >
constexpr static 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 >
constexpr static auto kblib::nums::max_t::of ( )
inlinestaticconstexprnoexcept

Definition at line 201 of file stats.h.

◆ operator T()

template<typename T >
constexpr kblib::nums::max_t::operator T ( ) const
inlineconstexprnoexcept

Definition at line 196 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 210 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 220 of file stats.h.

◆ operator!= [2/3]

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

Definition at line 254 of file stats.h.

◆ operator!= [3/3]

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

Definition at line 250 of file stats.h.

◆ operator< [1/3]

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

Definition at line 224 of file stats.h.

◆ operator< [2/3]

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

Definition at line 263 of file stats.h.

◆ operator< [3/3]

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

Definition at line 259 of file stats.h.

◆ operator<= [1/3]

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

Definition at line 232 of file stats.h.

◆ operator<= [2/3]

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

Definition at line 280 of file stats.h.

◆ operator<= [3/3]

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

Definition at line 276 of file stats.h.

◆ operator== [1/3]

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

Definition at line 216 of file stats.h.

◆ operator== [2/3]

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

Definition at line 246 of file stats.h.

◆ operator== [3/3]

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

Definition at line 242 of file stats.h.

◆ operator> [1/3]

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

Definition at line 228 of file stats.h.

◆ operator> [2/3]

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

Definition at line 271 of file stats.h.

◆ operator> [3/3]

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

Definition at line 267 of file stats.h.

◆ operator>= [1/3]

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

Definition at line 236 of file stats.h.

◆ operator>= [2/3]

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

Definition at line 288 of file stats.h.

◆ operator>= [3/3]

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

Definition at line 284 of file stats.h.


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