TITLE: Expandable enums? PROBLEM: scottb@satb.cnde.iastate.edu (Scott Bilas) Hello all. I'm wondering about something with enum's. I have a base class that declares an enum type, and I use this in that class and any derived classes as an argument (as a command code). What I'd like to be able to do is expand this enum inside of derived classes...sort of have each derived class add its own little set of allowable commands to the enum type. a) Is this possible, or b) is there a much easier and more straightforward yet still type-safe method of passing codes to functions (that's expandable). Probably b, right? RESPONSE: p j l @graceland.att.com (Paul J. Lucas), AT&T Bell Laboratories No. [ Part a) is not possible. ] [ For part b), ] Not really. I just use ints and don't screw up: struct A { enum { a1, a2, a3, a4, next }; }; struct B : A { enum { b1 = A::next, b2, b3, b4, next }; }; // ... Note: the enums are "typeless" on purpose. [ Another way to look at this problem is to defer some "type checking" to run-time. For example, the base class could define an "int set" and load it with the legal values for the base. Derived classes could add more members to this set. This would allow run-time, instead of compile-time, checking for legal values. -adc ]