Terse printing of std::reference_wrapper hides pointer

This matches the intention and documentation of terse printing which generally avoids printing the pointer.

PiperOrigin-RevId: 481178950
Change-Id: I27039dac1870934d2d5b212e2cc7e97ab82c5b34
This commit is contained in:
Abseil Team
2022-10-14 10:32:14 -07:00
committed by Copybara-Service
parent 67174c7675
commit 137b6e2770
2 changed files with 30 additions and 0 deletions

View File

@@ -891,6 +891,13 @@ class UniversalTersePrinter<T&> {
UniversalPrint(value, os);
}
};
template <typename T>
class UniversalTersePrinter<std::reference_wrapper<T>> {
public:
static void Print(std::reference_wrapper<T> value, ::std::ostream* os) {
UniversalTersePrinter<T>::Print(value.get(), os);
}
};
template <typename T, size_t N>
class UniversalTersePrinter<T[N]> {
public: