On Mon, 23 May 2005 23:25:13 -0700, Mark Mitchell <[EMAIL PROTECTED]> wrote:
> Good point; yes, you would have to pass a pointer. I guess you could > create a singleton representative of each value in the enum, and pass > them around, but I agree that's getting pretty ugly. Of course, the > problem with "unsigned int" is that it is a complete type, and people can > accidentally pass in "7", even if there's no such enumeral. You really > want forward-declared enums, but you haven't got them; it may be you just > lose. :-( You don't have foward-declared enums because you don't know how large they need to be. If what you want is an opaque enum, such that other files treat it as an integer and only certain files know the enumerators, then declare your variables to some typedef of an integer. People could accidentally pass in "7" anyway in C. You either get the opacity or the type checking (when compiled as C++), but not both. Jason