HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
v1::bound_integer< Bounds > Struct Template Reference

#include <hikogui/numeric/bound_integer.hpp>

Public Types

using bound_type = interval<longreg_t>
 
using value_type
 The type that can hold the value of the bound integer.
 
using calculation_type
 The type that is used as a temporary during calculation.
 

Public Member Functions

constexpr bound_integer (bound_integer const &) noexcept=default
 
constexpr bound_integer (bound_integer &&) noexcept=default
 
constexpr bound_integeroperator= (bound_integer const &) noexcept=default
 
constexpr bound_integeroperator= (bound_integer &&) noexcept=default
 
constexpr bound_integer (numeric_limited auto other) noexcept(bounds.range_contains_type< decltype(other)>())
 
constexpr bound_integeroperator= (numeric_limited auto other) noexcept(bounds.range_contains_type< decltype(other)>())
 
template<bound_type OtherBound>
constexpr bound_integer (bound_integer< OtherBound > other) noexcept(OtherBound.is_fully_inside(bounds))
 
template<bound_type OtherBound>
constexpr bound_integeroperator= (bound_integer< OtherBound > other) noexcept(OtherBound.is_fully_inside(bounds))
 
constexpr operator bool () noexcept
 
constexpr bool holds_invariant () noexcept
 
auto operator- () const noexcept
 
template<bound_type RHSBounds>
constexpr bool operator== (bound_integer< RHSBounds > const &rhs) noexcept
 Compare equality of two integers.
 
template<bound_type RHSBounds>
constexpr std::strong_ordering operator<=> (bound_integer< RHSBounds > const &rhs) noexcept
 Compare two integers.
 
template<bound_type RHSBounds>
constexpr auto operator+ (bound_integer< RHSBounds > const &rhs) noexcept
 
template<bound_type RHSBounds>
constexpr auto operator- (bound_integer< RHSBounds > const &rhs) noexcept
 
template<bound_type RHSBounds>
constexpr auto operator* (bound_integer< RHSBounds > const &rhs) noexcept
 
template<bound_type RHSBounds>
constexpr auto operator/ (bound_integer< RHSBounds > const &rhs) noexcept(0 !=RHSBounds)
 
template<bound_type RHSBounds>
constexpr auto operator% (bound_integer< RHSBounds > const &rhs) noexcept(0 !=RHSBounds)
 

Static Public Member Functions

static constexpr bound_integer make_without_check (numeric_limited auto other) noexcept
 

Data Fields

value_type value
 The value of the integer.
 

Static Public Attributes

static constexpr bound_type bounds = Bounds
 

Detailed Description

template<interval< longreg_t > Bounds>
struct v1::bound_integer< Bounds >

Bound integer.

Member Typedef Documentation

◆ calculation_type

template<interval< longreg_t > Bounds>
using v1::bound_integer< Bounds >::calculation_type
Initial value:
std::conditional_t<bounds.type_contains_range<signed char>(), signed char,
std::conditional_t<bounds.type_contains_range<signed short>(), signed short,
std::conditional_t<bounds.type_contains_range<signed int>(), signed int,
std::conditional_t<bounds.type_contains_range<signed long>(), signed long,
std::conditional_t<bounds.type_contains_range<signed long long>(), signed long long,
longreg_t>>>>>
int64_t longreg_t
Signed integer twice the size of a standard CPU register.
Definition stdint.hpp:64
constexpr bool type_contains_range() const noexcept
Check if a given type can hold all values in the interval.
Definition interval.hpp:134

The type that is used as a temporary during calculation.

◆ value_type

template<interval< longreg_t > Bounds>
using v1::bound_integer< Bounds >::value_type
Initial value:
std::conditional_t<bounds.type_contains_range<signed char>(), signed char,
std::conditional_t<bounds.type_contains_range<unsigned char>(), unsigned char,
std::conditional_t<bounds.type_contains_range<signed short>(), signed short,
std::conditional_t<bounds.type_contains_range<unsigned short>(), unsigned short,
std::conditional_t<bounds.type_contains_range<signed int>(), signed int,
std::conditional_t<bounds.type_contains_range<unsigned int>(), unsigned int,
std::conditional_t<bounds.type_contains_range<signed long>(), signed long,
std::conditional_t<bounds.type_contains_range<unsigned long>(), unsigned long,
std::conditional_t<bounds.type_contains_range<signed long long>(), signed long long,
std::conditional_t<bounds.type_contains_range<unsigned long long>(), unsigned long long,
longreg_t>>>>>>>>>>

The type that can hold the value of the bound integer.

Member Function Documentation

◆ operator<=>()

template<interval< longreg_t > Bounds>
template<bound_type RHSBounds>
constexpr std::strong_ordering v1::bound_integer< Bounds >::operator<=> ( bound_integer< RHSBounds > const & rhs)
inlineconstexprnoexcept

Compare two integers.

◆ operator==()

template<interval< longreg_t > Bounds>
template<bound_type RHSBounds>
constexpr bool v1::bound_integer< Bounds >::operator== ( bound_integer< RHSBounds > const & rhs)
inlineconstexprnoexcept

Compare equality of two integers.

Field Documentation

◆ value

template<interval< longreg_t > Bounds>
value_type v1::bound_integer< Bounds >::value

The value of the integer.


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