sbepp
Loading...
Searching...
No Matches
sbepp::detail::required_base< T, Derived > Class Template Reference

Base class for required types. More...

#include <sbepp.hpp>

Public Types

using value_type = T
 Underlying type.
 

Public Member Functions

 required_base ()=default
 Default constructor. Constructs value-initialized object.
 
constexpr required_base (value_type val) noexcept
 Constructs from given value.
 
constexpr value_type value () const noexcept
 Returns underlying value.
 
constexpr value_typeoperator* () noexcept
 Returns reference to underlying value.
 
constexpr value_type operator* () const noexcept
 Returns underlying value.
 
constexpr bool in_range () const noexcept
 Checks if value is in [Derived::min_value(); Derived::max_value()] range.
 

Friends

Comparisons

Comparisons are performed on underlying values

auto operator<=> (const required_base &, const required_base &)=default
 Available only if SBEPP_HAS_THREE_WAY_COMPARISON == 1.
 
constexpr friend bool operator== (const required_base &lhs, const required_base &rhs) noexcept
 Tests if lhs is equal to rhs
 
constexpr friend bool operator!= (const required_base &lhs, const required_base &rhs) noexcept
 Tests if lhs is not equal to rhs
 
constexpr friend bool operator< (const required_base &lhs, const required_base &rhs) noexcept
 Tests if lhs is less than rhs
 
constexpr friend bool operator<= (const required_base &lhs, const required_base &rhs) noexcept
 Tests if lhs is less than or equal to rhs
 
constexpr friend bool operator> (const required_base &lhs, const required_base &rhs) noexcept
 Tests if lhs is greater than rhs
 
constexpr friend bool operator>= (const required_base &lhs, const required_base &rhs) noexcept
 Tests if lhs is greater than or equal to rhs
 

Detailed Description

template<typename T, typename Derived>
class sbepp::detail::required_base< T, Derived >

Base class for required types.

Note
in_range() check is not enforced implicitly, it's up to client to apply it

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