Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #13145

Re: plz xplain behavior of const_cast

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 <gwowen@gmail.com>
Newsgroups comp.lang.c++
Subject Re: plz xplain behavior of const_cast
References <99gag79ess5jgiiap1da1ggotvh8sv55is@4ax.com> <je3l5m$12g$1@dont-email.me> <b75672b2-04e7-4002-8655-b27d2b3f497c@o14g2000vbo.googlegroups.com> <je57i1$4af$1@dont-email.me>
Date Fri, 06 Jan 2012 06:33:59 +0000
Message-ID <87mxa1z6eg.fsf@gmail.com> (permalink)
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

Show key headers only | View raw


"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> 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.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

plz xplain behavior of const_cast Heck <heckja_in@ordertostymieharvestersverizon.net> - 2012-01-05 02:01 -0500
  Re: plz xplain behavior of const_cast Christian Gollwitzer <auriocus@gmx.de> - 2012-01-05 08:53 +0100
  Re: plz xplain behavior of const_cast "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2012-01-05 08:57 +0100
    Re: plz xplain behavior of const_cast gwowen <gwowen@gmail.com> - 2012-01-05 04:00 -0800
      Re: plz xplain behavior of const_cast "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2012-01-05 23:17 +0100
        Re: plz xplain behavior of const_cast Ian Collins <ian-news@hotmail.com> - 2012-01-06 11:38 +1300
        Re: plz xplain behavior of const_cast Gareth Owen <gwowen@gmail.com> - 2012-01-06 06:33 +0000
        Re: plz xplain behavior of const_cast Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-01-06 00:46 -0800
          Re: plz xplain behavior of const_cast gwowen <gwowen@gmail.com> - 2012-01-06 03:19 -0800
        Re: plz xplain behavior of const_cast Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-07 06:38 +0000
          Re: plz xplain behavior of const_cast 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-07 03:53 -0800
      Re: plz xplain behavior of const_cast Juha Nieminen <nospam@thanks.invalid> - 2012-01-06 09:14 +0000
  Re: plz xplain behavior of const_cast Goran <goran.pusic@gmail.com> - 2012-01-04 23:55 -0800
  Re: plz xplain behavior of const_cast jt@toerring.de (Jens Thoms Toerring) - 2012-01-05 09:04 +0000
  Re: plz xplain behavior of const_cast Heck <heckja_in@ordertostymieharvestersverizon.net> - 2012-01-05 09:36 -0500

csiph-web