Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
38ce18e8
Commit
38ce18e8
authored
Aug 24, 2019
by
Krystian Kuzniarek
Browse files
post-review to
db1b7399
(#2396)
parent
db1b7399
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+9
-9
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
38ce18e8
...
@@ -133,14 +133,14 @@ class MatcherCastImpl {
...
@@ -133,14 +133,14 @@ class MatcherCastImpl {
// a user-defined conversion from M to T if one exists (assuming M is
// a user-defined conversion from M to T if one exists (assuming M is
// a value).
// a value).
return
CastImpl
(
polymorphic_matcher_or_value
,
return
CastImpl
(
polymorphic_matcher_or_value
,
bool_constant
<
std
::
is_convertible
<
M
,
Matcher
<
T
>>
::
value
>
()
,
std
::
is_convertible
<
M
,
Matcher
<
T
>>
{}
,
bool_constant
<
std
::
is_convertible
<
M
,
T
>
::
value
>
()
);
std
::
is_convertible
<
M
,
T
>
{}
);
}
}
private:
private:
template
<
bool
Ignore
>
template
<
bool
Ignore
>
static
Matcher
<
T
>
CastImpl
(
const
M
&
polymorphic_matcher_or_value
,
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
>
)
{
bool_constant
<
Ignore
>
)
{
// M is implicitly convertible to Matcher<T>, which means that either
// M is implicitly convertible to Matcher<T>, which means that either
// M is a polymorphic matcher or Matcher<T> has an implicit constructor
// M is a polymorphic matcher or Matcher<T> has an implicit constructor
...
@@ -157,8 +157,8 @@ class MatcherCastImpl {
...
@@ -157,8 +157,8 @@ class MatcherCastImpl {
// matcher. It's a value of a type implicitly convertible to T. Use direct
// matcher. It's a value of a type implicitly convertible to T. Use direct
// initialization to create a matcher.
// initialization to create a matcher.
static
Matcher
<
T
>
CastImpl
(
const
M
&
value
,
static
Matcher
<
T
>
CastImpl
(
const
M
&
value
,
bool_constant
<
false
>
/* convertible_to_matcher */
,
std
::
false_type
/* convertible_to_matcher */
,
bool_constant
<
true
>
/* convertible_to_T */
)
{
std
::
true_type
/* convertible_to_T */
)
{
return
Matcher
<
T
>
(
ImplicitCast_
<
T
>
(
value
));
return
Matcher
<
T
>
(
ImplicitCast_
<
T
>
(
value
));
}
}
...
@@ -173,8 +173,8 @@ class MatcherCastImpl {
...
@@ -173,8 +173,8 @@ class MatcherCastImpl {
//
//
// We don't define this method inline as we need the declaration of Eq().
// We don't define this method inline as we need the declaration of Eq().
static
Matcher
<
T
>
CastImpl
(
const
M
&
value
,
static
Matcher
<
T
>
CastImpl
(
const
M
&
value
,
bool_constant
<
false
>
/* convertible_to_matcher */
,
std
::
false_type
/* convertible_to_matcher */
,
bool_constant
<
false
>
/* convertible_to_T */
);
std
::
false_type
/* convertible_to_T */
);
};
};
// This more specialized version is used when MatcherCast()'s argument
// This more specialized version is used when MatcherCast()'s argument
...
@@ -3600,8 +3600,8 @@ inline Matcher<T> An() { return A<T>(); }
...
@@ -3600,8 +3600,8 @@ inline Matcher<T> An() { return A<T>(); }
template
<
typename
T
,
typename
M
>
template
<
typename
T
,
typename
M
>
Matcher
<
T
>
internal
::
MatcherCastImpl
<
T
,
M
>::
CastImpl
(
Matcher
<
T
>
internal
::
MatcherCastImpl
<
T
,
M
>::
CastImpl
(
const
M
&
value
,
internal
::
bool_constant
<
false
>
/* convertible_to_matcher */
,
const
M
&
value
,
std
::
false_type
/* convertible_to_matcher */
,
internal
::
bool_constant
<
false
>
/* convertible_to_T */
)
{
std
::
false_type
/* convertible_to_T */
)
{
return
Eq
(
value
);
return
Eq
(
value
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment