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
1beb851e
Commit
1beb851e
authored
Feb 21, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formatting and remove obsolete code
parent
212a9e77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
28 deletions
+3
-28
examples/custom_type/custom_types_2.cpp
examples/custom_type/custom_types_2.cpp
+3
-1
examples/custom_type/custom_types_3.cpp
examples/custom_type/custom_types_3.cpp
+0
-27
No files found.
examples/custom_type/custom_types_2.cpp
View file @
1beb851e
...
...
@@ -57,7 +57,9 @@ private:
};
behavior
testee
(
event_based_actor
*
self
)
{
return
{[
=
](
const
foo
&
x
)
{
aout
(
self
)
<<
deep_to_string
(
x
)
<<
endl
;
}};
return
{
[
=
](
const
foo
&
x
)
{
aout
(
self
)
<<
deep_to_string
(
x
)
<<
endl
;
},
};
}
void
caf_main
(
actor_system
&
sys
)
{
...
...
examples/custom_type/custom_types_3.cpp
View file @
1beb851e
...
...
@@ -54,33 +54,6 @@ private:
};
// --(rst-foo-end)--
// A lightweight scope guard implementation.
template
<
class
Fun
>
class
scope_guard
{
public:
scope_guard
(
Fun
f
)
:
fun_
(
std
::
move
(
f
)),
enabled_
(
true
)
{
}
scope_guard
(
scope_guard
&&
x
)
:
fun_
(
std
::
move
(
x
.
fun_
)),
enabled_
(
x
.
enabled_
)
{
x
.
enabled_
=
false
;
}
~
scope_guard
()
{
if
(
enabled_
)
fun_
();
}
private:
Fun
fun_
;
bool
enabled_
;
};
// Creates a guard that executes `f` as soon as it goes out of scope.
template
<
class
Fun
>
scope_guard
<
Fun
>
make_scope_guard
(
Fun
f
)
{
return
{
std
::
move
(
f
)};
}
// --(rst-inspect-begin)--
template
<
class
Inspector
>
bool
inspect
(
Inspector
&
f
,
foo
&
x
)
{
...
...
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