From 6729a1361150131bc5d394d5cd2b4cdf0953ee7b Mon Sep 17 00:00:00 2001 From: Ryohei Machida Date: Thu, 27 Dec 2018 11:33:30 -0500 Subject: Merge #2002 PiperOrigin-RevId: 227030722 --- googletest/include/gtest/internal/gtest-internal.h | 31 +++++++--------------- googletest/test/googletest-printers-test.cc | 6 +++++ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index b32237a..f66a5c1 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -967,37 +967,24 @@ struct IsHashTable { template const bool IsHashTable::value; -template -struct VoidT { - typedef void value_type; -}; - -template -struct HasValueType : false_type {}; -template -struct HasValueType > : true_type { -}; - template (0)) == sizeof(IsContainer), - bool = HasValueType::value> + bool = sizeof(IsContainerTest(0)) == sizeof(IsContainer)> struct IsRecursiveContainerImpl; -template -struct IsRecursiveContainerImpl : public false_type {}; +template +struct IsRecursiveContainerImpl : public false_type {}; // Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to // obey the same inconsistencies as the IsContainerTest, namely check if // something is a container is relying on only const_iterator in C++11 and // is relying on both const_iterator and iterator otherwise template -struct IsRecursiveContainerImpl : public false_type {}; - -template -struct IsRecursiveContainerImpl { - typedef typename IteratorTraits::value_type - value_type; - typedef is_same type; +struct IsRecursiveContainerImpl { + using value_type = decltype(*std::declval()); + using type = + is_same::type>::type, + C>; }; // IsRecursiveContainer is a unary compile-time predicate that diff --git a/googletest/test/googletest-printers-test.cc b/googletest/test/googletest-printers-test.cc index 139b3e4..961e818 100644 --- a/googletest/test/googletest-printers-test.cc +++ b/googletest/test/googletest-printers-test.cc @@ -183,8 +183,14 @@ class PathLike { public: struct iterator { typedef PathLike value_type; + + iterator& operator++(); + PathLike& operator*(); }; + using value_type = char; + using const_iterator = iterator; + PathLike() {} iterator begin() const { return iterator(); } -- cgit v0.12