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

Helper class that can be inherited from by a class to define the != operator in terms of the == operator defined by that class. More...

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

Protected Member Functions

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

Friends

ARENE_NODISCARD friend constexpr auto operator== (Other const &lhs, Derived 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_equality_operators_from_basic_equality< Derived, Other >

Helper class that can be inherited from by a class to define the != operator in terms of the == operator defined by that class.

Requires that operator==(const Derived&, const Other&) is defined and does not throw exceptions

Template Parameters
DerivedThe type of the derived class. The comparison operators provided take parameters of this type.
OtherThe type of the other object to compare. The comparison operators provided take parameters of this type.

For example:

{
...
// No need to explicitly define 'operator!=' here.
friend bool operator==(const MyClass& a, const MyClass& b) noexcept;
};
Helper class that can be inherited from by a class to define the != operator in terms of the == opera...
Definition operators.hpp:95
ARENE_NODISCARD friend constexpr auto operator==(Other const &lhs, Derived const &rhs) noexcept -> bool
Equality comparison operator for instances of Derived and Other.
Definition operators.hpp:102

Constructor & Destructor Documentation

◆ full_equality_operators_from_basic_equality() [1/3]

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

Default constructor is protected.

◆ full_equality_operators_from_basic_equality() [2/3]

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

Default copy constructor is protected.

Parameters
otherThe value to copy from

◆ full_equality_operators_from_basic_equality() [3/3]

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

Default move constructor is protected.

Parameters
otherThe value to copy from

Member Function Documentation

◆ operator=() [1/2]

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

Default move assignment is protected.

Parameters
otherThe value to copy from

◆ operator=() [2/2]

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

Default copy assignment is protected.

Parameters
otherThe value to copy from

◆ ~full_equality_operators_from_basic_equality()

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

Default destructor is protected.

Friends And Related Symbol Documentation

◆ operator==

template<typename Derived, typename Other = Derived>
ARENE_NODISCARD friend constexpr auto operator== ( Other const & lhs,
Derived 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
bool Result of lhs==rhs

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