220 2817 <CAOHCbivS8DgS3AO1TY0YbRssuSdChbb_9EsP0cec6WYCnS6x_w@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Tony V E <tvaneerd@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: minimal enum class improvements
Date: Tue, 12 Feb 2013 15:15:14 -0500
Lines: 61
Approved: news@gmane.org
Message-ID: <CAOHCbivS8DgS3AO1TY0YbRssuSdChbb_9EsP0cec6WYCnS6x_w@mail.gmail.com>
References: <c15b7b1c-6d6f-4472-8a43-b2fb374b92a1@isocpp.org>
	<511AA1A2.2080409@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1360700122 28903 80.91.229.3 (12 Feb 2013 20:15:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 12 Feb 2013 20:15:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQINHRPKRACRUBF3TWZ5W@isocpp.org Tue Feb 12 21:15:43 2013
Return-path: <std-proposals+bncBCUZ5QWKNQINHRPKRACRUBF3TWZ5W@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ea0-f200.google.com ([209.85.215.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQINHRPKRACRUBF3TWZ5W@isocpp.org>)
	id 1U5MGO-00049a-0a
	for gclcip-std-proposals@m.gmane.org; Tue, 12 Feb 2013 21:15:36 +0100
Original-Received: by mail-ea0-f200.google.com with SMTP id d14sf521832eaa.7
        for <gclcip-std-proposals@m.gmane.org>; Tue, 12 Feb 2013 12:15:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :mime-version:x-received:in-reply-to:references:date:message-id
         :subject:from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type:content-transfer-encoding;
        bh=oRcifj1Co1GnXQ1o/KdSfDWirv4+P6nrUZ3zmR+AmT4=;
        b=AmOqaswfxz4wRQkAu8wmAaOxgFi2U907H6ZFRmwaDfqup1X+34Q6GWmowDT6c+BU+x
         VMt9mdaC2A8NO29/wqNGrrkDV3Sa8FNwvHbcD3gpS76CfurjHhg0VyObZ8y4OIYS4bnd
         ZTo2dEWH4PEX/cXzhh8SFXk9/NLp2+9qS5Ae7dVQcKqCYG0JHbOd6xihxGBHeFRsL4c+
         8karTbxJAtGkM+56WOy+xMEMUkephJd5OC0VwsZ0Y2/66gc6tKLjDBNnK5T0tsPJRSHL
         72/Aey8eiggd30po4AP9Oxt 
X-Received: by 10.112.37.230 with SMTP id b6mr2120258lbk.13.1360700116264;
        Tue, 12 Feb 2013 12:15:16 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.108.110 with SMTP id hj14ls17696lab.64.gmail; Tue, 12 Feb
 2013 12:15:15 -0800 (PST)
X-Received: by 10.152.110.6 with SMTP id hw6mr6132071lab.43.1360700115239;
        Tue, 12 Feb 2013 12:15:15 -0800 (PST)
X-Received: by 10.152.110.6 with SMTP id hw6mr6132068lab.43.1360700115222;
        Tue, 12 Feb 2013 12:15:15 -0800 (PST)
Original-Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180])
        by mx.google.com with ESMTPS id w7si19136497lba.168.2013.02.12.12.15.15
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 12 Feb 2013 12:15:15 -0800 (PST)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180;
Original-Received: by mail-lb0-f180.google.com with SMTP id q12so413171lbc.11
        for <std-proposals@isocpp.org>; Tue, 12 Feb 2013 12:15:15 -0800 (PST)
X-Received: by 10.112.36.165 with SMTP id r5mr7816452lbj.112.1360700115004;
 Tue, 12 Feb 2013 12:15:15 -0800 (PST)
Original-Received: by 10.112.14.75 with HTTP; Tue, 12 Feb 2013 12:15:14 -0800 (PST)
In-Reply-To: <511AA1A2.2080409@wanadoo.fr>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of tvaneerd@gmail.com designates 209.85.217.180 as permitted sender)
 smtp.mail=tvaneerd@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:2817
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2817>

On Tue, Feb 12, 2013 at 3:10 PM, Vicente J. Botet Escriba
<vicente.botet@wanadoo.fr> wrote:
> Le 11/02/13 14:55, ricardofabianodeandrade@gmail.com a =E9crit :
>
> Hi all,
>
>
>
> Request for change:
>
> Inclusion of the following features in the C++ language support for enum:
>
> Obtain the number of enumerators of a given enum type.
> Obtain the value of an enumerator of a given enumerator's index (or order=
,
> or position) and its enum type.
>
>
> I would add to the minimal set of features this
>       * obtain the position relative of an enumeration value in the enum
> type.
>
> This requires of course that all the enumerations have a distinct value. =
The
> compiler could not provide these meta-functions if the enum doesn't satis=
fy
> this condition.
> In addition, the allowed values of an 'ordinal' enumeration type should
> contain only the enumerations because otherwise the pos function could no=
t
> be defined. This is a breaking change or require adding a specific syntax
> for 'ordinal' enumeration. Maybe using a new ordinal keyword instead of e=
num
> could be an option
>
> ordinal class AnEnum : int { a =3D -1, b =3D 1000, c =3D 0 };
>

I happen to have code using the word 'ordinal', so I think I would prefer:

enum ordinal AnEnum : int { a =3D -1, b =3D 1000, c =3D 0 };


Also, how about some real world scenarios/code that would make good
use of these features?  ie prove they are worth it.

Tony

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.



.
