std::istrea...rator++(int)(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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 🎁

  1. *this
  2. An istream_iterator that 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) was istream_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: uses fail() 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