Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
6a015ca1
Commit
6a015ca1
authored
Aug 14, 2019
by
Krystian Kuzniarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reuse IndexSequence from googletest
parent
90a443f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
gmock-internal-utils.h
googlemock/include/gmock/internal/gmock-internal-utils.h
+3
-14
No files found.
googlemock/include/gmock/internal/gmock-internal-utils.h
View file @
6a015ca1
...
@@ -506,19 +506,8 @@ struct BooleanConstant {};
...
@@ -506,19 +506,8 @@ struct BooleanConstant {};
// reduce code size.
// reduce code size.
GTEST_API_
void
IllegalDoDefault
(
const
char
*
file
,
int
line
);
GTEST_API_
void
IllegalDoDefault
(
const
char
*
file
,
int
line
);
// Helper types for Apply() below.
template
<
size_t
...
Is
>
struct
int_pack
{
typedef
int_pack
type
;
};
template
<
class
Pack
,
size_t
I
>
struct
append
;
template
<
size_t
...
Is
,
size_t
I
>
struct
append
<
int_pack
<
Is
...
>
,
I
>
:
int_pack
<
Is
...,
I
>
{};
template
<
size_t
C
>
struct
make_int_pack
:
append
<
typename
make_int_pack
<
C
-
1
>::
type
,
C
-
1
>
{};
template
<>
struct
make_int_pack
<
0
>
:
int_pack
<>
{};
template
<
typename
F
,
typename
Tuple
,
size_t
...
Idx
>
template
<
typename
F
,
typename
Tuple
,
size_t
...
Idx
>
auto
ApplyImpl
(
F
&&
f
,
Tuple
&&
args
,
int_pack
<
Idx
...
>
)
->
decltype
(
auto
ApplyImpl
(
F
&&
f
,
Tuple
&&
args
,
IndexSequence
<
Idx
...
>
)
->
decltype
(
std
::
forward
<
F
>
(
f
)(
std
::
get
<
Idx
>
(
std
::
forward
<
Tuple
>
(
args
))...))
{
std
::
forward
<
F
>
(
f
)(
std
::
get
<
Idx
>
(
std
::
forward
<
Tuple
>
(
args
))...))
{
return
std
::
forward
<
F
>
(
f
)(
std
::
get
<
Idx
>
(
std
::
forward
<
Tuple
>
(
args
))...);
return
std
::
forward
<
F
>
(
f
)(
std
::
get
<
Idx
>
(
std
::
forward
<
Tuple
>
(
args
))...);
}
}
...
@@ -527,9 +516,9 @@ auto ApplyImpl(F&& f, Tuple&& args, int_pack<Idx...>) -> decltype(
...
@@ -527,9 +516,9 @@ auto ApplyImpl(F&& f, Tuple&& args, int_pack<Idx...>) -> decltype(
template
<
typename
F
,
typename
Tuple
>
template
<
typename
F
,
typename
Tuple
>
auto
Apply
(
F
&&
f
,
Tuple
&&
args
)
auto
Apply
(
F
&&
f
,
Tuple
&&
args
)
->
decltype
(
ApplyImpl
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
Tuple
>
(
args
),
->
decltype
(
ApplyImpl
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
Tuple
>
(
args
),
make_int_pack
<
std
::
tuple_size
<
Tuple
>::
value
>
()))
{
MakeIndexSequence
<
std
::
tuple_size
<
Tuple
>::
value
>
()))
{
return
ApplyImpl
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
Tuple
>
(
args
),
return
ApplyImpl
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
Tuple
>
(
args
),
make_int_pack
<
std
::
tuple_size
<
Tuple
>::
value
>
());
MakeIndexSequence
<
std
::
tuple_size
<
Tuple
>::
value
>
());
}
}
// Template struct Function<F>, where F must be a function type, contains
// Template struct Function<F>, where F must be a function type, contains
...
...
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