home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: enum problem.
- Message-ID: <1992Aug27.184237.10833@taumet.com>
- Organization: TauMetric Corporation
- References: <3532@unisql.UUCP>
- Date: Thu, 27 Aug 1992 18:42:37 GMT
- Lines: 37
-
- nandraj@unisql.UUCP (Nandraj Arni) writes:
-
-
- > I have this problem. Two versions of GNU's compilers are
- >acting in different ways. Which is correct?
-
-
- >class EnumTest {
- >public:
- > enum varType { Apple, Orange};
- > varType get_fn();
- >}
-
-
- >varType EnumTest::get_fn() { ... }
-
- >EnumTest::varType EnumTest::get_fn() { ... }
-
- > Neither compilers like the other definition.
-
-
- This is an area of language change, and the two compilers implement
- different versions of the language.
-
- It used to be that the name of a type declared in a class was
- exported to the outer scope. Now the type name remains local to the
- scope, and the name must be qualified when used outside that scope.
-
- If you need to use compilers with different rules, you will
- probably have to use some conditional code to keep them both happy.
- This gets rather ugly.
-
- A better solution might be to upgrade the earlier compiler.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-