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
2b4734b9
Commit
2b4734b9
authored
Aug 06, 2014
by
Dominik Charousset
Committed by
Joseph Noir
Aug 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle `optional<T>` members in `announce()`
parent
0a86b71c
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
87 deletions
+98
-87
libcaf_core/caf/detail/default_uniform_type_info.hpp
libcaf_core/caf/detail/default_uniform_type_info.hpp
+82
-76
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+10
-0
libcaf_core/caf/on.hpp
libcaf_core/caf/on.hpp
+6
-11
No files found.
libcaf_core/caf/detail/default_uniform_type_info.hpp
View file @
2b4734b9
This diff is collapsed.
Click to expand it.
libcaf_core/caf/detail/type_traits.hpp
View file @
2b4734b9
...
...
@@ -479,6 +479,16 @@ struct type_at<0, T0, Ts...> {
using
type
=
T0
;
};
template
<
class
T
>
struct
is_optional
:
std
::
false_type
{
// no members
};
template
<
class
T
>
struct
is_optional
<
optional
<
T
>>
:
std
::
true_type
{
// no members
};
}
// namespace detail
}
// namespace caf
...
...
libcaf_core/caf/on.hpp
View file @
2b4734b9
...
...
@@ -335,19 +335,13 @@ struct to_guard<anything, false> {
template
<
class
T
>
struct
to_guard
<
detail
::
wrapped
<
T
>
,
false
>
:
to_guard
<
anything
>
{};
template
<
class
T
>
struct
is_optional
:
std
::
false_type
{};
template
<
class
T
>
struct
is_optional
<
optional
<
T
>>
:
std
::
true_type
{};
template
<
class
T
>
struct
to_guard
<
T
,
true
>
{
using
ct
=
typename
detail
::
get_callable_trait
<
T
>::
type
;
using
arg_types
=
typename
ct
::
arg_types
;
static_assert
(
detail
::
tl_size
<
arg_types
>::
value
==
1
,
"projection/guard must take exactly one argument"
);
static_assert
(
is_optional
<
typename
ct
::
result_type
>::
value
,
static_assert
(
detail
::
is_optional
<
typename
ct
::
result_type
>::
value
,
"projection/guard must return an optional value"
);
using
value_type
=
typename
std
::
conditional
<
...
...
@@ -355,8 +349,9 @@ struct to_guard<T, true> {
T
*
,
T
>::
type
;
static
value_type
_
(
value_type
val
)
{
return
val
;
}
static
value_type
_
(
value_type
val
)
{
return
val
;
}
};
template
<
class
T
>
...
...
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