[libcxx-commits] [libcxx] [libc++] Implement adjacent_view (PR #165089)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 5 12:03:56 PST 2025


================
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_ADJACENT_HELPERS_H
+#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_ADJACENT_HELPERS_H
+
+#include <tuple>
+
+// intentionally not using meta programming for the expected tuple types
+
+template <std::size_t N, class T>
+struct ExpectedTupleType;
+
+template <class T>
+struct ExpectedTupleType<1, T> {
+  using type = std::tuple<T>;
+};
+template <class T>
+struct ExpectedTupleType<2, T> {
+  using type = std::tuple<T, T>;
+};
+template <class T>
+struct ExpectedTupleType<3, T> {
+  using type = std::tuple<T, T, T>;
+};
+template <class T>
+struct ExpectedTupleType<4, T> {
+  using type = std::tuple<T, T, T, T>;
+};
+template <class T>
+struct ExpectedTupleType<5, T> {
+  using type = std::tuple<T, T, T, T, T>;
+};
+
+template <std::size_t N, class T>
+using expectedTupleType = typename ExpectedTupleType<N, T>::type;
+
+#endif // TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_ADJACENT_HELPERS_H
----------------
ldionne wrote:

Missing newline at the end.

https://github.com/llvm/llvm-project/pull/165089


More information about the libcxx-commits mailing list