Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-review to #2396 #2426

Merged
merged 1 commit into from
Aug 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions googlemock/include/gmock/gmock-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ class MatcherCastImpl {
// a user-defined conversion from M to T if one exists (assuming M is
// a value).
return CastImpl(polymorphic_matcher_or_value,
bool_constant<std::is_convertible<M, Matcher<T>>::value>(),
bool_constant<std::is_convertible<M, T>::value>());
std::is_convertible<M, Matcher<T>>{},
std::is_convertible<M, T>{});
}

private:
template <bool Ignore>
static Matcher<T> CastImpl(const M& polymorphic_matcher_or_value,
bool_constant<true> /* convertible_to_matcher */,
std::true_type /* 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
Expand All @@ -157,8 +157,8 @@ class MatcherCastImpl {
// 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,
bool_constant<false> /* convertible_to_matcher */,
bool_constant<true> /* convertible_to_T */) {
std::false_type /* convertible_to_matcher */,
std::true_type /* convertible_to_T */) {
return Matcher<T>(ImplicitCast_<T>(value));
}

Expand All @@ -173,8 +173,8 @@ class MatcherCastImpl {
//
// We don't define this method inline as we need the declaration of Eq().
static Matcher<T> CastImpl(const M& value,
bool_constant<false> /* convertible_to_matcher */,
bool_constant<false> /* convertible_to_T */);
std::false_type /* convertible_to_matcher */,
std::false_type /* convertible_to_T */);
};

// This more specialized version is used when MatcherCast()'s argument
Expand Down Expand Up @@ -3600,8 +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::bool_constant<false> /* convertible_to_matcher */,
internal::bool_constant<false> /* convertible_to_T */) {
const M& value, std::false_type /* convertible_to_matcher */,
std::false_type /* convertible_to_T */) {
return Eq(value);
}

Expand Down