std::basic_ios::set_rdbuf(3)

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

πŸŽ€ std::basic_ios::set_rdbuf πŸŽ€

okay so bestie, this page is from the C++ Standard Libary and it’s all about std::basic_ios::set_rdbuf. yes, that’s the same name twice in the NAME sectionβ€”iconic. πŸ’–

🌸 NAME

std::basic_ios::set_rdbuf β€” literally std::basic_ios::set_rdbuf, no cap. this is the protected stream-buffer setter page. 🫢

✨ Synopsis

it’s giving protected member function, and it’s been here since C++11:

protected:                                                 (since
C++11)
void set_rdbuf( std::basic_streambuf<CharT,Traits>* sb );

so what does it do? it sets the associated stream buffer to sb without clearing the error state. periodt. πŸ’…

and why is it protected? because it’s called by the move constructors of derived streams such as std::basic_ofstream or std::basic_istringstream, as the final step after constructing the base class and after moving the stream buffer: only the most derived stream class knows how to correctly move the stream buffer, but std::basic_ios needs to be made aware of the stream’s new location so that its public member functions can access it. iykyk. ✨

πŸŽ€ Parameters

  • sb β€” stream buffer to associate to.

πŸ’– Return value

(none) β€” literally no return value, bestie.

πŸ’… Exceptions

Throws nothing. clean. no drama. 🌸

🧚 Example

🚧 This section is incomplete Reason: no example

no example yet, so we’re just gonna sit here and look cute. πŸ“

πŸ‘€ See also

  • rdbuf β€” manages associated stream buffer (public member function).

πŸ“ Category

  • Todo no example

πŸ’Œ cute little sign-off: source/version is http://cppreference.com, date is 2024.06.10, and the page is std::basic_ios::set_rdbuf(3). bye bestie, stay cute and protected, fr fr. πŸ’–

πŸ“¦ where this page comes from