Path: utzoo!mnetor!tmsoft!torsqnt!geac!alias!barney!rae From: rae@gpu.utcs.toronto.edu (Reid Ellis) Newsgroups: comp.lang.c++ Subject: Re: enums and function/method return values Message-ID: Date: 2 Feb 91 20:40:48 GMT References: <48742@apple.Apple.COM> Sender: Reid Ellis Reply-To: Reid Ellis Organization: Alias Research, Inc. Toronto ON Canada Lines: 22 Kent Sandvik writes: >I'm not sure that this is syntactically OK, but I would like to >achieve better function return value scoping using enums. Ex: > >class TFoo { >public: > TFoo(){}; > virtual eFoobar GetStatus(void){ return fStatus;}; > enum eFoobar {OK, NOK, MAYBE}; >private: > eFoobar fStatus; >}; The problem is that you are using the type 'eFoobar' before it is defined. Simply move the "enum eFoobar {..};" line to the top of the class and everything should be okay. Reid -- Reid Ellis 176 Brookbanks Drive, Toronto ON, M3A 2T5 Canada rae@gpu.utcs.toronto.edu || rae%alias@csri.toronto.edu CDA0610@applelink.apple.com || +1 416 446 1644