From c4e3450fb1de240ec10eea27e8b9079cab5f8a55 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 22 Feb 2020 17:16:23 +0100 Subject: new_type: adjust enablement of begin --- include/newtype/new_type.hpp | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/include/newtype/new_type.hpp b/include/newtype/new_type.hpp index 0aa1a2e..ef36a75 100644 --- a/include/newtype/new_type.hpp +++ b/include/newtype/new_type.hpp @@ -224,17 +224,9 @@ namespace nt */ template * = nullptr> auto constexpr begin() - -> std::enable_if_t, typename NewType::iterator> + -> std::enable_if_t, typename NewType::iterator> { - if constexpr (impl::has_member_begin_v) - { - return this->m_value.begin(); - } - else - { - using std::begin; - return begin(this->m_value); - } + return this->m_value.begin(); } /** @@ -245,18 +237,10 @@ namespace nt * @throw Any exception thrown by the overload of 'begin' selected */ template - auto constexpr begin() const - -> std::enable_if_t, typename NewType::const_iterator> + auto constexpr begin() const -> std::enable_if_t, + typename NewType::const_iterator> { - if constexpr (impl::has_member_begin_v) - { - return this->m_value.begin(); - } - else - { - using std::begin; - return begin(this->m_value); - } + return this->m_value.begin(); } }; -- cgit v1.2.3