| 76 | // Write the content of buf to os. |
| 77 | template <typename Char> |
| 78 | void write(std::basic_ostream<Char>& os, buffer<Char>& buf) { |
| 79 | const Char* buf_data = buf.data(); |
| 80 | using unsigned_streamsize = std::make_unsigned<std::streamsize>::type; |
| 81 | unsigned_streamsize size = buf.size(); |
| 82 | unsigned_streamsize max_size = to_unsigned(max_value<std::streamsize>()); |
| 83 | do { |
| 84 | unsigned_streamsize n = size <= max_size ? size : max_size; |
| 85 | os.write(buf_data, static_cast<std::streamsize>(n)); |
| 86 | buf_data += n; |
| 87 | size -= n; |
| 88 | } while (size != 0); |
| 89 | } |
| 90 | |
| 91 | template <typename Char, typename T> |
| 92 | void format_value(buffer<Char>& buf, const T& value, |
no test coverage detected