Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!mips!apple!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!mucs!jk From: jk@cs.man.ac.uk (John Kewley ICL) Newsgroups: comp.lang.c++ Subject: Re: Private Enumerations? Message-ID: <1683@m1.cs.man.ac.uk> Date: 7 Sep 90 15:02:54 GMT References: <15414@reed.UUCP> Sender: news@cs.man.ac.uk Reply-To: jk@cs.man.ac.uk (John Kewley ICL) Organization: Department of Computer Science, University of Manchester UK Lines: 56 The following is not particularly useful, does not involve private enumerations, yet could be of some interest: // Boolean.hxx #ifndef BOOLEAN_H #define BOOLEAN_H class Boolean { public: Boolean(); Boolean(int n); private: int value; }; extern const Boolean true; extern const Boolean false; #endif /* BOOLEAN_H */ --------------------------------------------- // Boolean.cxx #include "Boolean.hxx" #define FALSE 0 #define TRUE 1 const Boolean true= FALSE; const Boolean false= TRUE; Boolean::Boolean() { value= FALSE; } Boolean::Boolean(int n) { value= (!n)?FALSE:TRUE; } --------------------------------------------- // use.cxx #include "Boolean.hxx" main() { Boolean bool; int foo; bool = true; foo = true; }; -- J.K. John M. Kewley, ICL, Wenlock Way, West Gorton, Manchester. M12 5DR Tel: (+44) 61 223 1301 X2138 Email: jk@r6.cs.man.ac.uk / jk@nw.stl.stc.co.uk