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
e7a1188a
Commit
e7a1188a
authored
Oct 19, 2017
by
Dominik Charousset
Committed by
GitHub
Oct 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #612
Add check for `result` type to `deliver`
parents
265db806
d743e8e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+11
-4
libcaf_core/caf/response_promise.hpp
libcaf_core/caf/response_promise.hpp
+5
-0
No files found.
libcaf_core/caf/detail/type_traits.hpp
View file @
e7a1188a
...
...
@@ -147,7 +147,7 @@ struct is_duration : std::false_type {};
template
<
class
Period
,
class
Rep
>
struct
is_duration
<
std
::
chrono
::
duration
<
Period
,
Rep
>>
:
std
::
true_type
{};
/// Checks wheter `T` is considered a builtin type.
/// Checks whet
h
er `T` is considered a builtin type.
///
/// Builtin types are: (1) all arithmetic types (including time types), (2)
/// string types from the STL, and (3) built-in types such as `actor_ptr`.
...
...
@@ -161,8 +161,8 @@ struct is_builtin {
node_id
>::
value
;
};
/// Che
kcs wheter `T` is primitive, i.e., either an arithmetic
///
type or
convertible to one of STL's string types.
/// Che
cks whether `T` is primitive, i.e., either an arithmetic type or
/// convertible to one of STL's string types.
template
<
class
T
>
struct
is_primitive
{
static
constexpr
bool
value
=
std
::
is_arithmetic
<
T
>::
value
...
...
@@ -172,7 +172,7 @@ struct is_primitive {
||
std
::
is_convertible
<
T
,
atom_value
>::
value
;
};
/// Che
kcs whet
er `T1` is comparable with `T2`.
/// Che
cks wheth
er `T1` is comparable with `T2`.
template
<
class
T1
,
typename
T2
>
class
is_comparable
{
// SFINAE: If you pass a "bool*" as third argument, then
...
...
@@ -607,6 +607,13 @@ constexpr bool can_insert_elements() {
return
can_insert_elements_impl
<
T
>
(
static_cast
<
T
*>
(
nullptr
));
}
/// Checks whether `Tpl` is a specialization of `T` or not.
template
<
template
<
class
...
>
class
Tpl
,
class
T
>
struct
is_specialization
:
std
::
false_type
{
};
template
<
template
<
class
...
>
class
T
,
class
...
Ts
>
struct
is_specialization
<
T
,
T
<
Ts
...
>>
:
std
::
true_type
{
};
}
// namespace detail
}
// namespace caf
...
...
libcaf_core/caf/response_promise.hpp
View file @
e7a1188a
...
...
@@ -57,6 +57,11 @@ public:
response_promise
>::
type
deliver
(
T
&&
x
,
Ts
&&
...
xs
)
{
static_assert
(
!
detail
::
is_specialization
<
result
,
T
>::
value
&&
!
detail
::
disjunction
<
detail
::
is_specialization
<
result
,
Ts
>::
value
...
>::
value
,
"it is not possible to deliver objects of type result<...>"
);
return
deliver_impl
(
make_message
(
std
::
forward
<
T
>
(
x
),
std
::
forward
<
Ts
>
(
xs
)...));
}
...
...
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