diff options
author | Gennadiy Civil <gennadiycivil@users.noreply.github.com> | 2018-07-20 15:53:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-20 15:53:16 -0400 |
commit | fd4f7cc7299e8fde91d45ba6685fbd99698814e0 (patch) | |
tree | 37786e74b9947f7bf3b677629aaf8cde10c1d85e /googlemock/include/gmock/gmock-matchers.h | |
parent | 1f9c668a0452148f725b242079f70d65d3e93153 (diff) | |
parent | 2a151c93c180ac765c27c5f2e37af9366abd4d55 (diff) | |
download | googletest-fd4f7cc7299e8fde91d45ba6685fbd99698814e0.tar.gz googletest-fd4f7cc7299e8fde91d45ba6685fbd99698814e0.tar.bz2 googletest-fd4f7cc7299e8fde91d45ba6685fbd99698814e0.zip |
Merge branch 'master' into deprecate
Diffstat (limited to 'googlemock/include/gmock/gmock-matchers.h')
-rw-r--r-- | googlemock/include/gmock/gmock-matchers.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index c94f5826..eb096135 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -4529,6 +4529,20 @@ Property(PropertyType (Class::*property)() const &, property, MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher))); } + +// Three-argument form for reference-qualified member functions. +template <typename Class, typename PropertyType, typename PropertyMatcher> +inline PolymorphicMatcher<internal::PropertyMatcher< + Class, PropertyType, PropertyType (Class::*)() const &> > +Property(const std::string& property_name, + PropertyType (Class::*property)() const &, + const PropertyMatcher& matcher) { + return MakePolymorphicMatcher( + internal::PropertyMatcher<Class, PropertyType, + PropertyType (Class::*)() const &>( + property_name, property, + MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher))); +} #endif // Creates a matcher that matches an object iff the result of applying @@ -5165,13 +5179,17 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) { // Define variadic matcher versions. They are overloaded in // gmock-generated-matchers.h for the cases supported by pre C++11 compilers. template <typename... Args> -internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) { - return internal::AllOfMatcher<Args...>(matchers...); +internal::AllOfMatcher<typename std::decay<const Args&>::type...> AllOf( + const Args&... matchers) { + return internal::AllOfMatcher<typename std::decay<const Args&>::type...>( + matchers...); } template <typename... Args> -internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) { - return internal::AnyOfMatcher<Args...>(matchers...); +internal::AnyOfMatcher<typename std::decay<const Args&>::type...> AnyOf( + const Args&... matchers) { + return internal::AnyOfMatcher<typename std::decay<const Args&>::type...>( + matchers...); } template <typename... Args> |