I dedicate this commit to Eric Niebler.

This commit is contained in:
Barry Revzin 2021-12-24 11:08:29 -06:00
parent a062a40db6
commit bc265ea1ef

View File

@ -601,12 +601,12 @@ struct formatter<
template <typename T,
FMT_ENABLE_IF(has_formatter<remove_cvref_t<T>, context>::value)>
static auto map(T&& value) -> T&& {
return (T &&) value;
return static_cast<T&&>(value);
}
template <typename T,
FMT_ENABLE_IF(!has_formatter<remove_cvref_t<T>, context>::value)>
static auto map(T&& value) -> decltype(mapper().map((T &&) value)) {
return mapper().map((T &&) value);
static auto map(T&& value) -> decltype(mapper().map(static_cast<T&&>(value))) {
return mapper().map(static_cast<T&&>(value));
}
using formatter_type = conditional_t<