diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 70750827e6..8860ba6a01 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 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 >::value>(), - BooleanConstant< - std::is_convertible::value>()); + return CastImpl(polymorphic_matcher_or_value, + bool_constant>::value>(), + bool_constant::value>()); } private: template static Matcher CastImpl(const M& polymorphic_matcher_or_value, - BooleanConstant /* convertible_to_matcher */, - BooleanConstant) { + bool_constant /* convertible_to_matcher */, + bool_constant) { // M is implicitly convertible to Matcher, which means that either // M is a polymorphic matcher or Matcher 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, 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 CastImpl( - const M& value, BooleanConstant /* convertible_to_matcher */, - BooleanConstant /* convertible_to_T */) { + static Matcher CastImpl(const M& value, + bool_constant /* convertible_to_matcher */, + bool_constant /* convertible_to_T */) { return Matcher(ImplicitCast_(value)); } @@ -175,9 +172,9 @@ class MatcherCastImpl { // (e.g. std::pair vs. std::pair). // // We don't define this method inline as we need the declaration of Eq(). - static Matcher CastImpl( - const M& value, BooleanConstant /* convertible_to_matcher */, - BooleanConstant /* convertible_to_T */); + static Matcher CastImpl(const M& value, + bool_constant /* convertible_to_matcher */, + bool_constant /* convertible_to_T */); }; // This more specialized version is used when MatcherCast()'s argument @@ -3603,9 +3600,8 @@ inline Matcher An() { return A(); } template Matcher internal::MatcherCastImpl::CastImpl( - const M& value, - internal::BooleanConstant /* convertible_to_matcher */, - internal::BooleanConstant /* convertible_to_T */) { + const M& value, internal::bool_constant /* convertible_to_matcher */, + internal::bool_constant /* convertible_to_T */) { return Eq(value); } diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 7411f7eb70..c742436874 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -501,11 +501,6 @@ struct RemoveConstFromKey > { typedef std::pair type; }; -// Mapping from booleans to types. Similar to boost::bool_ and -// std::integral_constant. -template -struct BooleanConstant {}; - // Emit an assertion failure due to incorrect DoDefault() usage. Out-of-lined to // reduce code size. GTEST_API_ void IllegalDoDefault(const char* file, int line);