aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/newtype/new_type.hpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/newtype/new_type.hpp b/include/newtype/new_type.hpp
index 67e29c3..c0fb8d3 100644
--- a/include/newtype/new_type.hpp
+++ b/include/newtype/new_type.hpp
@@ -134,7 +134,9 @@ namespace nt
*/
template<typename BaseType, typename TagType, auto DerivationClause>
auto constexpr operator==(new_type<BaseType, TagType, DerivationClause> const & lhs,
- new_type<BaseType, TagType, DerivationClause> const & rhs) noexcept(noexcept(lhs.decay() == rhs.decay())) -> bool
+ new_type<BaseType, TagType, DerivationClause> const & rhs) noexcept(noexcept(std::declval<BaseType const &>() ==
+ std::declval<BaseType const &>()))
+ -> bool
{
return lhs.decay() == rhs.decay();
}
@@ -144,9 +146,11 @@ namespace nt
*/
template<typename BaseType, typename TagType, auto DerivationClause>
auto constexpr operator!=(new_type<BaseType, TagType, DerivationClause> const & lhs,
- new_type<BaseType, TagType, DerivationClause> const & rhs) noexcept(noexcept(!(lhs == rhs))) -> bool
+ new_type<BaseType, TagType, DerivationClause> const & rhs) noexcept(noexcept(std::declval<BaseType const &>() !=
+ std::declval<BaseType const &>()))
+ -> bool
{
- return !(lhs == rhs);
+ return lhs.decay() != rhs.decay();
}
} // namespace nt