Compiler-enforced semantic types
问题 Say I have a class representing automata, whose states are numbered ( using state_t = unsigned ) and whose transitons are also numbered ( using transition_t = unsigned ). Of course at some point I end up messing some calls because transition_t and state_t are the same type, so the compiler does not enforce the (semantic) type safety. That's easy to workaround by using a small class templated by a tag ( struct transition_tag {}; struct state_tag {}; ), so now transition_t and state_t are