Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!rna!kc From: kc@rna.UUCP (Kaare Christian) Newsgroups: comp.lang.c++ Subject: For Lawyers, const (not really enums) Keywords: const, enum, zortech, c++ Message-ID: <969@rna.UUCP> Date: 10 Jan 90 19:07:07 GMT Organization: Rockefeller University - Neurobiology Lines: 36 In my previous querry, I didn't intend to reignite the enum controversies from the past. In hindsight, I have confused those who might help me to answer my question by building and initializing enum constants using the OR operator. Sorry. (Although that is an issue, it's a bit off my track.) My real problem has to do with const, and how it seems to work differently when applied to enum vs when applied to something fundamental, like int. Because of this, I am almost unable to use const enum types, and that seems a shame, because it makes me either return to #define, or actually store things in variables that needn't take up a storage location. Anyway, consider the following more focused example program: enum EEE { val1 }; // int column enum column int i = 0; EEE e = val1; const int j = 0; const EEE f = val1; const int k = i; const EEE g = e; int l = j; EEE h = f; (No, I don't program in the above style. Its just a demo.) Zortech gives syntax errors (not warnings) for all but the first EEE declaration. In each case the problem is mixing a with an . None of the int declarations are flagged. And, there are other places where ztc doesn't let you mix a const enum with a plain enum, like in passing things to functions. I've become convinced that const enums in ztc are not quite right. Comments, anyone? Kaare Christian kc@rna.rockefeller.edu