Skip to content

Commit 7838480

Browse files
is_ref is false
1 parent 4f215b0 commit 7838480

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libcxx/test/std/ranges/range.adaptors/range.concat/iterator/member_types.compile.pass.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ constexpr bool test() {
156156
static_assert(std::is_same_v<ConstIter::value_type, double>);
157157
}
158158

159+
{
160+
// If is_reference_v<concat-reference-t<maybe-const<Const, Views>...>> is false,
161+
// then iterator_category denotes input_iterator_tag.
162+
auto v1 = std::views::iota(0, 3);
163+
auto v2 = std::views::iota(4, 6);
164+
auto cat = std::views::concat(v1, v2);
165+
166+
using Iter = decltype(cat.begin());
167+
using ConstIter = decltype(std::as_const(cat).begin());
168+
169+
static_assert(std::is_same_v<typename Iter::iterator_category, std::input_iterator_tag>);
170+
static_assert(std::is_same_v<typename ConstIter::iterator_category, std::input_iterator_tag>);
171+
}
172+
159173
return true;
160174
}
161175

0 commit comments

Comments
 (0)