Story

Show HN: CXXStateTree – A modern C++ library for hierarchical state machines

zigrazor Monday, July 07, 2025

Hi HN!

I've built [CXXStateTree](https://github.com/ZigRazor/CXXStateTree), a modern C++ header-only library to create hierarchical state machines with clean, intuitive APIs.

It supports: - Deeply nested states - Entry/exit handlers - State transitions with guards and actions - Asynchronous transitions with `co_await` (C++20 coroutines) - Optional runtime type identification for flexibility

It's ideal for complex control logic, embedded systems, games, robotics, and anywhere you'd use a finite state machine.

I’d love feedback, use cases, or contributions from the community!

Repo: https://github.com/ZigRazor/CXXStateTree

Summary
CXXStateTee is a lightweight, header-only, dependency-free, and cross-platform state management library for C++. It provides a simple and intuitive API for managing the state of an application, enabling developers to build scalable and testable software.
48 36
Summary
github.com
Visit article Read on Hacker News Comments 36