From 931cfcfbbe1634da0915231de986ebbe9d66469c Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Sun, 30 Jan 2022 01:08:57 -0600 Subject: [PATCH] Adding a put API to basic_format_context. --- include/fmt/core.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/fmt/core.h b/include/fmt/core.h index 2da3dc62..6cd41636 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1776,6 +1776,15 @@ template class basic_format_context { if (!detail::is_back_insert_iterator()) out_ = it; } + FMT_CONSTEXPR auto put(char_type c) -> iterator { + *out_++ = c; + return out; + } + FMT_CONSTEXPR auto put(basic_string_view sv) -> iterator { + detail::copy_str(sv.data(), sv.data() + sv.size(), out); + return out; + } + FMT_CONSTEXPR auto locale() -> detail::locale_ref { return loc_; } };