From 39e15aff74a9502a4981126edf6dc558cf5010a4 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 2 Feb 2026 10:44:37 -0800 Subject: [PATCH] Fix template argument ordering --- include/fmt/args.h | 4 ++-- include/fmt/base.h | 8 ++++---- include/fmt/format.h | 2 +- include/fmt/ranges.h | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/fmt/args.h b/include/fmt/args.h index 6b8c0a62..f3f454b8 100644 --- a/include/fmt/args.h +++ b/include/fmt/args.h @@ -114,7 +114,7 @@ FMT_EXPORT template class dynamic_format_arg_store { } template - void emplace_arg(const detail::named_arg& arg) { + void emplace_arg(const detail::named_arg& arg) { if (named_info_.empty()) data_.insert(data_.begin(), basic_format_arg(nullptr, 0)); data_.emplace_back(detail::unwrap(arg.value)); @@ -184,7 +184,7 @@ FMT_EXPORT template class dynamic_format_arg_store { * copying of the argument. The name is always copied into the store. */ template - void push_back(const detail::named_arg& arg) { + void push_back(const detail::named_arg& arg) { const char_type* arg_name = dynamic_args_.push>(arg.name).c_str(); if FMT_CONSTEXPR20 (need_copy::value) { diff --git a/include/fmt/base.h b/include/fmt/base.h index 67ec373e..6369e4d5 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1031,14 +1031,14 @@ struct is_view : std::false_type {}; template struct is_view> : std::is_base_of {}; -template struct named_arg; +template struct named_arg; template struct is_named_arg : std::false_type {}; template struct is_static_named_arg : std::false_type {}; template -struct is_named_arg> : std::true_type {}; +struct is_named_arg> : std::true_type {}; -template struct named_arg : view { +template struct named_arg : view { const Char* name; const T& value; @@ -2719,7 +2719,7 @@ using vargs = * sufficiently new compilers. See `operator""_a()`. */ template -inline auto arg(const Char* name, const T& arg) -> detail::named_arg { +inline auto arg(const Char* name, const T& arg) -> detail::named_arg { return {name, arg}; } diff --git a/include/fmt/format.h b/include/fmt/format.h index d34314d8..0635f3d3 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3861,7 +3861,7 @@ struct udl_arg { template struct udl_arg { const Char* str; - template auto operator=(T&& value) const -> named_arg { + template auto operator=(T&& value) const -> named_arg { return {str, std::forward(value)}; } }; diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 0f7cd7cc..ff682a8f 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -760,8 +760,7 @@ template struct all { * formatted as the underlying container. */ FMT_EXPORT -template -struct is_container_adaptor { +template struct is_container_adaptor { private: template static auto check(U* p) -> typename U::container_type; template static void check(...);