Skip to content

Commit d98841b

Browse files
Update libcxx/test/std/ranges/range.adaptors/range.enumerate/types.h
Co-authored-by: A. Jiang <[email protected]>
1 parent 6056552 commit d98841b

File tree

1 file changed

+3
-1
lines changed
  • libcxx/test/std/ranges/range.adaptors/range.enumerate

1 file changed

+3
-1
lines changed

libcxx/test/std/ranges/range.adaptors/range.enumerate/types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ struct RangeView : std::ranges::view_base {
2525
using Iterator = cpp20_input_iterator<int*>;
2626
using Sentinel = sentinel_wrapper<Iterator>;
2727

28-
constexpr explicit RangeView(int* b, int* e) : begin_(b), end_(e) {}
28+
template <std::contiguous_iterator It>
29+
requires std::same_as<std::iter_value_t<It>, int>
30+
constexpr explicit RangeView(It b, It e) : begin_(std::to_address(b)), end_(std::to_address(e)) {}
2931
constexpr RangeView(RangeView const& other) : begin_(other.begin_), end_(other.end_), wasCopyInitialized(true) {}
3032
constexpr RangeView(RangeView&& other) : begin_(other.begin_), end_(other.end_), wasMoveInitialized(true) {}
3133
RangeView& operator=(RangeView const&) = default;

0 commit comments

Comments
 (0)