make body fix

master
Daniel Kolesa 2018-04-26 00:42:48 +02:00
parent 3506facc61
commit e0986692ef
1 changed files with 7 additions and 3 deletions

View File

@ -82,9 +82,13 @@ struct make_rule {
}
make_rule &body(std::function<void()> act_f) noexcept {
p_body = [act_f = std::move(act_f)](auto, auto) {
act_f();
};
if (act_f) {
p_body = [act_f = std::move(act_f)](auto, auto) {
act_f();
};
} else {
p_body = body_func{};
}
return *this;
}