-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #25: Fix ambiguities with overloaded std::forward definitions.
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ test_player | |
test_recursive | ||
test_row | ||
test_scoped | ||
test_shared | ||
test_traits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <cassert> | ||
#include <memory> | ||
|
||
#include "fsm.h" | ||
|
||
class state_machine: public fsmlite::fsm<state_machine> { | ||
friend class fsm; // base class needs access to transition_table | ||
public: | ||
enum states { Init, Exit }; | ||
|
||
using event = std::shared_ptr<int>; | ||
|
||
void action(const event&) { } | ||
|
||
private: | ||
using m = state_machine; | ||
|
||
using transition_table = table< | ||
// Row-Type Start Event Target Action | ||
// -----------+-----+------+------+----------+- | ||
mem_fn_row< Init, event, Exit, &m::action > | ||
// -----------+-----+------+------+----------+- | ||
>; | ||
}; | ||
|
||
int main() | ||
{ | ||
state_machine m; | ||
assert(m.current_state() == state_machine::Init); | ||
m.process_event(state_machine::event()); | ||
assert(m.current_state() == state_machine::Exit); | ||
return 0; | ||
} |