single integer ID with comparison but no automatic conversion. Note that you will want to make a subclass to make the IDs specific for your class. Therefore, use the mDefIntegerID macro.
More...
template<class IntType>
class IntegerID< IntType >
single integer ID with comparison but no automatic conversion. Note that you will want to make a subclass to make the IDs specific for your class. Therefore, use the mDefIntegerID macro.
typedef IntegerID<int> ID;
void dummy( ID id ) { id.setI( 666 ); // fine id = 666; // nope id += 666; // nope (good thing) id.setI( id.getI() + 666 ); // fine (weird, but you wanted it) }
void dummy2() { dummy( ID::get(555) ); // fine dummy( 555 ); // nope }
class X { X(); ID id_; };
X::X() : id_(ID::get(444)) {} // fine X::X() : id_(444) {} // nope X::X() {} // nope