|
|
@ -2068,15 +2068,15 @@ class ContainerEqMatcher { |
|
|
|
typedef typename View::type StlContainer; |
|
|
|
typedef typename View::type StlContainer; |
|
|
|
typedef typename View::const_reference StlContainerReference; |
|
|
|
typedef typename View::const_reference StlContainerReference; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static_assert(!std::is_const<Container>::value, |
|
|
|
|
|
|
|
"Container type must not be const"); |
|
|
|
|
|
|
|
static_assert(!std::is_reference<Container>::value, |
|
|
|
|
|
|
|
"Container type must not be a reference"); |
|
|
|
|
|
|
|
|
|
|
|
// We make a copy of expected in case the elements in it are modified
|
|
|
|
// We make a copy of expected in case the elements in it are modified
|
|
|
|
// after this matcher is created.
|
|
|
|
// after this matcher is created.
|
|
|
|
explicit ContainerEqMatcher(const Container& expected) |
|
|
|
explicit ContainerEqMatcher(const Container& expected) |
|
|
|
: expected_(View::Copy(expected)) { |
|
|
|
: expected_(View::Copy(expected)) {} |
|
|
|
// Makes sure the user doesn't instantiate this class template
|
|
|
|
|
|
|
|
// with a const or reference type.
|
|
|
|
|
|
|
|
(void)testing::StaticAssertTypeEq<Container, |
|
|
|
|
|
|
|
GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DescribeTo(::std::ostream* os) const { |
|
|
|
void DescribeTo(::std::ostream* os) const { |
|
|
|
*os << "equals "; |
|
|
|
*os << "equals "; |
|
|
@ -2243,15 +2243,15 @@ class PointwiseMatcher { |
|
|
|
typedef typename RhsView::type RhsStlContainer; |
|
|
|
typedef typename RhsView::type RhsStlContainer; |
|
|
|
typedef typename RhsStlContainer::value_type RhsValue; |
|
|
|
typedef typename RhsStlContainer::value_type RhsValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static_assert(!std::is_const<RhsContainer>::value, |
|
|
|
|
|
|
|
"RhsContainer type must not be const"); |
|
|
|
|
|
|
|
static_assert(!std::is_reference<RhsContainer>::value, |
|
|
|
|
|
|
|
"RhsContainer type must not be a reference"); |
|
|
|
|
|
|
|
|
|
|
|
// Like ContainerEq, we make a copy of rhs in case the elements in
|
|
|
|
// Like ContainerEq, we make a copy of rhs in case the elements in
|
|
|
|
// it are modified after this matcher is created.
|
|
|
|
// it are modified after this matcher is created.
|
|
|
|
PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs) |
|
|
|
PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs) |
|
|
|
: tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) { |
|
|
|
: tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {} |
|
|
|
// Makes sure the user doesn't instantiate this class template
|
|
|
|
|
|
|
|
// with a const or reference type.
|
|
|
|
|
|
|
|
(void)testing::StaticAssertTypeEq<RhsContainer, |
|
|
|
|
|
|
|
GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename LhsContainer> |
|
|
|
template <typename LhsContainer> |
|
|
|
operator Matcher<LhsContainer>() const { |
|
|
|
operator Matcher<LhsContainer>() const { |
|
|
|