From 71ba0e2e24c1550494f33f88db0f534f6946c692 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 29 Dec 2019 16:40:06 +0100 Subject: new_type: don't delete operators --- include/newtype/new_type.hpp | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/include/newtype/new_type.hpp b/include/newtype/new_type.hpp index 85f0d40..0b7d6d0 100644 --- a/include/newtype/new_type.hpp +++ b/include/newtype/new_type.hpp @@ -205,8 +205,8 @@ namespace nt /** * @brief Check if one nt::new_type object is less-than an other * - * @note This operator is only avalaible if the the derivation clause of this nt::new_type does contains nt::Relational and the base type is - * less-than comparable. Otherwise is is defined as deleted. + * @note This operator is only available if the the derivation clause of this nt::new_type does contains nt::Relational and the base type is + * less-than comparable. * @throw This comparison operator throws any exception thrown by the base type comparison operator. It it noexcept iff. the base type * comparison operator is noexcept. * @return true iff. the base type comparison operator returns true, false otherwise. @@ -220,15 +220,11 @@ namespace nt return lhs.decay() < rhs.decay(); } - template - auto constexpr operator<(new_type const &, new_type const &) - -> std::enable_if_t, bool> = delete; - /** * Check if one nt::new_type object is greater-than an other * - * @note This operator is only avalaible if the the derivation clause of this nt::new_type does contains nt::Relational and the base type is - * greater-than comparable. Otherwise is is defined as deleted. + * @note This operator is only available if the the derivation clause of this nt::new_type does contains nt::Relational and the base type is + * greater-than comparable. * @throw This comparison operator throws any exception thrown by the base type comparison operator. It it noexcept iff. the base type * comparison operator is noexcept. * @return true iff. the base type comparison operator returns true, false otherwise. @@ -242,14 +238,11 @@ namespace nt return lhs.decay() > rhs.decay(); } - template - auto constexpr operator>(new_type const &, new_type const &) - -> std::enable_if_t, bool> = delete; - /** * Check if one nt::new_type object is less-than or equal-to an other * - * @note This operator is only avalaible if the the derivation clause of this nt::new_type does contains nt::Relational + * @note This operator is only available if the the derivation clause of this nt::new_type does contains nt::Relational and the base type is + * less-than-or-equal-to comparable. * @throw This comparison operator throws any exception thrown by the base type comparison operator. It it noexcept iff. the base type * comparison operator is noexcept. * @return true iff. the base type comparison operator returns true, false otherwise. @@ -263,14 +256,11 @@ namespace nt return lhs.decay() <= rhs.decay(); } - template - auto constexpr operator<=(new_type const &, new_type const &) - -> std::enable_if_t, bool> = delete; - /** * Check if one nt::new_type object is greater-than or equal-to an other * - * @note This operator is only avalaible if the the derivation clause of this nt::new_type does contains nt::Relational + * @note This operator is only available if the the derivation clause of this nt::new_type does contains nt::Relational and the base type is + * greater-than-or-equal comparable * @throw This comparison operator throws any exception thrown by the base type comparison operator. It it noexcept iff. the base type * comparison operator is noexcept. * @return true iff. the base type comparison operator returns true, false otherwise. @@ -284,11 +274,6 @@ namespace nt return lhs.decay() >= rhs.decay(); } - template - auto constexpr operator>=(new_type const & lhs, - new_type const & rhs) - -> std::enable_if_t, bool> = delete; - /** * @brief Write the contained base type object to a standard output stream * -- cgit v1.2.3