Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!stiatl!srchtec!johnb From: johnb@srchtec.UUCP (John Baldwin) Newsgroups: comp.lang.c++ Subject: Re: Private Enumerations? Message-ID: <197@srchtec.UUCP> Date: 10 Sep 90 21:55:46 GMT References: <15414@reed.UUCP> <1683@m1.cs.man.ac.uk> Organization: search technology, inc. Lines: 28 In article <1683@m1.cs.man.ac.uk> jk@cs.man.ac.uk (John Kewley ICL) writes: > >class Boolean >{ >public: > Boolean(); > Boolean(int n); > >private: > int value; >}; Okay, now add... Boolean& Boolean::operator=(int rhv) // rhv == right-hand value { value = rhv ? TRUE : FALSE; } Now you can't even manage to assign a value other than TRUE or FALSE to the class instance. With a little more work on top of this, its a true multipurpose boolean. -- John T. Baldwin | johnb%srchtec.uucp@mathcs.emory.edu Search Technology, Inc. | | "... I had an infinite loop, My opinions; not my employers'. | but it was only for a little while..."