Details
- Reviewers
• Quuxplusone ldionne - Group Reviewers
Restricted Project - Commits
- rG298331f14d02: [libc++][ranges][NFC] Test new requirements for `basic_string_view` and `span`…
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp | ||
---|---|---|
24 | I don't understand why there is anything to test at all. It seems to me that those sections of the "one ranges proposal" simply don't exist anymore, so there's nothing to do, no? |
LGTM % LIBCPP_STATIC_ASSERT.
libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp | ||
---|---|---|
24 | Ditto, although this extra coverage doesn't seem harmful. LIBCPP_STATIC_ASSERT(std::__is_cpp17_random_access_iterator<iterator>::value); though (and likewise throughout), both for clarity and because we're trying to cut down on the use of raw #if _LIBCPP_whatever macros in tests. |
libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp | ||
---|---|---|
24 | (Taking basic_string_view::const_iterator as an example) The text before the <ranges> proposal said that the iterator meets the requirements of a constant random access iterator and [meets the requirements of] a contiguous iterator. After the proposal, this became meets the requirements of Cpp17RandomAccessIterator and models contiguous_iterator (this is still in the latest draft). While it's basically saying the same thing, it formalizes it by using a named requirement. We were already testing that the iterator types model contiguous_iterator, but not the Cpp17RandomAccessIterator part. If you don't feel this adds value, or if this is already tested elsewhere, I'm very open to dropping the new tests from this patch (so that it becomes just a status update). |
libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp | ||
---|---|---|
24 | Thanks for clarifying. I think it does add some value then. Note that __is_cpp17_random_access_iterator doesn't check whether the concept is satisfied, though, it only checks the iterator_category if I'm not mistaken. But still better than nothing. |
I don't understand why there is anything to test at all. It seems to me that those sections of the "one ranges proposal" simply don't exist anymore, so there's nothing to do, no?