mirror of
https://github.com/fmtlib/fmt.git
synced 2026-02-07 10:19:56 +08:00
Cleanup named args
This commit is contained in:
parent
39e15aff74
commit
48967e1b6f
@ -319,7 +319,7 @@ parameterized version.
|
|||||||
|
|
||||||
### Named Arguments
|
### Named Arguments
|
||||||
|
|
||||||
::: arg(const Char*, const T&)
|
::: arg(const char*, const T&)
|
||||||
|
|
||||||
### Compatibility
|
### Compatibility
|
||||||
|
|
||||||
|
|||||||
@ -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_named_arg : std::false_type {};
|
||||||
template <typename T> struct is_static_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 {};
|
struct is_named_arg<named_arg<T, Char>> : std::true_type {};
|
||||||
|
|
||||||
template <typename T, typename Char = char> struct named_arg : view {
|
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
|
* in compile-time checks, but `"answer"_a=42` are compile-time checked in
|
||||||
* sufficiently new compilers. See `operator""_a()`.
|
* sufficiently new compilers. See `operator""_a()`.
|
||||||
*/
|
*/
|
||||||
template <typename Char, typename T>
|
template <typename T>
|
||||||
inline auto arg(const Char* name, const T& arg) -> detail::named_arg<T, Char> {
|
inline auto arg(const char* name, const T& arg) -> detail::named_arg<T> {
|
||||||
return {name, arg};
|
return {name, arg};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -136,6 +136,11 @@ inline auto operator""_a(const wchar_t* s, size_t) -> detail::udl_arg<wchar_t> {
|
|||||||
} // namespace literals
|
} // namespace literals
|
||||||
#endif
|
#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>
|
template <typename It, typename Sentinel>
|
||||||
auto join(It begin, Sentinel end, wstring_view sep)
|
auto join(It begin, Sentinel end, wstring_view sep)
|
||||||
-> join_view<It, Sentinel, wchar_t> {
|
-> join_view<It, Sentinel, wchar_t> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user