diff --git a/doc/api.md b/doc/api.md index 57cdf82a..dc544e7b 100644 --- a/doc/api.md +++ b/doc/api.md @@ -319,7 +319,7 @@ parameterized version. ### Named Arguments -::: arg(const Char*, const T&) +::: arg(const char*, const T&) ### Compatibility diff --git a/include/fmt/base.h b/include/fmt/base.h index 6369e4d5..221f2a85 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1035,7 +1035,7 @@ template struct named_arg; template struct is_named_arg : std::false_type {}; template struct is_static_named_arg : std::false_type {}; -template +template struct is_named_arg> : std::true_type {}; template struct named_arg : view { @@ -2718,8 +2718,8 @@ using vargs = * in compile-time checks, but `"answer"_a=42` are compile-time checked in * sufficiently new compilers. See `operator""_a()`. */ -template -inline auto arg(const Char* name, const T& arg) -> detail::named_arg { +template +inline auto arg(const char* name, const T& arg) -> detail::named_arg { return {name, arg}; } diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h index f80e915d..9ba1b90b 100644 --- a/include/fmt/xchar.h +++ b/include/fmt/xchar.h @@ -136,6 +136,11 @@ inline auto operator""_a(const wchar_t* s, size_t) -> detail::udl_arg { } // namespace literals #endif +template +auto arg(const wchar_t* name, const T& arg) -> detail::named_arg { + return {name, arg}; +} + template auto join(It begin, Sentinel end, wstring_view sep) -> join_view {