Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
performance
toolshed
visit_bools
Commits
f5aa6154
Commit
f5aa6154
authored
Oct 10, 2019
by
Kenneth Hanley
Browse files
Fix type and variable naming
parent
22fdc78a
Changes
1
Hide whitespace changes
Inline
Side-by-side
visit_bools.hpp
View file @
f5aa6154
...
...
@@ -5,64 +5,65 @@ namespace visit_bools {
namespace
detail
{
template
<
size_t
...
N
,
typename
Call
back
,
typename
ArgsTuple
>
template
<
size_t
...
N
,
typename
Call
able
,
typename
ArgsTuple
>
constexpr
decltype
(
auto
)
invoke_tuple
(
std
::
index_sequence
<
N
...
>
,
Call
back
&&
call
back
,
ArgsTuple
&&
args
std
::
index_sequence
<
N
...
>
,
Call
able
&&
call
able
,
ArgsTuple
&&
args
)
{
return
call
back
(
std
::
get
<
N
>
(
std
::
forward
<
ArgsTuple
>
(
args
))...);
return
call
able
(
std
::
get
<
N
>
(
std
::
forward
<
ArgsTuple
>
(
args
))...);
}
template
<
typename
Call
back
,
typename
ArgsTuple
>
constexpr
decltype
(
auto
)
visit_bools_impl
(
Call
back
&&
call
back
,
ArgsTuple
&&
args
)
{
template
<
typename
Call
able
,
typename
ArgsTuple
>
constexpr
decltype
(
auto
)
visit_bools_impl
(
Call
able
&&
call
able
,
ArgsTuple
&&
args
)
{
return
invoke_tuple
(
std
::
make_index_sequence
<
std
::
tuple_size
<
ArgsTuple
>::
value
>
(),
std
::
forward
<
Call
back
>
(
call
back
),
std
::
forward
<
ArgsTuple
>
(
args
)
std
::
forward
<
Call
able
>
(
call
able
),
std
::
forward
<
ArgsTuple
>
(
args
)
);
}
template
<
typename
Tuple
Head
,
typename
Call
back
,
typename
...
Args
>
template
<
typename
ArgsLeft
Tuple
,
typename
Call
able
,
typename
...
Args
Right
>
constexpr
decltype
(
auto
)
visit_bools_impl
(
Callback
&&
callback
,
TupleHead
&&
head
,
bool
arg
,
Args
&&
...
args
Callable
&&
callable
,
ArgsLeftTuple
&&
args_left_tuple
,
bool
arg
,
ArgsRight
&&
...
args_right
);
template
<
typename
Tuple
Head
,
typename
Call
back
,
typename
Arg
,
typename
...
Args
>
template
<
typename
ArgsLeft
Tuple
,
typename
Call
able
,
typename
Arg
,
typename
...
Args
Right
>
constexpr
decltype
(
auto
)
visit_bools_impl
(
Call
back
&&
call
back
,
TupleHead
&&
head
,
Arg
&&
arg
,
Args
&&
...
args
Call
able
&&
call
able
,
ArgsLeftTuple
&&
args_left_tuple
,
Arg
&&
arg
,
Args
Right
&&
...
args
_right
)
{
return
visit_bools_impl
(
std
::
forward
<
Call
back
>
(
call
back
),
std
::
forward
<
Call
able
>
(
call
able
),
std
::
tuple_cat
(
std
::
forward
<
TupleHead
>
(
head
),
std
::
forward
<
ArgsLeftTuple
>
(
args_left_tuple
),
std
::
forward_as_tuple
(
std
::
forward
<
Arg
>
(
arg
))
),
std
::
forward
<
Args
>
(
args
)...
std
::
forward
<
Args
Right
>
(
args
_right
)...
);
}
template
<
typename
Tuple
Head
,
typename
Call
back
,
typename
...
Args
>
template
<
typename
ArgsLeft
Tuple
,
typename
Call
able
,
typename
...
Args
Right
>
constexpr
decltype
(
auto
)
visit_bools_impl
(
Call
back
&&
call
back
,
TupleHead
&&
head
,
bool
arg
,
Args
&&
...
args
Call
able
&&
call
able
,
ArgsLeftTuple
&&
args_left_tuple
,
bool
arg
,
Args
Right
&&
...
args
_right
)
{
if
(
arg
)
{
return
visit_bools_impl
(
std
::
forward
<
Call
back
>
(
call
back
),
std
::
forward
<
Call
able
>
(
call
able
),
std
::
tuple_cat
(
std
::
forward
<
TupleHead
>
(
head
),
std
::
forward
<
ArgsLeftTuple
>
(
args_left_tuple
),
std
::
forward_as_tuple
(
std
::
true_type
{})
),
std
::
forward
<
Args
>
(
args
)...
std
::
forward
<
Args
Right
>
(
args
_right
)...
);
}
else
{
return
visit_bools_impl
(
std
::
forward
<
Call
back
>
(
call
back
),
std
::
forward
<
Call
able
>
(
call
able
),
std
::
tuple_cat
(
std
::
forward
<
TupleHead
>
(
head
),
std
::
forward
<
ArgsLeftTuple
>
(
args_left_tuple
),
std
::
forward_as_tuple
(
std
::
false_type
{})
),
std
::
forward
<
Args
>
(
args
)...
std
::
forward
<
Args
Right
>
(
args
_right
)...
);
}
}
...
...
Write
Preview
Supports
Markdown
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