From 0e389815b70eb47d592b6e5ab8d868cb7a200374 Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Mon, 16 Sep 2024 19:42:19 +0200 Subject: [PATCH] fix: Compilation error due to missing std::tuple_size_v --- src/ltpl/tuple.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ltpl/tuple.hpp b/src/ltpl/tuple.hpp index 703b4ea..4ed6295 100644 --- a/src/ltpl/tuple.hpp +++ b/src/ltpl/tuple.hpp @@ -53,6 +53,13 @@ concept WeaklyEqualityComparableWith = { u != t } -> ConvertibleTo; }; +// Not including for std::tuple_size_v +template +inline constexpr std::size_t tuple_size_v = 1; + +template +inline constexpr std::size_t tuple_size_v> = sizeof...(T); + // Test that the types list does not contain just one element that is decay-equal to T. template inline constexpr bool is_not_exactly_v = true; @@ -483,12 +490,12 @@ template template [[nodiscard]] constexpr decltype(auto) tuple_cat(Tuples&&... tuples) noexcept { - constexpr auto total_size = (std::tuple_size_v> + ...); + constexpr auto total_size = (detail::tuple_size_v> + ...); constexpr auto indices = [&] { std::array array{}; size_t i{}; - for (std::size_t outer{}; auto tuple_size : {std::tuple_size_v>...}) + for (std::size_t outer{}; auto tuple_size : {detail::tuple_size_v>...}) { for (size_t inner{}; inner != tuple_size; ++inner) {