[libcxx-commits] [libcxx] [libc++] P1789R3: Library Support for Expansion Statements (PR #167184)
Matthias Wippich via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Dec 14 22:01:06 PST 2025
================
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++26
+
+// <utility>
+
+// template<size_t I, class T, T... Values>
+// struct tuple_element<I, integer_sequence<T, Values...>>;
+// template<size_t I, class T, T... Values>
+// struct tuple_element<I, const integer_sequence<T, Values...>>;
+// template<size_t I, class T, T... Values>
+// constexpr T get(integer_sequence<T, Values...>) noexcept;
+
+#include <cassert>
+#include <utility>
+
+void test_structured_bindings() {
+ auto [elt0, elt1, elt2, elt3] = std::make_index_sequence<4>();
+
+ assert(elt0 == 0);
+ assert(elt1 == 1);
+ assert(elt2 == 2);
+ assert(elt3 == 3);
+}
+
+#if __cpp_structured_bindings >= 202411L
----------------
Tsche wrote:
I suppose we want to remove the check as soon as GCC 16 has been released then. GCC has been supporting this feature since August :)
https://github.com/llvm/llvm-project/pull/167184
More information about the libcxx-commits
mailing list