| 320 | |
| 321 | template <typename CodeUnit> |
| 322 | void write_codecvt(codecvt_result<CodeUnit>& out, string_view in, |
| 323 | const std::locale& loc) { |
| 324 | FMT_PRAGMA_CLANG(diagnostic push) |
| 325 | FMT_PRAGMA_CLANG(diagnostic ignored "-Wdeprecated") |
| 326 | auto& f = std::use_facet<std::codecvt<CodeUnit, char, std::mbstate_t>>(loc); |
| 327 | FMT_PRAGMA_CLANG(diagnostic pop) |
| 328 | auto mb = std::mbstate_t(); |
| 329 | const char* from_next = nullptr; |
| 330 | auto result = f.in(mb, in.begin(), in.end(), from_next, std::begin(out.buf), |
| 331 | std::end(out.buf), out.end); |
| 332 | if (result != std::codecvt_base::ok) |
| 333 | FMT_THROW(format_error("failed to format time")); |
| 334 | } |
| 335 | |
| 336 | template <typename OutputIt> |
| 337 | auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc) |
no test coverage detected