From 9d9d1d5075071a117f941177cee2c5e9ff35c82a Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Wed, 15 May 2024 23:18:22 -0500 Subject: [PATCH] Try to make gcc 8 work --- src/utils.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/utils.hpp b/src/utils.hpp index e190fc5b..3f9c149f 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -107,15 +107,14 @@ namespace libassert::detail { } }; - // copied from cppref - template - constexpr std::array, N> to_array_impl(T(&&a)[N], std::index_sequence) { + // note: the use of U here is mainly to workaround a gcc 8 issue https://godbolt.org/z/bdsWhdGj3 + template + constexpr std::array, N> to_array_impl(U(&&a)[N], std::index_sequence) { return {{std::move(a[I])...}}; } - - template - constexpr std::array, N> to_array(T(&&a)[N]) { - return to_array_impl(std::move(a), std::make_index_sequence{}); + template + constexpr std::array, N> to_array(U(&&a)[N]) { + return to_array_impl(std::move(a), std::make_index_sequence{}); } template