diff options
author | kuzkry <krystian.kuzniarek@gmail.com> | 2019-08-23 11:57:56 -0400 |
---|---|---|
committer | Xiaoyi Zhang <zhangxy@google.com> | 2019-08-23 16:39:13 -0400 |
commit | db1b739943e9ea996105239573e3c38a50bf38cc (patch) | |
tree | 3fd11dcc8ef32305a28117f165d83d4e5873ae5b /googlemock/include/gmock/gmock-matchers.h | |
parent | 46525e1e5dfcb0a3c195bc2f94859b196e7cba76 (diff) | |
download | googletest-db1b739943e9ea996105239573e3c38a50bf38cc.tar.gz googletest-db1b739943e9ea996105239573e3c38a50bf38cc.tar.bz2 googletest-db1b739943e9ea996105239573e3c38a50bf38cc.zip |
Googletest export
Merge b8ca465e73ac0954a0c9eec2a84bdd8913d5763b into 90a443f9c2437ca8a682a1ac625eba64e1d74a8a
Closes #2396
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2396 from kuzkry:custom-type-traits-true/false_type-and-bool_constant b8ca465e73ac0954a0c9eec2a84bdd8913d5763b
PiperOrigin-RevId: 265064856
Diffstat (limited to 'googlemock/include/gmock/gmock-matchers.h')
-rw-r--r-- | googlemock/include/gmock/gmock-matchers.h | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 5fe38205..b1c0dc04 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -132,19 +132,16 @@ class MatcherCastImpl { // polymorphic_matcher_or_value to Matcher<T> because it won't trigger // a user-defined conversion from M to T if one exists (assuming M is // a value). - return CastImpl( - polymorphic_matcher_or_value, - BooleanConstant< - std::is_convertible<M, Matcher<T> >::value>(), - BooleanConstant< - std::is_convertible<M, T>::value>()); + return CastImpl(polymorphic_matcher_or_value, + bool_constant<std::is_convertible<M, Matcher<T>>::value>(), + bool_constant<std::is_convertible<M, T>::value>()); } private: template <bool Ignore> static Matcher<T> CastImpl(const M& polymorphic_matcher_or_value, - BooleanConstant<true> /* convertible_to_matcher */, - BooleanConstant<Ignore>) { + bool_constant<true> /* convertible_to_matcher */, + bool_constant<Ignore>) { // M is implicitly convertible to Matcher<T>, which means that either // M is a polymorphic matcher or Matcher<T> has an implicit constructor // from M. In both cases using the implicit conversion will produce a @@ -159,9 +156,9 @@ class MatcherCastImpl { // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic // matcher. It's a value of a type implicitly convertible to T. Use direct // initialization to create a matcher. - static Matcher<T> CastImpl( - const M& value, BooleanConstant<false> /* convertible_to_matcher */, - BooleanConstant<true> /* convertible_to_T */) { + static Matcher<T> CastImpl(const M& value, + bool_constant<false> /* convertible_to_matcher */, + bool_constant<true> /* convertible_to_T */) { return Matcher<T>(ImplicitCast_<T>(value)); } @@ -175,9 +172,9 @@ class MatcherCastImpl { // (e.g. std::pair<const int, int> vs. std::pair<int, int>). // // We don't define this method inline as we need the declaration of Eq(). - static Matcher<T> CastImpl( - const M& value, BooleanConstant<false> /* convertible_to_matcher */, - BooleanConstant<false> /* convertible_to_T */); + static Matcher<T> CastImpl(const M& value, + bool_constant<false> /* convertible_to_matcher */, + bool_constant<false> /* convertible_to_T */); }; // This more specialized version is used when MatcherCast()'s argument @@ -3603,9 +3600,8 @@ inline Matcher<T> An() { return A<T>(); } template <typename T, typename M> Matcher<T> internal::MatcherCastImpl<T, M>::CastImpl( - const M& value, - internal::BooleanConstant<false> /* convertible_to_matcher */, - internal::BooleanConstant<false> /* convertible_to_T */) { + const M& value, internal::bool_constant<false> /* convertible_to_matcher */, + internal::bool_constant<false> /* convertible_to_T */) { return Eq(value); } |