Skip to content

Commit 2f94a34

Browse files
committed
some more comments
1 parent 5bbfd3e commit 2f94a34

File tree

5 files changed

+331
-261
lines changed

5 files changed

+331
-261
lines changed

libcxx/include/__flat_set/ra_iterator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <__iterator/iterator_traits.h>
1717
#include <__type_traits/is_constructible.h>
1818
#include <__utility/move.h>
19-
#include <iterator>
2019

2120
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2221
# pragma GCC system_header
@@ -42,7 +41,9 @@ struct __ra_iterator {
4241

4342
friend _Container;
4443

45-
static_assert(std::random_access_iterator<_Iterator>, "Underlying iterator must be a random access iterator");
44+
// note: checking the concept random_access_iterator does not work for incomplete types
45+
static_assert(__is_same(iterator_traits<_Iterator>::iterator_category, random_access_iterator_tag),
46+
"Underlying iterator must be a random access iterator");
4647

4748
public:
4849
using iterator_concept = random_access_iterator_tag; // deliberately lower contiguous_iterator

0 commit comments

Comments
 (0)