================ @@ -276,6 +276,30 @@ private: state_type __st_; state_type __st_last_; ios_base::openmode __om_; + // Used to track the currently used mode and track whether the output should + // be unbuffered. + // [filebuf.virtuals]/12 + // If setbuf(0, 0) is called on a stream before any I/O has occurred on + // that stream, the stream becomes unbuffered. Otherwise the results are + // implementation-defined. + // This allows calling setbuf(0, 0) + // - before opening a file, + // - after opening a file, before + // - a read + // - a write + // - a seek. + // Note that opening a file with ios_base::ate does a seek operation. + // Normally underflow, overflow, and sync change this flag to + // ios_base::in, ios_base_out, or 0. + // + // The ios_base::trunc and ios_base::ate flags are used in the following way: + // - ios_base::trunc is set upon construction to indicate the unbuffered ---------------- ldionne wrote:
We should maybe introduce aptly-named values instead of reusing `trunc` and `ate`? https://github.com/llvm/llvm-project/pull/76629 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits