std::basic_...f::showmanyc(3)

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

✨ std::basic_...f::showmanyc(3) ✨

okay so this page comes from the C++ Standard Libary manual (yes, that's the manual name as written πŸ’–), and it's all about std::basic_streambuf::showmanyc. No cap, it's a virtual protected function, and it's lowkey iconic for anyone doing stream buffer stuff.

🌸 NAME 🌸

std::basic_streambuf::showmanyc β€” std::basic_streambuf::showmanyc

πŸŒ€ Synopsis πŸŒ€

          protected:
          virtual std::streamsize showmanyc();

So bestie, this estimates the number of characters available for input in the associated character sequence. underflow() is guaranteed not to return Traits::eof() or throw an exception until at least that many characters are extracted. Periodt.

πŸŽ€ Parameters πŸŽ€

  • (none) β€” literally no parameters, bestie.

πŸ’– Return value πŸ’–

  • The number of characters that are certainly available in the associated character sequence.
  • Or -1 if showmanyc can determine, without blocking, that no characters are available.
  • If showmanyc returns -1, underflow() and uflow() will definitely return Traits::eof or throw.

The base class version returns 0, which has the meaning of "unsure if there are characters available in the associated sequence".

🧠 Notes 🧠

The name of this function stands for "stream: how many characters?", so it is pronounced "S how many C", rather than "show many C". iykyk 🫢

πŸ“ Example πŸ“

This section is incomplete.

Reason: no example.

πŸ› οΈ Defect reports πŸ› οΈ

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR LWG 159 β€” applied to C++98.
    • Behavior as published: underflow() is guaranteed not to fail until at least showmanyc() characters are supplied.
    • Correct behavior: extended the guarantee to allow at least showmanyc() characters to be extracted.

πŸ‘€ See also πŸ‘€

  • in_avail β€” obtains the number of characters immediately available in the get area (public member function).
  • showmanyc β€” optionally provides the number of characters available for input from the file [virtual] (virtual protected member function of std::basic_filebuf<CharT,Traits>).

πŸ“Œ Category πŸ“Œ

  • Todo no example

that's the whole page, bestie ✨ source: http://cppreference.com, version/date: 2024.06.10, page: std::basic_...f::showmanyc(3). slay πŸ’…

πŸ“¦ where this page comes from