Skip to content

Commit 70a98ee

Browse files
committed
format std::reference_wrapper
1 parent 2a2f73f commit 70a98ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/fmt/format.h

+5
Original file line numberDiff line numberDiff line change
@@ -3936,6 +3936,11 @@ struct formatter<T, Char,
39363936
enable_if_t<(detail::bitint_traits<T>::is_formattable)>>
39373937
: formatter<typename detail::bitint_traits<T>::format_type, Char> {};
39383938

3939+
template <typename T>
3940+
constexpr auto format_as(std::reference_wrapper<T> ref) -> T& {
3941+
return ref.get();
3942+
}
3943+
39393944
/**
39403945
* Converts `p` to `const void*` for pointer formatting.
39413946
*

0 commit comments

Comments
 (0)