mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-28 05:09:44 +01:00
Instruct msvc to report the _true_ value in __cplusplus and force _full_ C++ conformance
* do this in _some_ tests to improve test coverage and catch possible problems due to that * fix invalid export of `static constexpr` constant * fix msvc warnings about unreachable code in high warning levels
This commit is contained in:
committed by
Victor Zverovich
parent
31a5f0d399
commit
5221242f6e
@@ -2656,21 +2656,28 @@ 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);
|
||||
(void)name; // Workaround an MSVC bug about "unused" parameter.
|
||||
return invalid_arg_index;
|
||||
} else {
|
||||
(void)name; // Workaround an MSVC bug about "unused" parameter.
|
||||
return invalid_arg_index;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename... Args, typename Char>
|
||||
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view<Char> name) -> int {
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
if constexpr (sizeof...(Args) > 0)
|
||||
if constexpr (sizeof...(Args) > 0) {
|
||||
return get_arg_index_by_name<0, Args...>(name);
|
||||
#endif
|
||||
} else {
|
||||
(void)name;
|
||||
return invalid_arg_index;
|
||||
}
|
||||
#else
|
||||
(void)name;
|
||||
return invalid_arg_index;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename Char, typename ErrorHandler, typename... Args>
|
||||
|
||||
@@ -394,7 +394,7 @@ struct ostream_params {
|
||||
|
||||
FMT_END_DETAIL_NAMESPACE
|
||||
|
||||
static constexpr detail::buffer_size buffer_size;
|
||||
constexpr detail::buffer_size buffer_size;
|
||||
|
||||
/** A fast output stream which is not thread-safe. */
|
||||
class FMT_API ostream final : private detail::buffer<char> {
|
||||
|
||||
Reference in New Issue
Block a user