MCPcopy Create free account
hub / github.com/fmtlib/fmt / write_codecvt

Function write_codecvt

include/fmt/chrono.h:322–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321template <typename CodeUnit>
322void 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
336template <typename OutputIt>
337auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc)

Callers 2

write_encoded_tm_strFunction · 0.85
write_tm_strFunction · 0.85

Calls 4

beginFunction · 0.70
endFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected