std::basic_...sic_filebuf(3)
π NAME π
std::basic_filebuf::~basic_filebuf β bestie, this is literally the destructor for std::basic_filebuf, and yes the page header is doing that cursed std::basic_...sic_filebuf(3) abbreviation thing again (iykyk, it's the C++ Standard Libary man page, we don't talk about the typo π).
β¨ Synopsis β¨
virtual ~basic_filebuf();
Okay so real talk: it calls close() to close the associated file, and then destructs all the other members of basic_filebuf. That's the whole vibe check.
And the important part π: if an exception happens during the destruction of the object β including inside that call to close() β it gets caught and not rethrown. No drama, no surprise throws escaping a destructor, we simply do not allow that energy here π
.
π Parameters π
(none) β not a single one, she takes no arguments, main character energy fr fr π¦
πΈ Return value πΈ
(none) β destructors don't return things, that's just how it is, periodt β¨
π§ Notes π§
Typically called by the destructor of std::basic_fstream. So like, you're probably never calling this yourself β your fstream is out here doing it for you behind the scenes π«Ά.
π Example π
This section is incomplete.
Reason: no example π
(yes bestie, the page literally says that, I'm not gatekeeping an example from you, there just isn't one π)
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards. Retroactive glow-ups, we love to see it π
- LWG 622 β applied to C++98 β the behavior as published was that it was unclear how to handle the exception thrown during destruction; the correct behavior is that it is caught but not rethrown π
β See also β
- constructor β constructs a
basic_filebufobject (public member function) - close β flushes the put area buffer and closes the associated file (public member function)
π Category:
- Todo no example
Category: Todo no example β she's a work in progress icon, we stan anyway π
Source/version and date, as promised: this gem came from http://cppreference.com, dated 2024.06.10 π Go drink some water and close your file streams, 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