std::istrea...buf_iterator(3)

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

✨ NAME ✨

std::istreambuf_iterator::istreambuf_iterator β€” std::istreambuf_iterator::istreambuf_iterator

Okay bestie, this is the constructor page for std::istreambuf_iterator, from the C++ Standard Libary manual (section 3), and the page title is std::istrea...buf_iterator(3) β€” yes, it's abbreviated exactly like that. 🫢


🌸 Synopsis 🌸

Here's the whole constructor roster, with all the version tags kept intact:

istreambuf_iterator() throw();                       (until C++11)
constexpr istreambuf_iterator() noexcept;            (since C++11) (1)

constexpr istreambuf_iterator( std::default_sentinel_t ) noexcept; (2) (since C++20)

istreambuf_iterator( std::basic_istream<CharT,Traits>& is ) throw(); (until C++11)
istreambuf_iterator( std::basic_istream<CharT,Traits>& is ) noexcept; (since C++11) (3)

istreambuf_iterator( std::basic_streambuf<CharT,Traits>* s ) throw(); (until C++11) (4)
istreambuf_iterator( std::basic_streambuf<CharT,Traits>* s ) noexcept; (since C++11) (4)

istreambuf_iterator( const /* proxy */& p ) throw(); (until C++11)
istreambuf_iterator( const /* proxy */& p ) noexcept; (since C++11) (5)

istreambuf_iterator( const istreambuf_iterator& ) noexcept = default; (6) (since C++11)

So the constructor tea is:

  • 1,2) these construct an end-of-stream iterator. 🫢
  • 3) initializes the iterator and stores the value of is.rdbuf() in a data member. If is.rdbuf() is null, then end-of-stream iterator is constructed.
  • 4) initializes the iterator and stores the value of s in a data member. If s is null, then end-of-stream iterator is constructed.
  • 5) effectively calls (3) with the streambuf_type* pointer that p holds.
  • 6) the copy constructor is trivial and explicitly defaulted.
until C++11: the copy constructor is effectively implicitly declared and not guaranteed to be trivial. 😭

πŸŽ€ Parameters πŸŽ€

  • is β€” the stream to obtain the stream buffer from. 🌈
  • s β€” the stream buffer to initialize the iterator with. πŸ¦‹
  • p β€” an object of the implementation-defined proxy type. πŸ’…

Source/version vibes: http://cppreference.com, dated 2024.06.10, for the std::istrea...buf_iterator(3) page. Byeee bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from