std::istrstream::rdbuf(3)
π NAME π
std::istrstream::rdbuf β literally std::istrstream::rdbuf, bestie. This page is from the C++ Standard Libary manual, and it's giving βniche member function loreβ in the best way. π
β¨ Synopsis β¨
strstreambuf* rdbuf() const; (deprecated in C++98)
(removed in C++26)
Okay so this one returns a pointer to the associated std::strstreambuf, and it is casting away its constness β yes, even though the member function itself has that const qualifier. The audacity, honestly. π
Heads up: this is marked deprecated in C++98 and removed in C++26. So she's iconic, but she's also on her way out. π«Ά
π¦ Parameters π¦
- (none) β no arguments, no extra homework, we love that for us. β¨
πΈ Return value πΈ
A pointer to the associated std::strstreambuf, with constness cast away. That's the whole vibe check: pointer, associated std::strstreambuf, constness gone. π
π Example π
// Run this code
#include <strstream>
int main()
{
const std::istrstream buf("example");
std::strstreambuf* ptr = buf.rdbuf();
}
This is the example, kept exactly as it is β const std::istrstream buf("example");, then std::strstreambuf* ptr = buf.rdbuf();. No cap, that's the whole little main character moment. π
xoxo, from cppreference.com, version/date 2024.06.10, and the page is std::istrstream::rdbuf(3) β slay and goodbye bestie ππ¦
π¦ 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