From 133d748e79fa41288b175ac17abecd6012a008e8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 9 Jun 2023 14:22:10 +0200 Subject: newtype: remove left-over enable_ifs --- source/lib/include/newtype/newtype.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/lib/include/newtype/newtype.hpp b/source/lib/include/newtype/newtype.hpp index aee68da..74896ef 100644 --- a/source/lib/include/newtype/newtype.hpp +++ b/source/lib/include/newtype/newtype.hpp @@ -928,26 +928,30 @@ namespace nt return this->m_value; } - template * = nullptr> + template constexpr operator base_type() const noexcept(std::is_nothrow_copy_constructible_v) + requires(nt::contains) { return decay(); } - template * = nullptr> + template explicit constexpr operator base_type() const noexcept(std::is_nothrow_copy_constructible_v) + requires(!nt::contains) { return decay(); } - template - auto constexpr operator->() noexcept -> std::enable_if_t + template + requires(nt::contains) + auto constexpr operator->() noexcept -> BaseType * { return std::addressof(this->m_value); } - template - auto constexpr operator->() const noexcept -> std::enable_if_t + template + requires(nt::contains) + auto constexpr operator->() const noexcept -> BaseType const * { return std::addressof(this->m_value); } -- cgit v1.2.3