mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-29 12:32:38 +00:00
Simplify get_arg_index_by_name
This commit is contained in:
parent
a151f955a0
commit
08f98c7fac
@ -2701,12 +2701,10 @@ constexpr auto get_arg_index_by_name(basic_string_view<Char> name) -> int {
|
|||||||
if constexpr (detail::is_statically_named_arg<T>()) {
|
if constexpr (detail::is_statically_named_arg<T>()) {
|
||||||
if (name == T::name) return N;
|
if (name == T::name) return N;
|
||||||
}
|
}
|
||||||
if constexpr (sizeof...(Args) > 0) {
|
if constexpr (sizeof...(Args) > 0)
|
||||||
return get_arg_index_by_name<N + 1, Args...>(name);
|
return get_arg_index_by_name<N + 1, Args...>(name);
|
||||||
} else {
|
(void)name; // Workaround an MSVC bug about "unused" parameter.
|
||||||
(void)name; // Workaround an MSVC bug about "unused" parameter.
|
return invalid_arg_index;
|
||||||
return invalid_arg_index;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user