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
5685e079
Commit
5685e079
authored
Sep 04, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added `tl_is_distinct` and `tl_is_strict_subset`
parent
a0059d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
cppa/util/type_list.hpp
cppa/util/type_list.hpp
+40
-0
No files found.
cppa/util/type_list.hpp
View file @
5685e079
...
@@ -833,6 +833,17 @@ struct tl_distinct<type_list<T0, Ts...> > {
...
@@ -833,6 +833,17 @@ struct tl_distinct<type_list<T0, Ts...> > {
type
;
type
;
};
};
// bool is_distinct
/**
* @brief Tests whether a list is distinct.
*/
template
<
class
L
>
struct
tl_is_distinct
{
static
constexpr
bool
value
=
tl_size
<
L
>::
value
==
tl_size
<
typename
tl_distinct
<
L
>::
type
>::
value
;
};
// list resize(list, size, fill_type)
// list resize(list, size, fill_type)
template
<
class
List
,
bool
OldSizeLessNewSize
,
template
<
class
List
,
bool
OldSizeLessNewSize
,
...
@@ -998,9 +1009,38 @@ struct tl_apply<type_list<Ts...>, VarArgTemplate> {
...
@@ -998,9 +1009,38 @@ struct tl_apply<type_list<Ts...>, VarArgTemplate> {
typedef
VarArgTemplate
<
Ts
...
>
type
;
typedef
VarArgTemplate
<
Ts
...
>
type
;
};
};
// bool is_strict_subset(list,list)
template
<
class
ListB
>
struct
tl_is_strict_subset_step
{
template
<
typename
T
>
struct
inner
{
typedef
std
::
integral_constant
<
bool
,
tl_find
<
ListB
,
T
>::
value
!=
-
1
>
type
;
};
};
/**
* @brief Tests whether ListA ist a strict subset of ListB (or equal).
*/
template
<
class
ListA
,
class
ListB
>
struct
tl_is_strict_subset
{
static
constexpr
bool
value
=
std
::
is_same
<
ListA
,
ListB
>::
value
||
std
::
is_same
<
type_list
<
std
::
integral_constant
<
bool
,
true
>>
,
typename
tl_distinct
<
typename
tl_map
<
ListA
,
tl_is_strict_subset_step
<
ListB
>::
template
inner
>
::
type
>::
type
>::
value
;
};
/**
/**
* @}
* @}
*/
*/
}
}
// namespace cppa::util
}
}
// namespace cppa::util
namespace
cppa
{
namespace
cppa
{
...
...
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