diff --git a/include/continuable/detail/traits.hpp b/include/continuable/detail/traits.hpp index 231f44d..e5a8d68 100644 --- a/include/continuable/detail/traits.hpp +++ b/include/continuable/detail/traits.hpp @@ -87,31 +87,6 @@ using void_t = typename detail::deduce_to_void::type; #endif // CONTINUABLE_HAS_CXX17_VOID_T namespace detail { -template -constexpr void static_if_impl(std::true_type, Type&& type, - TrueCallback&& trueCallback) { - std::forward(trueCallback)(std::forward(type)); -} - -template -constexpr void static_if_impl(std::false_type, Type&& /*type*/, - TrueCallback&& /*trueCallback*/) { -} - -template -constexpr auto static_if_impl(std::true_type, Type&& type, - TrueCallback&& trueCallback, - FalseCallback&& /*falseCallback*/) { - return std::forward(trueCallback)(std::forward(type)); -} - -template -constexpr auto static_if_impl(std::false_type, Type&& type, - TrueCallback&& /*trueCallback*/, - FalseCallback&& falseCallback) { - return std::forward(falseCallback)(std::forward(type)); -} - /// Evaluates to the size of the given tuple like type, // / if the type has no static size it will be one. template @@ -143,27 +118,6 @@ constexpr auto sequence_of(identity) noexcept { return std::make_index_sequence(); } -/// Invokes the callback only if the given type matches the check -template -constexpr void static_if(Type&& type, Check&& check, - TrueCallback&& trueCallback) { - detail::static_if_impl(std::forward(check)(type), - std::forward(type), - std::forward(trueCallback)); -} - -/// Invokes the callback only if the given type matches the check -template -constexpr auto static_if(Type&& type, Check&& check, - TrueCallback&& trueCallback, - FalseCallback&& falseCallback) { - return detail::static_if_impl(std::forward(check)(type), - std::forward(type), - std::forward(trueCallback), - std::forward(falseCallback)); -} - namespace detail { /// Calls the given unpacker with the content of the given sequenceable template