You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this definition, the format-string or wformat-string is an alias template, defined as the following
template<class... Args>
using format-string = basic-format-string<char, type_identity_t<Args>...>; // exposition onlytemplate<class... Args>
using wformat-string = basic-format-string<wchar_t, type_identity_t<Args>...>; // exposition only
where basic-format-string is a class template, It arguably says the first parameters of std::formart in this two cases are class template specialization. We also gives a simple use of std::format in the subsequent clauses, which is
The first argument has an array type, in template function call deduction, it is decayed to a pointer to participate the deduction, which means basic-format-string<char, type_identity_t<Args>...> will compare with pointer to const char, as per [temp.deduct.type#2], the deduction on this pair cannot be done. The deduction will fail.
The text was updated successfully, but these errors were encountered:
There is nothing to deduce in basic-format-string<char, type_identity_t<Args>...> (ditto for the wchar_t case): the Args are wrapped in type_identity_t specifically so they will be non-deducible. FTAD then only deduces Args from the other arguments - as intended - which is enough to fully specify the specialization of basic-format-string used for either format overload.
The definition for std::format is as the following
In this definition, the
format-string
orwformat-string
is an alias template, defined as the followingwhere
basic-format-string
is a class template, It arguably says the first parameters ofstd::formart
in this two cases are class template specialization. We also gives a simple use ofstd::format
in the subsequent clauses, which isThe first argument has an array type, in template function call deduction, it is decayed to a pointer to participate the deduction, which means
basic-format-string<char, type_identity_t<Args>...>
will compare withpointer to const char
, as per [temp.deduct.type#2], the deduction on this pair cannot be done. The deduction will fail.The text was updated successfully, but these errors were encountered: