std::basic_filebuf<CharT,Traits>::close
Min standard notice:
If a put area exist (e.g. file was opened for writing), first calls overflow(Traits::eof()) to write all pending output to the file, including any unshift sequences.
# Declarations
std::basic_filebuf<CharT, Traits>* close();
# Return value
this on success, a null pointer on failure.
# Notes
close() is typically called through the destructor of std::basic_filebuf (which, in turn, is typically called by the destructor of std::basic_fstream.
# Example
This section is incompleteReason: no example
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 443 | C++98 | the file was written using overflow(EOF) | changed to overflow(Traits::eof()) |
| LWG 622 | C++98 | it was unclear how to handle theexception thrown during closing | it is rethrown after closing the file |