[libcxx-commits] [libcxx] [libc++] Avoid calling `setlocale` in `do_unshift` when unnecessary (PR #117153)
S. B. Tam via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Nov 24 02:59:24 PST 2024
cpplearner wrote:
I wonder if we should remove the `unshift` call in `sync()`.
https://github.com/llvm/llvm-project/blob/c4d656a4e992648f3490536336c230041c74dc38/libcxx/include/fstream#L965-L983
The standard doesn't require such a call. [[filebuf.virtuals]/19](https://eel.is/c++draft/filebuf.virtuals#lib:sync,basic_filebuf):
> `int sync() override;`
>
> Effects: If a put area exists, calls `filebuf​::​overflow` to write the characters to the file, then flushes the file as if by calling `fflush(file)`. If a get area exists, the effect is implementation-defined.
https://github.com/llvm/llvm-project/pull/117153
More information about the libcxx-commits
mailing list