boost-ext / sml2

C++20 State Machine library
146 stars 4 forks source link

Usage for Debugging and Compiler warnings. #12

Open phelter opened 1 week ago

phelter commented 1 week ago

A few further suggestions - don't know if you'd prefer these as separate Issues.

#if not defined(NTEST)
#include <sml2test>
#endif 

This just makes it easier as a developer consuming the API to be able to search for the relevant information inside the #include <sml2> file.

This would at the very least identify errors at the development stage. Could possibly optionally enable those checks or provide an alternative function - eg sm::check_is(state) - or check_set_state(state) or check_process_event - that supports both.

This is by no means a critique on this code -but a critique more on the pain of errors printed out when using meta-programming.

phelter commented 1 week ago

Sorry for the wish list like this, but I thought I'd just give you an idea of usage pain points.

krzysztof-jusiak commented 1 week ago

Thank you very much @phelter, really appreciate actual usage feedback. Need to think a bit more about use cases and how to make generic solution for the library, but that's extremely helpful.