Googletest export

Deduce SizeType for SizeIs() from the return value of the size() member function

PiperOrigin-RevId: 223835674
This commit is contained in:
Abseil Team
2018-12-03 14:55:34 -05:00
committed by Gennadiy Civil
parent 3fd66989bb
commit 3d71ab4c37
2 changed files with 12 additions and 3 deletions

View File

@@ -1955,9 +1955,7 @@ class SizeIsMatcher {
template <typename Container>
class Impl : public MatcherInterface<Container> {
public:
typedef internal::StlContainerView<
GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
typedef typename ContainerView::type::size_type SizeType;
using SizeType = decltype(std::declval<Container>().size());
explicit Impl(const SizeMatcher& size_matcher)
: size_matcher_(MatcherCast<SizeType>(size_matcher)) {}