220 30466 <5875286B.7040604@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: enum_cast proposal
Date: Tue, 10 Jan 2017 13:31:07 -0500
Lines: 22
Approved: news@gmane.org
Message-ID: <5875286B.7040604@gmail.com>
References: <efdf2357-00a6-408a-8772-12f99135a880@isocpp.org>
 <57258435-5d82-48e7-8ed7-3c38682418fb@isocpp.org>
 <a35d9f20-9e4f-4789-b7e5-5cb08f99e6bd@isocpp.org>
 <58750288.5080004@gmail.com>
 <e85f0d46-f244-42fe-a276-b4e18b3d627f@isocpp.org>
 <CANPtknwzegDLrDFrMoc5U9Z1y52PBZAC2BtQ=iS6Eur2A6f7NQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1484073078 7131 195.159.176.226 (10 Jan 2017 18:31:18 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 10 Jan 2017 18:31:18 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBB3GQ2TBQKGQEDXKSRPA@isocpp.org Tue Jan 10 19:31:14 2017
Return-path: <std-proposals+bncBC37LBFWUIFBB3GQ2TBQKGQEDXKSRPA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f72.google.com ([74.125.82.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBB3GQ2TBQKGQEDXKSRPA@isocpp.org>)
	id 1cR1CM-0000ex-C8
	for gclcip-std-proposals@m.gmane.org; Tue, 10 Jan 2017 19:31:06 +0100
Original-Received: by mail-wm0-f72.google.com with SMTP id l2sf23245492wml.5
        for <gclcip-std-proposals@m.gmane.org>; Tue, 10 Jan 2017 10:31:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=qKH8HktjB+H5GF39VpAV2UNb9K2BuUkuxgAyvJdccAE=;
        b=Cqic5U+RgxQa2RMj8kfKa0O8h6SOumy/EjMWspyQxq2geep/rh/w0M0qWRt/FxkaI0
         DmQedTjINsBlKR2Y838vBSipwDicXp3rfxYVN9vNYw20InymC1j5mcR+5w1jq8eWuUvU
         Ras/jr/GXwMse4z/C5hKndoycj9Dz5hWh7Qfz7r3Ym9fsdWHwwQiIb/ANHaTEVpYRi6m
         Lf0jWYhvPcq6ji0p99uYPoKYhbpHWNhCXXItVOcaHwfSey5di0DvzttCNjMcLh0bdDiC
         rLmnv6wq2Ra7r2AKwr3YeVYY6BgUOqQW90Gx3e3JnHG1G1NwaMzw/dyDd1jJztWjNCNu
         Q1/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=qKH8HktjB+H5GF39VpAV2UNb9K2BuUkuxgAyvJdccAE=;
        b=NUe7O9YZpp8q8CXAHf6Krpvfd68U9jeLQsqPbrvQZUOWY6QdEkH5i1B3HptyiFiaXd
         G3ggI3ArVX5Z5jNunxKGLrNeKjnoO9SM5A9fxBkGe7cYk8tVSeCqybnGm4ePWX8DfkMs
         d9PWU4Q4ZiU0jtpoEhyZtLomxqxxWvGoBYsO/uBy4si3GN6ttnysyy7GHuHaVqVMkPNe
         347USnyq0N/tloibyq3jwhKD9bfe5Sl8orwPpWrIm5LfGL/CQ8RAxZlUKYleMPsTAaLk
         oTL01nwO2PH0sJELkopqqa5pTHGAjYJtArnkHHhRQAzbqLceAPCCzcvpgiNX4XMzYilb
         j7lA==
X-Gm-Message-State: AIkVDXKchmdw8AmCqkLkz+nwnEKhCWJX4VtfaNnq7FX4CUVHt3X2x+FEV+qLgQCNLQNQAw==
X-Received: by 10.99.171.8 with SMTP id p8mr1511697pgf.165.1484073070664;
        Tue, 10 Jan 2017 10:31:10 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.152.2 with SMTP id n2ls3208770itd.7.canary-gmail; Tue, 10
 Jan 2017 10:31:08 -0800 (PST)
X-Received: by 10.107.129.39 with SMTP id c39mr4500211iod.57.1484073068734;
        Tue, 10 Jan 2017 10:31:08 -0800 (PST)
Original-Received: from mail-io0-x241.google.com (mail-io0-x241.google.com. [2607:f8b0:4001:c06::241])
        by mx.google.com with ESMTPS id s27si2705614ioi.18.2017.01.10.10.31.08
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 10 Jan 2017 10:31:08 -0800 (PST)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c06::241 as permitted sender) client-ip=2607:f8b0:4001:c06::241;
Original-Received: by mail-io0-x241.google.com with SMTP id 101so6962205iom.0
        for <std-proposals@isocpp.org>; Tue, 10 Jan 2017 10:31:08 -0800 (PST)
X-Received: by 10.107.173.32 with SMTP id w32mr5225061ioe.136.1484073068368;
        Tue, 10 Jan 2017 10:31:08 -0800 (PST)
Original-Received: from [192.168.1.173] (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id i200sm8576660itb.0.2017.01.10.10.31.07
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 10 Jan 2017 10:31:07 -0800 (PST)
In-Reply-To: <CANPtknwzegDLrDFrMoc5U9Z1y52PBZAC2BtQ=iS6Eur2A6f7NQ@mail.gmail.com>
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c06::241 as permitted
 sender) smtp.mailfrom=mwoehlke.floss@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:30466
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30466>

On 2017-01-10 12:01, Peter Koch Larsen wrote:
> What do you do if you have an enum with some same_valued elements
> (enum E { ea = 0, eb = 0})? My implementation forbids this.

Why?

  E x = ea;
  assert(x == eb); // will succeed

Such a prohibition makes some sense when converting an enum to a string
(or to its ordinal), but there is no problem when converting an int to
an enum (or a string to an enum, for that matter).

-- 
Matthew

-- 
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 email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5875286B.7040604%40gmail.com.

.
