{"by":"zigrazor","descendants":36,"id":44487221,"kids":[44487283,44527267,44525188,44523973,44523122],"score":48,"text":"Hi HN!<p>I&#x27;ve built [CXXStateTree](<a href=\"https:&#x2F;&#x2F;github.com&#x2F;ZigRazor&#x2F;CXXStateTree\">https:&#x2F;&#x2F;github.com&#x2F;ZigRazor&#x2F;CXXStateTree</a>), a modern C++ header-only library to create hierarchical state machines with clean, intuitive APIs.<p>It supports:\n- Deeply nested states\n- Entry&#x2F;exit handlers\n- State transitions with guards and actions\n- Asynchronous transitions with `co_await` (C++20 coroutines)\n- Optional runtime type identification for flexibility<p>It&#x27;s ideal for complex control logic, embedded systems, games, robotics, and anywhere you&#x27;d use a finite state machine.<p>I’d love feedback, use cases, or contributions from the community!<p>Repo: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;ZigRazor&#x2F;CXXStateTree\">https:&#x2F;&#x2F;github.com&#x2F;ZigRazor&#x2F;CXXStateTree</a>","time":1751868406,"title":"Show HN: CXXStateTree – A modern C++ library for hierarchical state machines","type":"story","url":"https://github.com/ZigRazor/CXXStateTree"}