Commit c5e53ab2 authored by neverlord's avatar neverlord

allow passing multiple rules to receive()

parent 267c70c7
...@@ -231,6 +231,21 @@ inline void receive(invoke_rules&& rules) ...@@ -231,6 +231,21 @@ inline void receive(invoke_rules&& rules)
self()->mailbox().dequeue(tmp); self()->mailbox().dequeue(tmp);
} }
template<typename Head, typename... Tail>
void receive(invoke_rules&& rules, Head&& head, Tail&&... tail)
{
invoke_rules tmp(std::move(rules));
receive(tmp.splice(std::forward<Head>(head)),
std::forward<Tail>(tail)...);
}
template<typename Head, typename... Tail>
void receive(invoke_rules& rules, Head&& head, Tail&&... tail)
{
receive(rules.splice(std::forward<Head>(head)),
std::forward<Tail>(tail)...);
}
/** /**
* @brief Tries to dequeue the next message from the mailbox. * @brief Tries to dequeue the next message from the mailbox.
* @return @p true if a messages was dequeued; * @return @p true if a messages was dequeued;
......
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