[libcxx-commits] [libcxx] [libc++][ranges] implement `std::ranges::zip_transform_view` (PR #79605)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 11 11:02:49 PDT 2025


================
@@ -0,0 +1,500 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_ZIP_TRANSFORM_TYPES_H
+#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_ZIP_TRANSFORM_TYPES_H
+
+#include <functional>
+#include <ranges>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "test_range.h"
+
+#if TEST_STD_VER <= 20
+#  error "range.zip.transform/types.h" can only be included in builds supporting C++20
+#endif // TEST_STD_VER <= 20
+
+struct IntView : std::ranges::view_base {
+  int* begin() const;
+  int* end() const;
+};
+
+struct Fn {
+  int operator()(auto&&...) const { return 5; }
+};
----------------
ldionne wrote:

IMO this is small enough that we should define it in each TU where it's used. Otherwise it's less readable to have to jump around just to see this simple definition.

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


More information about the libcxx-commits mailing list