diff options
author | Abseil Team <absl-team@google.com> | 2022-10-14 17:32:14 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-10-14 17:32:49 (GMT) |
commit | 137b6e2770deb44aacd229c20507413120655b22 (patch) | |
tree | 951fba6e4571ade162263cfeea6c37ec1177fd38 /googletest/include | |
parent | 67174c7675fe500644490c49e8c822173f7e1f9a (diff) | |
download | googletest-137b6e2770deb44aacd229c20507413120655b22.zip googletest-137b6e2770deb44aacd229c20507413120655b22.tar.gz googletest-137b6e2770deb44aacd229c20507413120655b22.tar.bz2 |
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
Diffstat (limited to 'googletest/include')
-rw-r--r-- | googletest/include/gtest/gtest-printers.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 8e4d295..89215e6 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -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: |