diff --git a/include/continuable/detail/traits.hpp b/include/continuable/detail/traits.hpp index 9b40d2f..10b8cf0 100644 --- a/include/continuable/detail/traits.hpp +++ b/include/continuable/detail/traits.hpp @@ -86,38 +86,6 @@ template using void_t = typename detail::deduce_to_void::type; #endif // CONTINUABLE_HAS_CXX17_VOID_T -namespace detail { -/// Evaluates to the size of the given tuple like type, -// / if the type has no static size it will be one. -template -struct tuple_like_size : std::integral_constant {}; -template -struct tuple_like_size::value)>> - : std::tuple_size {}; -} // namespace detail - -/// Returns the pack size of the given empty pack -constexpr std::size_t pack_size_of(identity<>) noexcept { - return 0U; -} -/// Returns the pack size of the given type -template -constexpr std::size_t pack_size_of(identity) noexcept { - return detail::tuple_like_size::value; -} -/// Returns the pack size of the given type -template -constexpr std::size_t pack_size_of(identity) noexcept { - return 2U + sizeof...(Args); -} - -/// Returns an index sequence of the given type -template -constexpr auto sequence_of(identity) noexcept { - constexpr auto const size = pack_size_of(identity{}); - return std::make_index_sequence(); -} - namespace detail { /// Calls the given unpacker with the content of the given sequenceable template diff --git a/include/continuable/detail/util.hpp b/include/continuable/detail/util.hpp index c03d1a0..2ba04c0 100644 --- a/include/continuable/detail/util.hpp +++ b/include/continuable/detail/util.hpp @@ -59,7 +59,7 @@ auto forward_except_last_impl(T&& tuple, /// Forwards every element in the tuple except the last one template auto forward_except_last(T&& sequenceable) { - constexpr auto const size = pack_size_of(traits::identify()) - 1U; + constexpr auto const size = std::tuple_size>::value - 1U; constexpr auto const sequence = std::make_index_sequence(); return forward_except_last_impl(std::forward(sequenceable), sequence);