Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::full_ordering_operators_from_three_way_compare< Derived, Other > Class Template Reference

Helper class that can be inherited from by a class to define the <, >, <=, >=, ==, and != comparison operators in terms of a three_way_compare function provided by the Derived class. More...

Inheritance diagram for arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >:
Inheritance graph

Protected Member Functions

constexpr full_ordering_operators_from_three_way_compare () noexcept=default
 Default constructor is protected.
 
constexpr full_ordering_operators_from_three_way_compare (full_ordering_operators_from_three_way_compare &&other) noexcept=default
 Default move constructor is protected.
 
constexpr full_ordering_operators_from_three_way_compare (full_ordering_operators_from_three_way_compare const &other) noexcept=default
 Default copy constructor is protected.
 
constexpr auto operator= (full_ordering_operators_from_three_way_compare &&other) &noexcept -> full_ordering_operators_from_three_way_compare &=default
 Default move assignment is protected.
 
constexpr auto operator= (full_ordering_operators_from_three_way_compare const &other) &noexcept -> full_ordering_operators_from_three_way_compare &=default
 Default copy assignment is protected.
 
 ~full_ordering_operators_from_three_way_compare () noexcept=default
 Default destructor is protected.
 

Friends

ARENE_NODISCARD friend constexpr auto operator== (Derived const &lhs, Other const &rhs) noexcept -> bool
 Equality comparison operator for instances of Derived and Other.
 

Detailed Description

template<typename Derived, typename Other = Derived>
class arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >

Helper class that can be inherited from by a class to define the <, >, <=, >=, ==, and != comparison operators in terms of a three_way_compare function provided by the Derived class.

Requires that the derived class provides a static member function three_way_compare that accepts two const Derived& and returns a strong_ordering value indicating whether the first is less than, equal to or greater than the second. This three_way_compare functions must not throw exceptions.

Template Parameters
DerivedThe type of the derived class. The comparison operators provided take parameters of this type.

For example:

class MyClass :
...
friend arene::base::string_ordering three_way_compare(
const MyClass& a, const MyClass& b) noexcept;
};
Helper class that can be inherited from by a class to define the <, >, <=, >=, ==,...
Definition operators.hpp:442
Deprecated
Prefer arene::base::generic_ordering_from_three_way_compare

Constructor & Destructor Documentation

◆ full_ordering_operators_from_three_way_compare() [1/3]

template<typename Derived, typename Other = Derived>
arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >::full_ordering_operators_from_three_way_compare ( )
constexprprotecteddefaultnoexcept

Default constructor is protected.

◆ full_ordering_operators_from_three_way_compare() [2/3]

template<typename Derived, typename Other = Derived>
arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >::full_ordering_operators_from_three_way_compare ( full_ordering_operators_from_three_way_compare< Derived, Other > const & other)
constexprprotecteddefaultnoexcept

Default copy constructor is protected.

Parameters
otherThe source object

◆ full_ordering_operators_from_three_way_compare() [3/3]

template<typename Derived, typename Other = Derived>
arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >::full_ordering_operators_from_three_way_compare ( full_ordering_operators_from_three_way_compare< Derived, Other > && other)
constexprprotecteddefaultnoexcept

Default move constructor is protected.

Parameters
otherThe source object

Member Function Documentation

◆ operator=() [1/2]

template<typename Derived, typename Other = Derived>
auto arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >::operator= ( full_ordering_operators_from_three_way_compare< Derived, Other > && other) & -> full_ordering_operators_from_three_way_compare &=default
constexprprotecteddefaultnoexcept

Default move assignment is protected.

Parameters
otherThe source object

◆ operator=() [2/2]

template<typename Derived, typename Other = Derived>
auto arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >::operator= ( full_ordering_operators_from_three_way_compare< Derived, Other > const & other) & -> full_ordering_operators_from_three_way_compare &=default
constexprprotecteddefaultnoexcept

Default copy assignment is protected.

Parameters
otherThe source object

◆ ~full_ordering_operators_from_three_way_compare()

template<typename Derived, typename Other = Derived>
arene::base::full_ordering_operators_from_three_way_compare< Derived, Other >::~full_ordering_operators_from_three_way_compare ( )
protecteddefaultnoexcept

Default destructor is protected.

Friends And Related Symbol Documentation

◆ operator==

template<typename Derived, typename Other = Derived>
ARENE_NODISCARD friend constexpr auto operator== ( Derived const & lhs,
Other const & rhs ) -> bool
friend

Equality comparison operator for instances of Derived and Other.

Parameters
lhsThe first object being compared
rhsThe second object being compared
Returns
True if lhs is equal to rhs, false otherwise.

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