24 struct ClearErrnoGuard {
25 ClearErrnoGuard() :
old_value(errno) { errno = 0; }
34 size_t to_write = std::min(v.
size(),
size_);
35 std::memcpy(buffer_, v.
data(), to_write);
38 total_written_ += v.
size();
42 while (!v.
empty() && !error_) {
45 ClearErrnoGuard guard;
47 if (
size_t result = std::fwrite(v.
data(), 1, v.
size(), output_)) {
56 }
else if (std::ferror(output_)) {
void remove_prefix(size_type n)
constexpr size_type size() const noexcept
constexpr bool empty() const noexcept
constexpr const_pointer data() const noexcept