Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
dacdf9ad
Commit
dacdf9ad
authored
Jun 19, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify implementation of tl_is_strict_subset
parent
b6a18114
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
libcaf_core/caf/detail/type_list.hpp
libcaf_core/caf/detail/type_list.hpp
+22
-22
No files found.
libcaf_core/caf/detail/type_list.hpp
View file @
dacdf9ad
...
@@ -910,32 +910,32 @@ struct tl_apply<type_list<Ts...>, VarArgTemplate> {
...
@@ -910,32 +910,32 @@ struct tl_apply<type_list<Ts...>, VarArgTemplate> {
// bool is_strict_subset(list,list)
// bool is_strict_subset(list,list)
template
<
class
ListB
>
template
<
class
List
,
class
T
>
struct
tl_is_strict_subset_step
{
constexpr
int
tlf_find
()
{
template
<
class
T
>
return
tl_find
<
List
,
T
>::
value
;
struct
inner
{
}
using
type
=
std
::
integral_constant
<
bool
,
tl_find
<
ListB
,
T
>::
value
!=
-
1
>
;
};
constexpr
bool
tlf_no_negative
()
{
};
return
true
;
}
template
<
class
T
,
class
...
Ts
>
constexpr
bool
tlf_no_negative
(
T
x
,
Ts
...
xs
)
{
return
x
<
0
?
false
:
tlf_no_negative
(
xs
...);
}
/// Tests whether ListA ist a strict subset of ListB (or equal).
/// Tests whether ListA ist a strict subset of ListB (or equal).
template
<
class
ListA
,
class
ListB
>
template
<
class
ListA
,
class
ListB
>
struct
tl_is_strict_subset
{
struct
tl_is_strict_subset
;
static
constexpr
bool
value
=
std
::
is_same
<
ListA
,
ListB
>::
value
||
std
::
is_same
<
template
<
class
...
Ts
,
class
List
>
type_list
<
std
::
integral_constant
<
bool
,
true
>>
,
struct
tl_is_strict_subset
<
type_list
<
Ts
...
>
,
List
>
{
typename
tl_distinct
<
static
constexpr
bool
value
=
tlf_no_negative
(
tlf_find
<
List
,
Ts
>
()...);
typename
tl_map
<
ListA
,
tl_is_strict_subset_step
<
ListB
>::
template
inner
>
::
type
>::
type
>::
value
;
};
};
template
<
class
ListA
,
class
ListB
>
template
<
class
...
Ts
,
class
List
>
constexpr
bool
tl_is_strict_subset
<
ListA
,
ListB
>::
value
;
constexpr
bool
tl_is_strict_subset
<
type_list
<
Ts
...
>
,
List
>::
value
;
/// Tests whether ListA contains the same elements as ListB
/// Tests whether ListA contains the same elements as ListB
/// and vice versa. This comparison ignores element positions.
/// and vice versa. This comparison ignores element positions.
...
...
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