Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!utoday!comeau From: comeau@utoday.UUCP (Greg Comeau) Newsgroups: comp.lang.c++ Subject: Re: const enums -- Lawyers opinions?? Keywords: const, enum Message-ID: <1146@utoday.UUCP> Date: 11 Jan 90 17:12:38 GMT References: <963@rna.UUCP> <10197@microsoft.UUCP> <9925@ardent.UUCP> <10215@microsoft.UUCP> Reply-To: comeau@.UUCP (Greg Comeau) Organization: UNIX Today!, Manhasset, NY Lines: 18 In article <10215@microsoft.UUCP> jimad@microsoft.UUCP (JAMES ADCOCK) writes: >I would claim that if one creates an enum for the days >of the week and then store the integer 10000 in an instance of that >enum, then you've made a programming mistake -- even if it is permissable >according to the language definition. There are a lot of areas in C++ >like that -- where the language for historical or pragmatic reasons allows >programmers to do things that are generally very bad programming practice. At least the 2.0 spec of C++ is in accordance with your train of though and therefore such an assignment is prohibited. ANSI C does not mention anything about this as far as I can detect (I could be wrong though). -- Greg, Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418 Producers of CC C++, SysAdm columnist for UNIX Today!, Microsoft Systems Journal (C programming), + others. Also, BIX c.language & c.plus.plus conf. moderator. Here:attmail!csanta!greg / BIX:comeau / CIS:72331, 3421 / voice:718-849-2355