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
41dc4ac4
Commit
41dc4ac4
authored
Feb 20, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting actor handles to nullptr
parent
988eba79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
libcaf_core/caf/actor.hpp
libcaf_core/caf/actor.hpp
+5
-0
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+7
-0
No files found.
libcaf_core/caf/actor.hpp
View file @
41dc4ac4
...
@@ -110,6 +110,11 @@ public:
...
@@ -110,6 +110,11 @@ public:
actor
&
operator
=
(
const
scoped_actor
&
x
);
actor
&
operator
=
(
const
scoped_actor
&
x
);
inline
actor
&
operator
=
(
std
::
nullptr_t
)
{
ptr_
.
reset
();
return
*
this
;
}
/// Queries whether this actor handle is valid.
/// Queries whether this actor handle is valid.
inline
explicit
operator
bool
()
const
{
inline
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
ptr_
);
return
static_cast
<
bool
>
(
ptr_
);
...
...
libcaf_core/caf/typed_actor.hpp
View file @
41dc4ac4
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#ifndef CAF_TYPED_ACTOR_HPP
#ifndef CAF_TYPED_ACTOR_HPP
#define CAF_TYPED_ACTOR_HPP
#define CAF_TYPED_ACTOR_HPP
#include <cstddef>
#include "caf/intrusive_ptr.hpp"
#include "caf/intrusive_ptr.hpp"
#include "caf/make_actor.hpp"
#include "caf/make_actor.hpp"
...
@@ -166,6 +168,11 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
...
@@ -166,6 +168,11 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
return
*
this
;
return
*
this
;
}
}
inline
typed_actor
&
operator
=
(
std
::
nullptr_t
)
{
ptr_
.
reset
();
return
*
this
;
}
explicit
typed_actor
(
const
unsafe_actor_handle_init_t
&
)
CAF_DEPRECATED
{
explicit
typed_actor
(
const
unsafe_actor_handle_init_t
&
)
CAF_DEPRECATED
{
// nop
// nop
}
}
...
...
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