Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | red floyd<no.spam.here@its.invalid> |
| Newsgroups | comp.std.c++ |
| Subject | Re: New strongly type enum proposal featuring inherited enums |
| Date | Wed, 24 Aug 2011 14:06:50 -0700 (PDT) |
| Organization | albasani.net |
| Lines | 39 |
| Sender | std-cpp-request@vandevoorde.com |
| Approved | stephen.clamage@oracle.com |
| Message-ID | <j2fbbf$776$1@dont-email.me> (permalink) |
| References | <4e49ea26$2@news.x-privat.org> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| X-Trace | news.albasani.net 676BKzXDGY0XdmvlcX/nrNrFxazaXyHp6UMFAI+ZR74oJ3NyP3gc1FSVeELIISBNctdYYtUB9eSM3EnHehAmsQ== |
| NNTP-Posting-Date | Wed, 24 Aug 2011 21:06:59 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="foFECUfNfUdwxXMNCbGA5vSnVy4/dvi67Ze8CEA4Qg0+ARKUEiKIbPuAXVoLB0yLyfZbgW/S1pYTBpPKNOUWgCNGlGtboxd0ZB6mEE4HzBvitmow6XwqKKYEg618V7iZ"; mail-complaints-to="abuse@albasani.net" |
| X-Mailer | Perl5 Mail::Internet v2.05 |
| X-Submission-Address | std-cpp-submit@vandevoorde.com |
| Cancel-Lock | sha1:PTmjeItmo/NA0jdYjgKHqTCyiDU= |
| X-Original-Date | Tue, 16 Aug 2011 20:07:54 -0700 |
| Xref | x330-a1.tempe.blueboxinc.net comp.std.c++:238 |
Show key headers only | View raw
On 8/16/2011 8:28 PM, Phil Bouchard wrote:
>
> Hi,
>
> Is it too late to change the strongly type enum? I have a proposal
> that is much cleaner than what is on its way.
Considering that the Standard just got approved, yeah, I'd guess it's
probably too late. [grin]
> Right now we have:
> enum class Val: unsigned long { E1, E2, E3, E4 };
>
> Comments:
> 1) This design is bad because the ':' sign is reserved for inheritance.
>
> 2) Inheriting from another enum would be quite useful. For example:
> enum class Widget {button, combobox, listview};
> enum class SuperWidget : Widget {iconview}
>
> This way iconview would be equal to 3, not 0.
>
> 3) Redefining the underlying type could be easily done with:
> enum class Val { unsigned long E1, E2, E3, E4 };
>
> This is much more neat and is similar to a declaration of multiple
> instances:
> const unsigned long E1, E2, E3, E4;
An interesting proposal.
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next — Previous in thread | Next in thread | Find similar
New strongly type enum proposal featuring inherited enums Phil Bouchard <philippe@fornux.com> - 2011-08-16 21:28 -0600
Re: New strongly type enum proposal featuring inherited enums Daniel Krügler <daniel.kruegler@googlemail.com> - 2011-08-18 07:54 -0600
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums Daniel Krügler<daniel.kruegler@googlemail.com> - 2011-08-24 17:39 -0700
Re: New strongly type enum proposal featuring inherited enums Bart van Ingen Schenau<bart@ingen.ddns.info> - 2011-08-25 20:51 -0600
Re: New strongly type enum proposal featuring inherited enums =3D?ISO-8859-15?Q?Daniel_Kr=3DFCgler?=3D <daniel.kruegler@googlemail.= com> - 2011-09-07 11:08 -0700
Re: New strongly type enum proposal featuring inherited enums Miles Bader <miles@gnu.org> - 2011-09-08 14:46 -0700
Re: New strongly type enum... why not use "using"? "peter miller"<fuchsia.groan@virgin.net> - 2011-09-12 11:18 -0700
Re: New strongly type enum... why not use "using"? Miles Bader<miles@gnu.org> - 2011-09-13 09:29 -0700
Re: New strongly type enum... why not use "using"? "peter miller"<fuchsia.groan@virgin.net> - 2011-09-15 14:13 -0700
Re: New strongly type enum proposal featuring inherited enums Pete Becker <pete@versatilecoding.com> - 2011-08-18 07:51 -0600
Re: New strongly type enum proposal featuring inherited enums Victor Bazarov<v.bazarov@comcast.invalid> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums Paavo Helde<myfirstname@osa.pri.ee> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums Francis Glassborow<francis.glassborow@btinternet.com> - 2011-08-24 14:52 -0700
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-24 17:39 -0700
Re: New strongly type enum proposal featuring inherited enums Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-08-18 07:53 -0600
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-24 14:52 -0700
Re: New strongly type enum proposal featuring inherited enums Marcel Müller <news.5.maazl@spamgourmet.com> - 2011-08-18 07:52 -0600
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-23 18:20 -0700
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard <philippe@fornux.com> - 2011-08-24 14:52 -0700
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard <philippe@fornux.com> - 2011-08-24 14:52 -0700
Re: New strongly type enum proposal featuring inherited enums Francis Glassborow<francis.glassborow@btinternet.com> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums "Bo Persson"<bop@gmb.dk> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums red floyd<no.spam.here@its.invalid> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums Seungbeom Kim<musiphil@bawi.org> - 2011-08-24 14:06 -0700
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-24 17:39 -0700
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-24 17:40 -0700
Re: New strongly type enum proposal featuring inherited enums Phil Bouchard<philippe@fornux.com> - 2011-08-24 17:40 -0700
csiph-web