Cleanup named args

This commit is contained in:
Victor Zverovich 2026-02-02 11:01:09 -08:00
parent 39e15aff74
commit 48967e1b6f
3 changed files with 9 additions and 4 deletions

View File

@ -319,7 +319,7 @@ parameterized version.
### Named Arguments
::: arg(const Char*, const T&)
::: arg(const char*, const T&)
### Compatibility

View File

@ -1035,7 +1035,7 @@ template <typename T, typename Char> struct named_arg;
template <typename T> struct is_named_arg : std::false_type {};
template <typename T> struct is_static_named_arg : std::false_type {};
template <typename Char, typename T>
template <typename T, typename Char>
struct is_named_arg<named_arg<T, Char>> : std::true_type {};
template <typename T, typename Char = char> 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 <typename Char, typename T>
inline auto arg(const Char* name, const T& arg) -> detail::named_arg<T, Char> {
template <typename T>
inline auto arg(const char* name, const T& arg) -> detail::named_arg<T> {
return {name, arg};
}

View File

@ -136,6 +136,11 @@ inline auto operator""_a(const wchar_t* s, size_t) -> detail::udl_arg<wchar_t> {
} // namespace literals
#endif
template <typename T>
auto arg(const wchar_t* name, const T& arg) -> detail::named_arg<T, wchar_t> {
return {name, arg};
}
template <typename It, typename Sentinel>
auto join(It begin, Sentinel end, wstring_view sep)
-> join_view<It, Sentinel, wchar_t> {