Skip to content

Commit

Permalink
format std::reference_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
yfeldblum committed Sep 16, 2024
1 parent 2a2f73f commit 70a98ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -3936,6 +3936,11 @@ struct formatter<T, Char,
enable_if_t<(detail::bitint_traits<T>::is_formattable)>>
: formatter<typename detail::bitint_traits<T>::format_type, Char> {};

template <typename T>
constexpr auto format_as(std::reference_wrapper<T> ref) -> T& {
return ref.get();
}

/**
* Converts `p` to `const void*` for pointer formatting.
*
Expand Down

0 comments on commit 70a98ee

Please sign in to comment.