Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!bbn.com!lpringle From: lpringle@bbn.com (Lewis G. Pringle) Newsgroups: comp.lang.c++ Subject: Re: stronger type checking of enums Message-ID: <36748@bbn.COM> Date: 3 Mar 89 19:19:15 GMT References: <25740@cornell.UUCP> Sender: news@bbn.COM Reply-To: lpringle@labs-n.bbn.com (Lewis G. Pringle) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 28 In article <25740@cornell.UUCP> deb@cs.cornell.edu (David Baraff) writes: >I'd like to make a case for stronger type checking of enum's. I agree that this would be very nice. But it does introduce some questions. Array indexing. One would probably also want to be able to declare: enum Color {r,g,b}; int a[Color]; Would you also add and Ord () function? If you can do these things, then why not also allow subranges? How about integer subranges? (Hmm... Begins to sould like Pascal?). I like the suggestion, but you can see how one might get carried away adding 'features' to the language. Lewis. "OS/2: half an operating system for half a computer." In Real Life: Lewis Gordon Pringle Jr. Electronic Mail: lpringle@labs-n.bbn.com Phone: (617) 873-4433