std::istrea...rator++(int)(3)
π std::istrea...rator++(int)(3) π
okay so welcome to the std::istrea...rator++(int)(3) page, bestie β and yes, it's from the C++ Standard Libary manual (that spelling is literally in the source, we are keeping it, no cap). This is the group chat where std::istream_iterator gets its increment glow-up. π
πΈ NAME πΈ
std::istream_iterator::operator++,operator++(int) β std::istream_iterator::operator++,operator++(int). That's the whole name, both operator++ flavors, iconic and mouthful.
β¨ Synopsis β¨
istream_iterator& operator++(); (1)
istream_iterator operator++( int ); (2)
Reads a value from the underlying stream (using its operator>>) and stores it into the iterator object. If the read fails (the underlying stream's fail() returns true), the iterator becomes the end-of-stream iterator.
The behavior is undefined if the iterator is end-of-stream iterator. Like, do not increment an end-of-stream iterator, bestie β that's undefined behavior territory. π
π§Έ Parameters π§Έ
(none)
π Return value π
*this- An
istream_iteratorthat holds an unchanged value.
π Exceptions π
May throw implementation-defined exceptions.
π©Ή Defect reports π©Ή
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- LWG 260 β applied to C++98. Behavior as published: the return type of
operator++(int)wasistream_iterator&. Correct behavior:istream_iterator. - LWG 788 β applied to C++98. Behavior as published: the underlying stream's
operator void*was used to determine whether the read fails, but it was removed by the resolution of LWG issue 468. Correct behavior: usesfail()instead. - LWG 838 β applied to C++98. Behavior as published: it was unclear whether end-of-stream iterators can be incremented. Correct behavior: the behavior is undefined.
okay bye bestie π«Ά β this page came from http://cppreference.com, dated 2024.06.10, and it lives under std::istrea...rator++(int)(3). mwah πβ¨
π¦ 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