Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> and you can't probably use variant either, since using variant would introduce yet another possible state (e.g. if an exception gets thrown..).

Variants are excellent for a state machine. valueless_by_exception is pretty much irrelevant if your states' relevant constructors and assignments are nothrow.



C++ variants are horrible for state machines, since they are not affine types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: