cpp/io/basic filebuf/close

If a put area exist (e.g. file was opened for writing), first calls to write all pending output to the file, including any unshift sequences.

If the most recently called function, out of, , , and , was , then calls , perhaps multiple times, to determine the unshift sequence according to the imbued locale, and writes that sequence to file with.

Then, closes the file as if by calling std, regardless of whether any of the preceding calls succeeded or failed.

If any of the function calls made, including the call to std, fails, returns a null pointer. If any of the function calls made throws an exception, the exception is caught and rethrown after closing the file. If the file is already closed, returns a null pointer right away.

In any case, updates the private member variable that is accessed by is_open.

Parameters
(none)

Return value
on success, a null pointer on failure.