Here is the call trace from the documentation:
void std::basic_ofstream::close();
Effectively causes rdbuf()->close(). If an error occurs during operation, it is called setstate(failbit).
std::basic_streambuf<CharT,Traits>* std::basic_ofstream::rdbuf() const;
Returns the associated buffer stream. If there is no associated stream buffer, returns NULL.
std::basic_streambuf std::basic_filebuf, :
std::basic_filebuf<CharT, Traits>* std::basic_filebuf::close();
(, ), overflow(Traits::eof()), , unshift.
, underflow(), overflow(), seekpos() seekoff(), overflow(), std::codecvt::unshift(), , , unshift overflow(Traits::eof()).
, std::fclose, , - .
. close() std::basic_filebuf (, , std::basic_fstream.
, , flush() , . std::basic_filebuf::close(). , , - , .. unshift. , .
: std::basic_ofstream::close().