On this page
std::ranges::basic_istream_view::iterator
|
(since C++20) (exposition only*) |
The return type of basic_istream_view::begin
.
/*iterator*/
is an input_iterator
, but does not satisfy LegacyInputIterator, and thus does not work with pre-C++20 algorithms.
Member types
Member type | Definition |
---|---|
iterator_concept (C++20) |
std::input_iterator_tag |
difference_type (C++20) |
std::ptrdiff_t |
value_type (C++20) |
Val |
Member functions
(C++20)
|
constructs an iterator (public member function) |
(C++20)
|
the copy assignment operator is deleted; /*iterator*/ is move-only (public member function) |
(C++20)
|
advances the iterator (public member function) |
(C++20)
|
returns the current element (public member function) |
std::ranges::basic_istream_view::iterator::iterator
|
(1) | (since C++20) |
|
(2) | (since C++20) |
|
(3) | (since C++20) |
basic_istream_view
.
std::ranges::basic_istream_view::iterator::operator=
|
(1) | (since C++20) |
|
(2) | (since C++20) |
std::ranges::basic_istream_view::iterator::operator++
|
(1) | (since C++20) |
|
(2) | (since C++20) |
Reads a value from the underlying stream and stores it into the parent basic_istream_view
.
Return value
*this
std::ranges::basic_istream_view::iterator::operator*
|
(since C++20) |
Returns a reference to the stored value.
Non-member functions
operator==
(C++20)
|
compares with a std::default_sentinel_t (public member function) |
operator==(std::ranges::basic_istream_view::iterator, std::default_sentinel)
|
(since C++20) |
Compares an iterator with std::default_sentinel_t
.
Returns true if *this
does not have a parent basic_istream_view
, or if an error has occurred on the underlying stream.
This function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::ranges::basic_istream_view::iterator
is an associated class of the arguments.
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
P2325R3 | C++20 | default constructor was provided as C++20 iterators must be default_initializable |
removed along with the requirement |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/basic_istream_view/iterator