[libcxx-commits] [libcxx] [libc++] Implement `views::join_with` (PR #65536)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 26 07:20:16 PST 2024
================
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// <ranges>
+
+// constexpr sentinel(sentinel<!Const> s)
+// requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
+
+#include <ranges>
+
+#include <type_traits>
+#include <vector>
+
+#include "../types.h"
+#include "test_iterators.h"
+
+constexpr bool test() {
+ { // Regular conversion from `!Const` to `Const` sentinel
+ using Inner = BasicVectorView<int, ViewProperties{.common = false}, forward_iterator>;
+ std::vector<Inner> vec = {Inner{11, 12}, Inner{13, 14}};
+
+ std::ranges::join_with_view jwv(vec, 0);
+ using JWV = decltype(jwv);
+ static_assert(!std::ranges::common_range<JWV>);
+ using CSent = std::ranges::sentinel_t<const JWV>;
----------------
huixie90 wrote:
can we `static_assert(!std::same_as<Sent, CSent>)` to make sure we are testing what we are supposed to test
https://github.com/llvm/llvm-project/pull/65536
More information about the libcxx-commits
mailing list