aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-matchers.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-08-31 23:51:23 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-08-31 23:51:23 +0000
commit2b43a9ecd16edc1ec55429967e0f2de1aaf8e8bb (patch)
tree77c7cf946b35c5735d70023342f0d21238503f3c /include/gmock/gmock-matchers.h
parent0ea67f88aea208e7ef13c91b374b352679beab38 (diff)
downloadgoogletest-2b43a9ecd16edc1ec55429967e0f2de1aaf8e8bb.tar.gz
googletest-2b43a9ecd16edc1ec55429967e0f2de1aaf8e8bb.tar.bz2
googletest-2b43a9ecd16edc1ec55429967e0f2de1aaf8e8bb.zip
Adds mutable_impl() and impl() to PolymorphicMatcher (by Zhanyong Wan); Enables gMock to compile with VC 7.1 (by Vlad Losev).
Diffstat (limited to 'include/gmock/gmock-matchers.h')
-rw-r--r--include/gmock/gmock-matchers.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h
index 9e97866a..7266fba7 100644
--- a/include/gmock/gmock-matchers.h
+++ b/include/gmock/gmock-matchers.h
@@ -236,6 +236,14 @@ class PolymorphicMatcher {
public:
explicit PolymorphicMatcher(const Impl& impl) : impl_(impl) {}
+ // Returns a mutable reference to the underlying matcher
+ // implementation object.
+ Impl& mutable_impl() { return impl_; }
+
+ // Returns an immutable reference to the underlying matcher
+ // implementation object.
+ const Impl& impl() const { return impl_; }
+
template <typename T>
operator Matcher<T>() const {
return Matcher<T>(new MonomorphicImpl<T>(impl_));
@@ -273,11 +281,12 @@ class PolymorphicMatcher {
// doesn't need to customize it.
ExplainMatchResultTo(impl_, x, os);
}
+
private:
const Impl impl_;
};
- const Impl impl_;
+ Impl impl_;
};
// Creates a matcher from its implementation. This is easier to use