How to define strong ID types in C ++ 11? Is it possible to execute an alias of integer types, but receive warnings from the compiler when mixing types?
eg:
using monsterID = int; using weaponID = int; auto dragon = monsterID{1}; auto sword = weaponID{1}; dragon = sword;
source share