Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!jvnca!njin!princeton!udel!rochester!rit!tropix!moscom!ur-valhalla!uhura.cc.rochester.edu!sunybcs!rutgers!mailrus!tut.cis.ohio-state.edu!cica!sol.ctr.columbia.edu!ginosko!uunet!odi!benson
From: benson@odi.com (Benson Margulies)
Newsgroups: comp.lang.c++
Subject: Re: assigning int to enum
Message-ID: <389@odi.ODI.COM>
Date: 8 Aug 89 01:17:24 GMT
References: <387@odi.ODI.COM> <9550@alice.UUCP>
Reply-To: benson@odi.com (Benson Margulies)
Organization: Object Design Inc., Burlington, MA
Lines: 20

I was playing radical (the root, that is) when I posted the question
about enums. I am pretty much convinced by the existence of the
convienient conversion operators. I have two trailing thoughts:

1) It sure would be nice to be able to define implicit conversions
involving ints and enums. They could even include runtime checking!

2) You might be amused in how I got into this. For ease of debugging
work I am doing to c++ itself, I defined the type TOK to be a real
live enum of the token types. So my friendly debugger can print
token names instead of numbers. Well, I got about 50 warnings
about assignments of 0 or ints or chars to TOK's! So I was looking
madly for a way to preserve the debugging enhancement and shut up the
warnings other than to fix all of the offending uses of TOK in the entire
cfront source.



-- 
Benson I. Margulies