Commit 1beb851e authored by Dominik Charousset's avatar Dominik Charousset

Fix formatting and remove obsolete code

parent 212a9e77
......@@ -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) {
......
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment