user694989
user694989

Reputation: 75

boost::sml process_event result

Attempting to throw exception from guard / action leads to abort. defining noexcept as nothing before including msl.hpp helps. What is normal way for getting result of call void process_event(event) (i mean handled/unhandled)?

PS: gcc 7.2

Upvotes: 0

Views: 443

Answers (1)

Takatoshi Kondo
Takatoshi Kondo

Reputation: 3550

According to the document https://boost-experimental.github.io/sml/user_guide.html , if process_event() handled the event then returns true, otherwise returns false.

template<class T> requires configurable<T>
class sm {
public:
    ...
    template<class TEvent> // no requirements
    bool process_event(const TEvent&)

However, the return type of process_event() was void in the actual implementation.

So I sent the PR to fix it https://github.com/boost-experimental/sml/pull/303. And it has been merged.

If you update sml to the current master, then you can know the event is handled/unhandled via the return value.

Upvotes: 2

Related Questions