220 27944 <1472148645.17129.15.camel@bsdforen.de> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Dominic Fandrey <kamikaze@bsdforen.de>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Make (strongly typed) enums castable to char
 const * const
Date: Thu, 25 Aug 2016 20:10:45 +0200
Lines: 50
Approved: news@gmane.org
Message-ID: <1472148645.17129.15.camel@bsdforen.de>
References: <1472132849.17129.9.camel@bsdforen.de>
	 <e585a9d9-c120-48a9-9ab7-2cbfbc206038@isocpp.org>
	 <CACGiwhG3EF5_+Ytu9k3h8gtYdmLCkkA0e109u2RfmPtForNMcA@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
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1472148727 17152 195.159.176.226 (25 Aug 2016 18:12:07 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 25 Aug 2016 18:12:07 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCPM3OG72QHBB4XJ7S6QKGQEOWDAGDY@isocpp.org Thu Aug 25 20:12:03 2016
Return-path: <std-proposals+bncBCPM3OG72QHBB4XJ7S6QKGQEOWDAGDY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f71.google.com ([209.85.215.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCPM3OG72QHBB4XJ7S6QKGQEOWDAGDY@isocpp.org>)
	id 1bcz8E-00043a-Pu
	for gclcip-std-proposals@m.gmane.org; Thu, 25 Aug 2016 20:12:02 +0200
Original-Received: by mail-lf0-f71.google.com with SMTP id e7sf37353662lfe.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 25 Aug 2016 11:12:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=message-id:subject:from:to:date:in-reply-to:references:mime-version
         :content-transfer-encoding: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=cRVu5FinkR0CAkxMK8/+kQDCumPBU/nUKR9BVoseVmk=;
        b=jHwgV4C/Ss+MnSLLJN/1OWRYZ+A67cEEiWIDWtMI/8cyHB/6T99tBTAtWwoZRfvVEo
         hmn8cJCLggKRwjiikzo1F84hz8KJ1DTm0ehqZJwJJBNEiO+ssEUxJaT5cOfPwvRrvJoI
         MB+P0sY07Jl0tBmvT61UilznVQwT+m7rsQUTT9aUAr3xlOYgPWiIntTZyhjdt6lM9sBt
         m1JdHNXwqKniprtiHJfE3ey0wCGK+Vsc0h9hDowuZNgqbQj+jbAMc/U2ymw8YqCpB7nM
         FbK6vcI0DzWbQ8oRugy4bYS+jZm2M+8Ltnh7Aqbblz8jhOzVPDt8kAR5ufZwK+cypQEI
         Lsmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to
         :references:mime-version:content-transfer-encoding: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=cRVu5FinkR0CAkxMK8/+kQDCumPBU/nUKR9BVoseVmk=;
        b=ByIh3yR/WNWRhMui1INt7Akk/KVfrmFJGEeq9TM+8uB6n/BKgDheaqGy/Mpg7gerbX
         b1FKgBYzNAtJPHPX/piIUj56Cc9VQ7qgkqsBq5sxTAX4MLw3avjmz7enNcO8NR7RzZZJ
         aTtmDvqKCp3rwvMpgq33y182+sD4Yp4Se5WrJSme6PChy+QF4AnNXGU6mFUll91BIi3J
         zLXogzu71Cef/F3UVOUV0swHCG4qBHDyl+NCRsXpNq8t7wjxTaogHZCfw00rgjFDqDrV
         Ih8JtgYz8E5udUs0mV0qOxSkbLJevCjTbMVJfovElQVJURhgA52CzjD1zyq3TzCFScTk
         ODY 
X-Gm-Message-State: AEkoouvxh3emqjqavCNT1chVX0tOSPWnAu6ax8+P5hZB70QQAcWm+mBhj9FusMvnCgLs8g==
X-Received: by 10.194.169.41 with SMTP id ab9mr1491682wjc.6.1472148723682;
        Thu, 25 Aug 2016 11:12:03 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.37.71 with SMTP id l68ls577503wml.14.gmail; Thu, 25 Aug
 2016 11:12:02 -0700 (PDT)
X-Received: by 10.194.185.202 with SMTP id fe10mr8719759wjc.93.1472148722403;
        Thu, 25 Aug 2016 11:12:02 -0700 (PDT)
Original-Received: from bsdforen.de (bsdforen.de. [82.193.243.81])
        by mx.google.com with ESMTP id b75si32973761wma.30.2016.08.25.11.12.02
        for <std-proposals@isocpp.org>;
        Thu, 25 Aug 2016 11:12:02 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of kamikaze@bsdforen.de designates 82.193.243.81 as permitted sender) client-ip=82.193.243.81;
Original-Received: from [192.168.0.16] (HSI-KBW-46-223-128-55.hsi.kabel-badenwuerttemberg.de [46.223.128.55])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by bsdforen.de (Postfix) with ESMTPSA id C4F7A398232
	for <std-proposals@isocpp.org>; Thu, 25 Aug 2016 20:12:01 +0200 (CEST)
In-Reply-To: <CACGiwhG3EF5_+Ytu9k3h8gtYdmLCkkA0e109u2RfmPtForNMcA@mail.gmail.com>
X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port
X-Original-Sender: kamikaze@bsdforen.de
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 best guess record for domain of kamikaze@bsdforen.de designates 82.193.243.81
 as permitted sender) smtp.mailfrom=kamikaze@bsdforen.de
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:27944
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27944>

On Thu, 2016-08-25 at 16:55 +0100, D. B. wrote:
> On Thu, Aug 25, 2016 at 4:17 PM, Derek Ross <antiquarktv@gmail.com> wrote=
:
>=20
> >=20
> > Note that enums can have duplicate values, which throws a wrench into t=
he
> > reflection works.=C2=A0=C2=A0E.g.:
> >=20
> > enum class FooBar { KEKS =3D 2, DOSE =3D 2 };
> >=20
> > What will the result be for:
> >=20
> > FooBar fb =3D FooBar::KEKS;
> > cout << static_cast<char const*>(fb) ;
> >=20
> that only "throws a wrench into the reflection works" as proposed by the
> OP, by no means generally. the WG proposal linked (A) would not support
> this because it is static and (B) has presumably already accounted for su=
ch
> possibilities and effortlessly gets around them with compile-time
> wizardry... again, *presumably.*
>=20

It's not really useful for what I'm doing if it's not runtime capable.

For multiple mentions I'd just leave it implementation defined or
establish a simple first definition rule.

I am assuming that in most cases overlapping definitions are aliases:

=C2=A0 =C2=A0 enum class Flags { NONE =3D 0, COMPATIBLE =3D 1, COMPAT =3D 1=
, EXPERIMENTAL =3D 2 };

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/1472148645.17129.15.camel%40bsdforen.de.

.
