[libcxx-commits] [PATCH] D118687: [libc++][ranges][NFC] Test new requirements for `basic_string_view` and `span` iterators.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 1 13:01:29 PST 2022


var-const updated this revision to Diff 405072.
var-const added a comment.

- address feedback;
- add links to the patch to the status page.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118687/new/

https://reviews.llvm.org/D118687

Files:
  libcxx/docs/Status/RangesPaper.csv
  libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
  libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp


Index: libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
===================================================================
--- libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
+++ libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -15,12 +15,15 @@
 
 #include <iterator>
 
+#include "test_macros.h"
+
 using iterator = std::string_view::iterator;
 using const_iterator = std::string_view::const_iterator;
 using reverse_iterator = std::string_view::reverse_iterator;
 using const_reverse_iterator = std::string_view::const_reverse_iterator;
 
 static_assert(std::contiguous_iterator<iterator>);
+LIBCPP_STATIC_ASSERT(std::__is_cpp17_random_access_iterator<iterator>::value);
 static_assert(!std::indirectly_writable<iterator, char>);
 static_assert(std::sentinel_for<iterator, iterator>);
 static_assert(std::sentinel_for<iterator, const_iterator>);
@@ -35,6 +38,7 @@
 static_assert(!std::indirectly_swappable<iterator, iterator>);
 
 static_assert(std::contiguous_iterator<const_iterator>);
+LIBCPP_STATIC_ASSERT(std::__is_cpp17_random_access_iterator<const_iterator>::value);
 static_assert(!std::indirectly_writable<const_iterator, char>);
 static_assert(std::sentinel_for<const_iterator, iterator>);
 static_assert(std::sentinel_for<const_iterator, const_iterator>);
Index: libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
===================================================================
--- libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
+++ libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -14,12 +14,14 @@
 #include <span>
 
 #include <iterator>
+#include "test_macros.h"
 
 using iterator = std::span<int>::iterator;
 using reverse_iterator = std::span<int>::reverse_iterator;
 using value_type = int;
 
 static_assert(std::contiguous_iterator<iterator>);
+LIBCPP_STATIC_ASSERT(std::__is_cpp17_random_access_iterator<iterator>::value);
 static_assert(std::indirectly_writable<iterator, value_type>);
 static_assert(std::sentinel_for<iterator, iterator>);
 static_assert(!std::sentinel_for<iterator, reverse_iterator>);
Index: libcxx/docs/Status/RangesPaper.csv
===================================================================
--- libcxx/docs/Status/RangesPaper.csv
+++ libcxx/docs/Status/RangesPaper.csv
@@ -32,8 +32,8 @@
 | `ranges::destroy <https://llvm.org/D116078>`_
 | `ranges::destroy_at <https://llvm.org/D116078>`_
 | `ranges::destroy_n <https://llvm.org/D116078>`_",[special.mem.concepts],Konstantin Varlamov,✅
-`[strings] <https://wg21.link/strings>`_,Adds begin/end and updates const_iterator.,[iterator.concepts],Unassigned,Not started
-`[views.span] <https://wg21.link/views.span>`_,Same as [strings],[iterator.concepts],Unassigned,Not started
+`[strings] <https://wg21.link/strings>`_,`Adds begin/end and updates const_iterator. <https://llvm.org/D118687>`_,[iterator.concepts],Konstantin Varlamov,✅
+`[views.span] <https://wg21.link/views.span>`_,`Same as [strings] <https://llvm.org/D118687>`_,[iterator.concepts],Konstantin Varlamov,✅
 `[iterator.cust.move] <https://wg21.link/iterator.cust.move>`_,`ranges::iter_move <https://llvm.org/D99873>`_,,Zoe Carver,✅
 `[iterator.cust.swap] <https://wg21.link/iterator.cust.swap>`_,`ranges::iter_swap <https://llvm.org/D102809>`_,iter_value_t,Zoe Carver,✅
 `[iterator.concepts] <https://wg21.link/iterator.concepts>`_,"| `indirectly_readable <https://llvm.org/D100073>`_


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118687.405072.patch
Type: text/x-patch
Size: 3661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220201/760168c2/attachment.bin>


More information about the libcxx-commits mailing list