mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-01 14:10:06 +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 (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);
|
||||
} else {
|
||||
(void)name; // Workaround an MSVC bug about "unused" parameter.
|
||||
return invalid_arg_index;
|
||||
}
|
||||
(void)name; // Workaround an MSVC bug about "unused" parameter.
|
||||
return invalid_arg_index;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user