tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches

Various utility components. More...

Classes

struct  pair< T1, T2 >
 etl::pair is a class template that provides a way to store two heterogeneous objects as a single unit. A pair is a specific case of a etl::tuple with two elements. If neither T1 nor T2 is a possibly cv-qualified class type with non-trivial destructor, or array thereof, the destructor of pair is trivial. More...
 

Functions

template<builtin_integer T, builtin_integer U>
constexpr auto cmp_equal (T t, U u) noexcept -> bool
 Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.
 
template<builtin_integer T, builtin_integer U>
constexpr auto cmp_greater (T t, U u) noexcept -> bool
 Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.
 
template<builtin_integer T, builtin_integer U>
constexpr auto cmp_greater_equal (T t, U u) noexcept -> bool
 Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.
 
template<builtin_integer T, builtin_integer U>
constexpr auto cmp_less (T t, U u) noexcept -> bool
 Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.
 
template<builtin_integer T, builtin_integer U>
constexpr auto cmp_less_equal (T t, U u) noexcept -> bool
 Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.
 
template<builtin_integer T, builtin_integer U>
constexpr auto cmp_not_equal (T t, U u) noexcept -> bool
 Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.
 
template<builtin_integer R, builtin_integer T>
constexpr auto in_range (T t) noexcept -> bool
 Returns true if the value of t is in the range of values that can be represented in R, that is, if t can be converted to R without data loss.
 

Detailed Description

Various utility components.

Function Documentation

◆ cmp_equal()

template<builtin_integer T, builtin_integer U>
auto cmp_equal ( T t,
U u ) -> bool
nodiscardconstexprnoexcept

Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.

https://en.cppreference.com/w/cpp/utility/intcmp

Examples
utility.cpp.

◆ cmp_greater()

template<builtin_integer T, builtin_integer U>
auto cmp_greater ( T t,
U u ) -> bool
nodiscardconstexprnoexcept

Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.

https://en.cppreference.com/w/cpp/utility/intcmp

◆ cmp_greater_equal()

template<builtin_integer T, builtin_integer U>
auto cmp_greater_equal ( T t,
U u ) -> bool
nodiscardconstexprnoexcept

Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.

https://en.cppreference.com/w/cpp/utility/intcmp

◆ cmp_less()

template<builtin_integer T, builtin_integer U>
auto cmp_less ( T t,
U u ) -> bool
nodiscardconstexprnoexcept

Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.

https://en.cppreference.com/w/cpp/utility/intcmp

◆ cmp_less_equal()

template<builtin_integer T, builtin_integer U>
auto cmp_less_equal ( T t,
U u ) -> bool
nodiscardconstexprnoexcept

Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.

https://en.cppreference.com/w/cpp/utility/intcmp

◆ cmp_not_equal()

template<builtin_integer T, builtin_integer U>
auto cmp_not_equal ( T t,
U u ) -> bool
nodiscardconstexprnoexcept

Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed integers always compare less than (and not equal to) unsigned integers: the comparison is safe against lossy integer conversion.

https://en.cppreference.com/w/cpp/utility/intcmp

Examples
utility.cpp.

◆ in_range()

template<builtin_integer R, builtin_integer T>
auto in_range ( T t) -> bool
nodiscardconstexprnoexcept

Returns true if the value of t is in the range of values that can be represented in R, that is, if t can be converted to R without data loss.

https://en.cppreference.com/w/cpp/utility/in_range