TITLE: Another take on extendable enums RESPONSE: (Fergus Henderson) fjh@munta.cs.mu.oz.au [ I added the missing static keywords in brackets below. -adc ] A simple and expandable but not fully type-safe method: class Base { public: typedef int Enum; protected: static Enum new_enum() { return next_enum++; } private: static Enum next_enum; // ... }; class Derived_A : public Base { public: [static] Enum a1, a2; }; class Derived_B : public Base { public: [static] Enum b1, b2; }; Base::Enum Derived_A::a1 = Base::new_enum(); Base::Enum Derived_A::a2 = Base::new_enum(); Base::Enum Derived_B::b1 = Base::new_enum(); Base::Enum Derived_B::b2 = Base::new_enum(); You can make this "type-safe" by making Base::Enum a class rather than a typedef, but I'm not sure that it's worth the effort.