Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!apple.com!ksand From: ksand@apple.com (Kent Sandvik) Newsgroups: comp.lang.c++ Subject: enums and function/method return values Message-ID: <48742@apple.Apple.COM> Date: 1 Feb 91 07:07:11 GMT Sender: ksand@Apple.COM Organization: Apple Computer Inc, Cupertino, CA Lines: 22 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; // .... }; I'm using Mac MPW 1.0 C++ (AT&T 2.0 derivate). I also tried with typecasting, but the compiler did not like this either. Anyway it complains about eFoobar not being a type name. Are there any tricks to achieve this, am I lost in the Syntax Sugarland of C++, or would this be another cute feature that could kill Ada? Regards, Kent Sandvik