Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Fri, 06 Jan 2012 00:33:58 -0600 From: Gareth Owen Newsgroups: comp.lang.c++ Subject: Re: plz xplain behavior of const_cast References: <99gag79ess5jgiiap1da1ggotvh8sv55is@4ax.com> Date: Fri, 06 Jan 2012 06:33:59 +0000 Message-ID: <87mxa1z6eg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:EZpXNKsbmXOFnL1Kx3o+FpUyYYY= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 27 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-N3oZQTgdmHd1pnUkO33/67jHurd4r56qmKGdWZXlPpcs8Fo7tAZh5qoeJCwnHhfbiis/Nln5ubtQWv2!GMCGuSL3v46KIw3hsFlnIfYoKE1KxLzD14uepx64AgbEAEtFuQDATqoBDL0HRTLWo4K/cw== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1919 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:13145 "Alf P. Steinbach" writes: > That's just bad programmers. > > C has had 'enum' since C89. > > 'enum' works nicely for expressing whatever integer real constants. I didn't say it was right, I said that where it came from. In any case I'd be willing bet #define NUM_OBJ 100 is much more prevalent than enum { num_obj = 100 }; even in C code written in the last five years. Idioms are hard to kill. (I'll admit that I'm among them - type safety concerns means I tend to set compiler switches so that I get warned about int-to-enum comparisons and enum-to-other-enum comparisons, so this technique doesn't even *work* for me) Either way, the convention did not cross from Java to C++, it went entered C++ and Java from the common ancestor, C.