Namespaces
Variants
Actions

std::basic_filebuf<CharT,Traits>::~basic_filebuf

From cppreference.com
< cpp‎ | io‎ | basic filebuf
 
C++
 
Input/output library
 
std::basic_filebuf
virtual ~basic_filebuf();

Calls close() to close the associated file and destructs all other members of basic_filebuf. If an exception occurs during the destruction of the object, including the call to close(), it is caught and not rethrown.

Contents

[edit] Notes

Typically called by the destructor of std::basic_fstream.

[edit] Example

[edit] Defect reports

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

DR Applied to Behavior as published Correct behavior
LWG 622 C++98 it was unclear how to handle the exception thrown during destruction it is caught but not rethrown

[edit] See also

constructs a basic_filebuf object
(public member function) [edit]
flushes the put area buffer and closes the associated file
(public member function) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant