diff --git a/include/fmt/compile.h b/include/fmt/compile.h index c33427ab..29226350 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -42,8 +42,7 @@ struct is_compiled_string : std::is_base_of {}; #endif #if FMT_USE_NONTYPE_TEMPLATE_ARGS -template Str> +template Str> struct udl_compiled_string : compiled_string { using char_type = Char; explicit constexpr operator basic_string_view() const { @@ -538,7 +537,7 @@ void print(const S& fmt, const Args&... args) { #if FMT_USE_NONTYPE_TEMPLATE_ARGS inline namespace literals { -template constexpr auto operator""_cf() { +template constexpr auto operator""_cf() { using char_t = remove_cvref_t; return detail::udl_compiled_string(); diff --git a/include/fmt/format.h b/include/fmt/format.h index c4c61c1a..622c2750 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1003,7 +1003,7 @@ class FMT_SO_VISIBILITY("default") format_error : public std::runtime_error { using std::runtime_error::runtime_error; }; -namespace detail_exported { +namespace detail { template struct fixed_string { FMT_CONSTEXPR20 fixed_string(const Char (&s)[N]) { detail::copy(static_cast(s), s + N, @@ -1025,7 +1025,7 @@ constexpr auto compile_string_to_view(basic_string_view s) -> basic_string_view { return s; } -} // namespace detail_exported +} // namespace detail // A generic formatting context with custom output iterator and character // (code unit) support. Char is the format string code unit type which can be @@ -3696,7 +3696,7 @@ FMT_CONSTEXPR void handle_dynamic_spec( #if FMT_USE_NONTYPE_TEMPLATE_ARGS template Str> + fmt::detail::fixed_string Str> struct static_named_arg : view { static constexpr auto name = Str.data; @@ -3705,16 +3705,15 @@ struct static_named_arg : view { }; template Str> + fmt::detail::fixed_string Str> struct is_named_arg> : std::true_type {}; template Str> + fmt::detail::fixed_string Str> struct is_static_named_arg> : std::true_type { }; -template Str> +template Str> struct udl_arg { template auto operator=(T&& value) const { return static_named_arg(std::forward(value)); @@ -4043,7 +4042,7 @@ template struct nested_formatter { inline namespace literals { #if FMT_USE_NONTYPE_TEMPLATE_ARGS -template constexpr auto operator""_a() { +template constexpr auto operator""_a() { using char_t = remove_cvref_t; return detail::udl_arg(); } @@ -4128,7 +4127,7 @@ class format_int { using char_type = fmt::remove_cvref_t; \ FMT_CONSTEXPR explicit operator fmt::basic_string_view() \ const { \ - return fmt::detail_exported::compile_string_to_view(s); \ + return fmt::detail::compile_string_to_view(s); \ } \ }; \ using FMT_STRING_VIEW = \