From 8ec0b9e33b3d0c6b6fbb5664053226dd17d17913 Mon Sep 17 00:00:00 2001 From: Daniela Engert Date: Sun, 23 May 2021 09:35:28 +0200 Subject: [PATCH] Do *not* export namespace `detail` --- include/fmt/format.h | 17 ++++++++--------- include/fmt/printf.h | 9 +++------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 5a2ff985..6df5d849 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2629,13 +2629,14 @@ std::basic_string to_string(const basic_memory_buffer& buf) { detail::assume(size < std::basic_string().max_size()); return std::basic_string(buf.data(), size); } -FMT_MODULE_EXPORT_END + +FMT_BEGIN_DETAIL_NAMESPACE template -void detail::vformat_to( - detail::buffer& buf, basic_string_view fmt, +void vformat_to( + buffer& buf, basic_string_view fmt, basic_format_args>> args, - detail::locale_ref loc) { + locale_ref loc) { auto out = buffer_appender(buf); if (fmt.size() == 2 && equal2(fmt.data(), "{}")) { auto arg = args.get(0); @@ -2644,13 +2645,13 @@ void detail::vformat_to( return; } - struct format_handler : detail::error_handler { + struct format_handler : error_handler { basic_format_parse_context parse_context; buffer_context context; format_handler(buffer_appender out, basic_string_view str, basic_format_args> args, - detail::locale_ref loc) + locale_ref loc) : parse_context(str), context(out, args, loc) {} void on_text(const Char* begin, const Char* end) { @@ -2698,7 +2699,6 @@ void detail::vformat_to( } #ifndef FMT_HEADER_ONLY -namespace detail { extern template void vformat_to(detail::buffer&, string_view, basic_format_args, @@ -2723,10 +2723,9 @@ extern template int snprintf_float(long double value, int precision, float_specs specs, buffer& buf); -} // namespace detail #endif // FMT_HEADER_ONLY -FMT_MODULE_EXPORT_BEGIN +FMT_END_DETAIL_NAMESPACE inline namespace literals { /** \rst diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 3ae8249c..aab79d03 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -23,9 +23,7 @@ class basic_printf_parse_context : public basic_format_parse_context { }; template class basic_printf_context; -FMT_MODULE_EXPORT_END - -namespace detail { +FMT_BEGIN_DETAIL_NAMESPACE // Checks if a value fits in int - used to avoid warnings about comparing // signed and unsigned integers. @@ -269,7 +267,8 @@ void vprintf(buffer& buf, basic_string_view format, basic_format_args args) { Context(buffer_appender(buf), format, args).format(); } -} // namespace detail + +FMT_END_DETAIL_NAMESPACE // For printing into memory_buffer. template @@ -565,8 +564,6 @@ OutputIt basic_printf_context::format() { out, basic_string_view(start, detail::to_unsigned(it - start))); } -FMT_MODULE_EXPORT_BEGIN - template using basic_printf_context_t = basic_printf_context, Char>;