Effects: If
is_open() == false,
returns a null pointer
. If a put area exists, calls
overflow(traits::eof())
to flush characters
. If the last virtual member function called on
*this
(between
underflow,
overflow,
seekoff,
and
seekpos)
was
overflow
then calls
a_codecvt.unshift
(possibly several times) to determine a termination sequence, inserts those
characters and calls
overflow(traits::eof())
again
. Finally, regardless of whether any of the preceding calls fails or throws an
exception, the function closes the file
(as if by calling
fclose(file))
. If any of the calls made by the function, including
fclose, fails,
close fails by returning a null pointer
. If one of these calls throws an
exception, the exception is caught and rethrown after closing the file
.