std::ranges...ew::iterator(3)
β¨ NAME β¨
Hey bestie π this is the C++ Standard Libary page for std::ranges...ew::iterator(3) β aka std::ranges::basic_istream_view::iterator, the exposition-only iterator that is literally the return type of basic_istream_view::begin. Itβs giving βtiny but important,β no cap π
β¨ Synopsis β¨
struct /*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. Periodt π
π§Έ Member types π§Έ
iterator_concept(C++20) βstd::input_iterator_tagdifference_type(C++20) βstd::ptrdiff_tvalue_type(C++20) βVal
π Member functions π
- constructor
(C++20)β constructs an iterator (public member function) operator=(C++20)β the copy assignment operator is deleted;/*iterator*/is move-only (public member function)operator++(C++20)β advances the iterator (public member function)operator*(C++20)β returns the current element (public member function)
β¨ std::ranges::basic_istream_view::iterator::iterator β¨
constexpr explicit /*iterator*/( basic_istream_view& parent ); (1) (since C++20)
/*iterator*/( const /*iterator*/& ) = delete; (2) (since C++20)
/*iterator*/( /*iterator*/&& ) = default; (3) (since C++20)
- Constructs an iterator from the parent
basic_istream_view. - The copy constructor is deleted. The iterator is not copyable.
- The move constructor is defaulted. The iterator is movable.
π
std::ranges::basic_istream_view::iterator::operator= π
/*iterator*/& operator=( const /*iterator*/& ) = delete; (1) (since C++20)
/*iterator*/& operator=( /*iterator*/&& ) = default; (2) (since C++20)
- The copy assignment operator is deleted. The iterator is not copyable.
- The move assignment operator is defaulted. The iterator is movable.
π₯ std::ranges::basic_istream_view::iterator::operator++ π₯
/*iterator*/& operator++(); (1) (since C++20)
void operator++(int); (2) (since C++20)
Reads a value from the underlying stream and stores it into the parent basic_istream_view.
Return value
*this- (none)
π std::ranges::basic_istream_view::iterator::operator* π
Val& operator*() const; (since C++20)
Returns a reference to the stored value.
π«Ά Non-member functions π«Ά
operator==(C++20)β compares with astd::default_sentinel_t(public member function)
π operator==(std::ranges::basic_istream_view::iterator, std::default_sentinel) π
friend bool operator==( const /*iterator*/& x,
std::default_sentinel_t );
(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. Iykyk π
π§ Defect reports π§
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
P2325R3β applied to C++20; behavior as published:default constructor was provided as iterators must be default_initializable; correct behavior:removed along with the requirement.
Source/version/date drop, bestie: http://cppreference.com Β· 2024.06.10 Β· page std::ranges...ew::iterator(3) πβ¨ Byeee, go stream responsibly π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms