Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Googletest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Meng
Googletest
Commits
6729a136
Commit
6729a136
authored
6 years ago
by
Ryohei Machida
Committed by
Gennadiy Civil
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Merge #2002
PiperOrigin-RevId: 227030722
parent
77004096
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
googletest/include/gtest/internal/gtest-internal.h
+9
-22
9 additions, 22 deletions
googletest/include/gtest/internal/gtest-internal.h
googletest/test/googletest-printers-test.cc
+6
-0
6 additions, 0 deletions
googletest/test/googletest-printers-test.cc
with
15 additions
and
22 deletions
googletest/include/gtest/internal/gtest-internal.h
+
9
−
22
View file @
6729a136
...
...
@@ -967,37 +967,24 @@ struct IsHashTable {
template
<
typename
T
>
const
bool
IsHashTable
<
T
>::
value
;
template
<
typename
T
>
struct
VoidT
{
typedef
void
value_type
;
};
template
<
typename
T
,
typename
=
void
>
struct
HasValueType
:
false_type
{};
template
<
typename
T
>
struct
HasValueType
<
T
,
VoidT
<
typename
T
::
value_type
>
>
:
true_type
{
};
template
<
typename
C
,
bool
=
sizeof
(
IsContainerTest
<
C
>(
0
))
==
sizeof
(
IsContainer
),
bool
=
HasValueType
<
C
>::
value
>
bool
=
sizeof
(
IsContainerTest
<
C
>(
0
))
==
sizeof
(
IsContainer
)
>
struct
IsRecursiveContainerImpl
;
template
<
typename
C
,
bool
HV
>
struct
IsRecursiveContainerImpl
<
C
,
false
,
HV
>
:
public
false_type
{};
template
<
typename
C
>
struct
IsRecursiveContainerImpl
<
C
,
false
>
:
public
false_type
{};
// Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
// obey the same inconsistencies as the IsContainerTest, namely check if
// something is a container is relying on only const_iterator in C++11 and
// is relying on both const_iterator and iterator otherwise
template
<
typename
C
>
struct
IsRecursiveContainerImpl
<
C
,
true
,
false
>
:
public
false_type
{};
template
<
typename
C
>
struct
IsRecursiveContainerImpl
<
C
,
true
,
true
>
{
typedef
typename
IteratorTraits
<
typename
C
::
const_iterator
>::
value_type
value_type
;
typedef
is_same
<
value_type
,
C
>
type
;
struct
IsRecursiveContainerImpl
<
C
,
true
>
{
using
value_type
=
decltype
(
*
std
::
declval
<
typename
C
::
const_iterator
>
());
using
type
=
is_same
<
typename
std
::
remove_const
<
typename
std
::
remove_reference
<
value_type
>::
type
>::
type
,
C
>
;
};
// IsRecursiveContainer<Type> is a unary compile-time predicate that
...
...
This diff is collapsed.
Click to expand it.
googletest/test/googletest-printers-test.cc
+
6
−
0
View file @
6729a136
...
...
@@ -183,8 +183,14 @@ class PathLike {
public:
struct
iterator
{
typedef
PathLike
value_type
;
iterator
&
operator
++
();
PathLike
&
operator
*
();
};
using
value_type
=
char
;
using
const_iterator
=
iterator
;
PathLike
()
{}
iterator
begin
()
const
{
return
iterator
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment