Skip to content

Commit a1b9e60

Browse files
Revert static_assert
1 parent 4177189 commit a1b9e60

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

libcxx/include/__iterator/bounded_iter.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
5252
// pointer, it is undefined at the language level (see [expr.add]). If
5353
// bounded iterators exhibited this undefined behavior, we risk compiler
5454
// optimizations deleting non-redundant bounds checks.
55-
template <class _Iterator>
55+
template <class _Iterator, class = __enable_if_t< __libcpp_is_contiguous_iterator<_Iterator>::value > >
5656
struct __bounded_iter {
57-
static_assert(__libcpp_is_contiguous_iterator<_Iterator>::value,
58-
"Only contiguous iterators can be adapted by __bounded_iter.");
59-
6057
using value_type = typename iterator_traits<_Iterator>::value_type;
6158
using difference_type = typename iterator_traits<_Iterator>::difference_type;
6259
using pointer = typename iterator_traits<_Iterator>::pointer;
@@ -261,7 +258,7 @@ struct __bounded_iter {
261258
private:
262259
template <class>
263260
friend struct pointer_traits;
264-
template <class>
261+
template <class, class>
265262
friend struct __bounded_iter;
266263
_Iterator __current_; // current iterator
267264
_Iterator __begin_, __end_; // valid range represented as [begin, end]

libcxx/test/libcxx/iterators/contiguous_iterators.verify.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)