Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!utoday!comeau From: comeau@utoday.UUCP (Greg Comeau) Newsgroups: comp.lang.c++ Subject: Re: enums declared in class scope Message-ID: <1140@utoday.UUCP> Date: 9 Jan 90 18:34:30 GMT References: <10210@saturn.ucsc.edu> Reply-To: comeau@.UUCP (Greg Comeau) Organization: UNIX Today!, Manhasset, NY Lines: 24 In article <10210@saturn.ucsc.edu> daniel@saturn.ucsc.edu (Daniel Edelson) writes: >It says in section 3.2 of the c++ 2.0 reference that >the name of an enumeration type declared in class scope >belongs to the enclosing scope. What about the names of >the enumerators, what scope do they belong to? 2.0 says that enumerations do not have class scope (they are not members). Enumerators do have class scope though (which should begin immediately after it is scanned). This is not a problem per se since like members, you only need to qualify the enumerator with the class it was defined in (implying say that the enumerators need to be in a 'public' section for an outside variable to use it). >Cfront 2.0 and G++ says the enumerators have class scope, >while Oregon C++ says the enumerators have the same scope >as the enumeration type. Without seeing an example, I'd have to say that Oregon was wrong and isn't even working like a C compiler. -- Greg, Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418 Also, mag writer for UNIX Today! (SysAdm columnist), Microsoft Systems Journal (C programming), + others. Also, BIX c.language & c.plus.plus conf. moderator. Here:attmail!csanta!greg / BIX:comeau / CIS:72331, 3421 / voice:718-849-2355