aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2019-12-29 16:40:06 +0100
committerFelix Morgner <felix.morgner@gmail.com>2019-12-29 16:40:06 +0100
commit71ba0e2e24c1550494f33f88db0f534f6946c692 (patch)
treeeba4544b3521ba8f80a811a21974368d748b2709
parent993b49d9b0aba3a9e60ee2bc86aa72b5ee69d063 (diff)
downloadnewtype-71ba0e2e24c1550494f33f88db0f534f6946c692.tar.xz
newtype-71ba0e2e24c1550494f33f88db0f534f6946c692.zip
new_type: don't delete operators
-rw-r--r--include/newtype/new_type.hpp31
1 files 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<typename BaseType, typename TagType, auto DerivationClause>
- auto constexpr operator<(new_type<BaseType, TagType, DerivationClause> const &, new_type<BaseType, TagType, DerivationClause> const &)
- -> std::enable_if_t<!DerivationClause(nt::Relational) || !impl::is_less_than_comparable_v<BaseType>, 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<typename BaseType, typename TagType, auto DerivationClause>
- auto constexpr operator>(new_type<BaseType, TagType, DerivationClause> const &, new_type<BaseType, TagType, DerivationClause> const &)
- -> std::enable_if_t<!DerivationClause(nt::Relational) || !impl::is_greater_than_comparable_v<BaseType>, 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<typename BaseType, typename TagType, auto DerivationClause>
- auto constexpr operator<=(new_type<BaseType, TagType, DerivationClause> const &, new_type<BaseType, TagType, DerivationClause> const &)
- -> std::enable_if_t<!DerivationClause(nt::Relational) || !impl::is_less_than_equal_to_comparable_v<BaseType>, 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<typename BaseType, typename TagType, auto DerivationClause>
- auto constexpr operator>=(new_type<BaseType, TagType, DerivationClause> const & lhs,
- new_type<BaseType, TagType, DerivationClause> const & rhs)
- -> std::enable_if_t<!DerivationClause(nt::Relational) || !impl::is_greater_than_equal_to_comparable_v<BaseType>, bool> = delete;
-
/**
* @brief Write the contained base type object to a standard output stream
*