summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-12-16 10:14:13 (GMT)
committerMark Barolak <mbar@google.com>2018-12-17 18:53:39 (GMT)
commitb7dd66519f4af354b1938860a4073669b6cd91ab (patch)
tree8c93571e49faa84a30f14736a1560585db3ec931 /googletest/include
parent1ec20f87e390e1d711e69b69345e68a1fa656bbc (diff)
downloadgoogletest-b7dd66519f4af354b1938860a4073669b6cd91ab.zip
googletest-b7dd66519f4af354b1938860a4073669b6cd91ab.tar.gz
googletest-b7dd66519f4af354b1938860a4073669b6cd91ab.tar.bz2
Googletest export
Remove GTEST_REFERENCE_TO_CONST_ usage from GMock. In C++11, it's redundant. PiperOrigin-RevId: 225719210
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/gtest-matchers.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/googletest/include/gtest/gtest-matchers.h b/googletest/include/gtest/gtest-matchers.h
index 9bcf5ac..02a9952 100644
--- a/googletest/include/gtest/gtest-matchers.h
+++ b/googletest/include/gtest/gtest-matchers.h
@@ -256,13 +256,12 @@ class MatcherBase {
public:
// Returns true iff the matcher matches x; also explains the match
// result to 'listener'.
- bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x,
- MatchResultListener* listener) const {
+ bool MatchAndExplain(const T& x, MatchResultListener* listener) const {
return impl_->MatchAndExplain(x, listener);
}
// Returns true iff this matcher matches x.
- bool Matches(GTEST_REFERENCE_TO_CONST_(T) x) const {
+ bool Matches(const T& x) const {
DummyMatchResultListener dummy;
return MatchAndExplain(x, &dummy);
}
@@ -276,8 +275,7 @@ class MatcherBase {
}
// Explains why x matches, or doesn't match, the matcher.
- void ExplainMatchResultTo(GTEST_REFERENCE_TO_CONST_(T) x,
- ::std::ostream* os) const {
+ void ExplainMatchResultTo(const T& x, ::std::ostream* os) const {
StreamMatchResultListener listener(os);
MatchAndExplain(x, &listener);
}
@@ -293,22 +291,19 @@ class MatcherBase {
MatcherBase() {}
// Constructs a matcher from its implementation.
- explicit MatcherBase(
- const MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)>* impl)
- : impl_(impl) {}
+ explicit MatcherBase(const MatcherInterface<const T&>* impl) : impl_(impl) {}
template <typename U>
explicit MatcherBase(
const MatcherInterface<U>* impl,
typename internal::EnableIf<
- !internal::IsSame<U, GTEST_REFERENCE_TO_CONST_(U)>::value>::type* =
- nullptr)
+ !internal::IsSame<U, const U&>::value>::type* = nullptr)
: impl_(new internal::MatcherInterfaceAdapter<U>(impl)) {}
virtual ~MatcherBase() {}
private:
- std::shared_ptr<const MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)>> impl_;
+ std::shared_ptr<const MatcherInterface<const T&>> impl_;
};
} // namespace internal
@@ -326,15 +321,13 @@ class Matcher : public internal::MatcherBase<T> {
explicit Matcher() {} // NOLINT
// Constructs a matcher from its implementation.
- explicit Matcher(const MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)>* impl)
+ explicit Matcher(const MatcherInterface<const T&>* impl)
: internal::MatcherBase<T>(impl) {}
template <typename U>
- explicit Matcher(
- const MatcherInterface<U>* impl,
- typename internal::EnableIf<
- !internal::IsSame<U, GTEST_REFERENCE_TO_CONST_(U)>::value>::type* =
- nullptr)
+ explicit Matcher(const MatcherInterface<U>* impl,
+ typename internal::EnableIf<
+ !internal::IsSame<U, const U&>::value>::type* = nullptr)
: internal::MatcherBase<T>(impl) {}
// Implicit constructor here allows people to write
@@ -535,7 +528,7 @@ class PolymorphicMatcher {
template <typename T>
operator Matcher<T>() const {
- return Matcher<T>(new MonomorphicImpl<GTEST_REFERENCE_TO_CONST_(T)>(impl_));
+ return Matcher<T>(new MonomorphicImpl<const T&>(impl_));
}
private: