[libcxx-commits] [libcxx] [libc++][spaceship] Implements X::iterator container requirements. (PR #99343)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 23 09:00:16 PDT 2024


================
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <span>
+
+// class iterator
+
+#include <cassert>
+#include <concepts>
+#include <iterator>
+#include <span>
+#include <string>
+#include <version> // __cpp_lib_ranges_as_const is not defined in span.
+
+#include "test_macros.h"
+
+template <class T>
+TEST_CONSTEXPR void test_type() {
+#
+
+  using C = std::span<T>;
+  typename C::iterator ii1{}, ii2{};
+  typename C::iterator ii4 = ii1;
+  // TODO Test against C++23 after implementing
+  // P2278R4 cbegin should always return a constant iterator
----------------
ldionne wrote:

```suggestion
  // TODO Test against C++23 after implementing
  //   P2278R4 cbegin should always return a constant iterator
  // and then remove the #ifdefs
```

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


More information about the libcxx-commits mailing list