std::ranges::basic_istream_view::iterator
From cppreference.com
< cpp | ranges | basic istream view
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Ranges library
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++26)(C++26)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)
std::ranges::basic_istream_view
Iterator
struct /*iterator*/;
(exposition only*)
ranges::basic_istream_view <Val, CharT, Traits>::iterator
is the type of the iterators returned by begin()
of ranges::basic_istream_view <Val, CharT, Traits>.
iterator
is an input_iterator
, but does not satisfy LegacyInputIterator, and thus does not work with pre-C++20 algorithms.
Contents
- 1 Nested types
- 2 Data members
- 3 Member functions
- 4 std::ranges::basic_istream_view::iterator::iterator
- 5 std::ranges::basic_istream_view::iterator::operator=
- 6 std::ranges::basic_istream_view::iterator::operator++
- 7 std::ranges::basic_istream_view::iterator::operator*
- 8 operator==(std::ranges::basic_istream_view::iterator, std::default_sentinel)
[edit] Nested types
Type
Definition
iterator_concept
std::input_iterator_tag
difference_type
std::ptrdiff_t
value_type
Val
[edit] Data members
Member
Definition
ranges::basic_istream_view <Val, CharT, Traits>
(exposition-only member object*)
parent_
a pointer to the parent view(exposition-only member object*)
[edit] Member functions
std::ranges::basic_istream_view::iterator::iterator
/*iterator*/( const /*iterator*/& ) = delete;
(1)
(since C++20)
/*iterator*/( /*iterator*/&& ) = default;
(2)
(since C++20)
constexpr explicit /*iterator*/( basic_istream_view& parent );
(3)
(since C++20)
1) The copy constructor is deleted. The iterator is not copyable.
2) The move constructor is defaulted.
std::ranges::basic_istream_view::iterator::operator=
/*iterator*/& operator=( const /*iterator*/& ) = delete;
(1)
(since C++20)
/*iterator*/& operator=( /*iterator*/&& ) = default;
(2)
(since C++20)
1) The copy assignment operator is deleted. The iterator is not copyable.
2) The move assignment operator is defaulted.
std::ranges::basic_istream_view::iterator::operator++
/*iterator*/& operator++();
(1)
(since C++20)
void operator++(int);
(2)
(since C++20)
2) Equivalent to ++*this.
std::ranges::basic_istream_view::iterator::operator*
Val& operator*() const;
(since C++20)
[edit] Non-member functions
operator==(std::ranges::basic_istream_view::iterator, std::default_sentinel)
friend bool operator==( const /*iterator*/& x, std::default_sentinel_t );
(since C++20)
Returns !*parent_
->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.
[edit] 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 |