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


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

Re: plz xplain behavior of const_cast

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 2012-01-06 06:33 +0000
Message-ID <87mxa1z6eg.fsf@gmail.com> (permalink)

Show all headers | 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