Path: utzoo!utgpu!jarvis.csri.toronto.edu!ists!yunexus!geac!alias!rae%alias@csri.utoronto.ca From: rae%alias@csri.utoronto.ca (Reid Ellis) Newsgroups: comp.lang.c++ Subject: Re: Define's and Devices. Message-ID: <652@alias.UUCP> Date: 28 Nov 89 23:16:19 GMT References: <478@hades.OZ> Sender: rae@alias.UUCP Reply-To: rae%alias@csri.utoronto.ca (Reid Ellis) Organization: Alias Research -- the cutting edge in JAGGIE technology Lines: 49 ing@hades.OZ (Ian Gold) writes: |would like to do in C++ is something like | | class keys | { | public: | enum keys { ENTER = 0x13 | . | . | . | }; | }; | | class program : keys | { | public: | void program :: function(void) { return keys::ENTER; } | } | |and allow it to be inherited only by the classes that need it. This is one of the first things I tried to do in C++ too, but I did this instead: class keys { public: const ENTER = 0x13; // ... }; class program : keys { public: int function(void) { return ENTER; } // ... } But I was rewarded with a "not yet implemented" error message :-/ I would hope that static const's are now "implemented" with cfront 2.0. Reid [btw, I found your syntax for the "program" class method 'function' a bit cryptic -- hope I didn't misread what you wanted here.] --- Reid Ellis, 264 Broadway Avenue, Toronto ON, M4P 1V9, Canada rae%alias@csri.utoronto.ca +1 416 487 1383