summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/gtest-printers.h
diff options
context:
space:
mode:
authorKrystian Kuzniarek <krystian.kuzniarek@gmail.com>2020-03-07 15:48:20 +0100
committerKrystian Kuzniarek <krystian.kuzniarek@gmail.com>2020-05-29 13:59:42 +0200
commit95b0ea2cf5046465f448f01efa7c4b764a62a4bb (patch)
treec0275686d3542451e8cdf30eddea36b2f0256c01 /googletest/include/gtest/gtest-printers.h
parent33b44c4b35b5b24624c1203001e36df2dbab346b (diff)
downloadgoogletest-95b0ea2cf5046465f448f01efa7c4b764a62a4bb.tar.gz
googletest-95b0ea2cf5046465f448f01efa7c4b764a62a4bb.zip
specialize UniversalPrinter<> for std::optional
Diffstat (limited to 'googletest/include/gtest/gtest-printers.h')
-rw-r--r--googletest/include/gtest/gtest-printers.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h
index 39c72c43..4260e4f7 100644
--- a/googletest/include/gtest/gtest-printers.h
+++ b/googletest/include/gtest/gtest-printers.h
@@ -113,7 +113,6 @@
#if GTEST_HAS_ABSL
#include "absl/strings/string_view.h"
-#include "absl/types/optional.h"
#endif // GTEST_HAS_ABSL
namespace testing {
@@ -680,14 +679,14 @@ class UniversalPrinter {
GTEST_DISABLE_MSC_WARNINGS_POP_()
};
-#if GTEST_HAS_ABSL
+#if GTEST_INTERNAL_HAS_OPTIONAL
-// Printer for absl::optional
+// Printer for std::optional / absl::optional
template <typename T>
-class UniversalPrinter<::absl::optional<T>> {
+class UniversalPrinter<Optional<T>> {
public:
- static void Print(const ::absl::optional<T>& value, ::std::ostream* os) {
+ static void Print(const Optional<T>& value, ::std::ostream* os) {
*os << '(';
if (!value) {
*os << "nullopt";
@@ -698,7 +697,7 @@ class UniversalPrinter<::absl::optional<T>> {
}
};
-#endif // GTEST_HAS_ABSL
+#endif // GTEST_INTERNAL_HAS_OPTIONAL
#if GTEST_INTERNAL_HAS_VARIANT
OpenPOWER on IntegriCloud