220 27946 <CACGiwhGBkjL_dw+fMx_GgYwZmg6O-gKLTVJVanerYU8AZN-kLA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "D. B." <db0451@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Make (strongly typed) enums castable to char
 const * const
Date: Thu, 25 Aug 2016 19:21:52 +0100
Lines: 105
Approved: news@gmane.org
Message-ID: <CACGiwhGBkjL_dw+fMx_GgYwZmg6O-gKLTVJVanerYU8AZN-kLA@mail.gmail.com>
References: <1472132849.17129.9.camel@bsdforen.de> <e585a9d9-c120-48a9-9ab7-2cbfbc206038@isocpp.org>
 <CACGiwhG3EF5_+Ytu9k3h8gtYdmLCkkA0e109u2RfmPtForNMcA@mail.gmail.com> <1472148645.17129.15.camel@bsdforen.de>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1146a0dcde811f053ae978e2
X-Trace: blaine.gmane.org 1472149325 15221 195.159.176.226 (25 Aug 2016 18:22:05 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 25 Aug 2016 18:22:05 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCWNZ4ECS4GBBQXO7S6QKGQETB2UTIA@isocpp.org Thu Aug 25 20:21:59 2016
Return-path: <std-proposals+bncBCWNZ4ECS4GBBQXO7S6QKGQETB2UTIA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCWNZ4ECS4GBBQXO7S6QKGQETB2UTIA@isocpp.org>)
	id 1bczHm-00036s-3s
	for gclcip-std-proposals@m.gmane.org; Thu, 25 Aug 2016 20:21:54 +0200
Original-Received: by mail-lf0-f70.google.com with SMTP id e7sf37503903lfe.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 25 Aug 2016 11:21:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject: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=JCzieGSAFhp85oyqpXJeIadn8NVNr97njUBdOiTvV1U=;
        b=n12QXTLG40lmyOLDc1zt5xA5dhH1nGfuyyr0uDYZ1kIFGOLaC5NMKTdeRY5gry9q0h
         ig5s5Ru0TZoxYjACaPzJ43Ald9Sfad60m9O/MVKvq2VplWoV9u008CqwhhrXs9Al3F9/
         RXX8i+oPI3z1PZWYjKUHghgiGp8B7ChYXjzrQ3kIx4OJjXwa8LR6QxmGPFruzCS5f6TT
         wi5nv1vXbfjE5Syf4yIhjZTLReB5v6IsjEgV6RLjEuH94epHARF5eT9S8N7MMeXSBThb
         Q6XUY/2eN2BkwFoXSpcHndqnmOQJ4t4aWbU4rs4v2jvGMowCIZVOElYvLySM9hsbJd3T
         EowA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject: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=JCzieGSAFhp85oyqpXJeIadn8NVNr97njUBdOiTvV1U=;
        b=FDoEP6QeAEy8AbqhZm4oQNann02w+bpQ3u51ZQBDzK8yDPOFm0s42tS8HcVYYzIgFx
         zBCn5MLtKoH1Jj5Sm0pAIIq0onli1PcPaoSUDM6hM/3RCk5/Bogl664C7p6HH2+0C4iv
         If7zKTsHF4iipbIn/WT0UH1sp2sKCdyG47syKz1gEXZxvB+vaqQNoqlIhvFbV9tyWoDu
         DNA9hcE+Wc0WPJ/Z7kN8Sta+Ikltpz98Lrijrbtx/f72YiE6DzoF6W00UoKRdl+SEF8B
         Y7kPt34LLCvqM4oCL3veMX2x+eInNC1PEAKNA3XvbK8mFjUSm5b719L47hT9DZypnqh0
         kbUQ==
X-Gm-Message-State: AE9vXwMTf5peBJSLx6qKzPP7zR7XMfuben/MNKc9QGinBk+gJFzKjQ6b5j/T9ClOIA42GA==
X-Received: by 10.25.33.198 with SMTP id h189mr1495369lfh.5.1472149315038;
        Thu, 25 Aug 2016 11:21:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.66.80 with SMTP id p77ls155960wma.26.canary; Thu, 25 Aug
 2016 11:21:53 -0700 (PDT)
X-Received: by 10.194.15.130 with SMTP id x2mr8800110wjc.122.1472149313606;
        Thu, 25 Aug 2016 11:21:53 -0700 (PDT)
Original-Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com. [2a00:1450:400c:c09::231])
        by mx.google.com with ESMTPS id bx5si15036937wjc.22.2016.08.25.11.21.53
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 25 Aug 2016 11:21:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of db0451@gmail.com designates 2a00:1450:400c:c09::231 as permitted sender) client-ip=2a00:1450:400c:c09::231;
Original-Received: by mail-wm0-x231.google.com with SMTP id f65so249178415wmi.0
        for <std-proposals@isocpp.org>; Thu, 25 Aug 2016 11:21:53 -0700 (PDT)
X-Received: by 10.28.111.4 with SMTP id k4mr9833728wmc.94.1472149313186; Thu,
 25 Aug 2016 11:21:53 -0700 (PDT)
Original-Received: by 10.28.15.15 with HTTP; Thu, 25 Aug 2016 11:21:52 -0700 (PDT)
In-Reply-To: <1472148645.17129.15.camel@bsdforen.de>
X-Original-Sender: db0451@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of db0451@gmail.com
 designates 2a00:1450:400c:c09::231 as permitted sender) smtp.mailfrom=db0451@gmail.com;
       dmarc=pass (p=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:27946
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27946>

--001a1146a0dcde811f053ae978e2
Content-Type: text/plain; charset=UTF-8

On Thu, Aug 25, 2016 at 7:10 PM, Dominic Fandrey <kamikaze@bsdforen.de>
wrote:

> 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:
> >
> > >
> > > Note that enums can have duplicate values, which throws a wrench into
> the
> > > reflection works.  E.g.:
> > >
> > > enum class FooBar { KEKS = 2, DOSE = 2 };
> > >
> > > What will the result be for:
> > >
> > > FooBar fb = FooBar::KEKS;
> > > cout << static_cast<char const*>(fb) ;
> > >
> > 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
> such
> > possibilities and effortlessly gets around them with compile-time
> > wizardry... again, *presumably.*
> >
>
> It's not really useful for what I'm doing if it's not runtime capable.
>


Then I am not an 'insider' and might well be wrong... but based on how
static C++ is, I would not expect such a feature to arrive, or really any
other dynamic features, beyond the 'necessary evils' of
dynamic_cast/typeinfo.

-- 
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/CACGiwhGBkjL_dw%2BfMx_GgYwZmg6O-gKLTVJVanerYU8AZN-kLA%40mail.gmail.com.

--001a1146a0dcde811f053ae978e2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
hu, Aug 25, 2016 at 7:10 PM, Dominic Fandrey <span dir=3D"ltr">&lt;<a href=
=3D"mailto:kamikaze@bsdforen.de" target=3D"_blank">kamikaze@bsdforen.de</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=3D"">On Th=
u, 2016-08-25 at 16:55 +0100, D. B. wrote:<br>
&gt; On Thu, Aug 25, 2016 at 4:17 PM, Derek Ross &lt;<a href=3D"mailto:anti=
quarktv@gmail.com">antiquarktv@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; Note that enums can have duplicate values, which throws a wrench =
into the<br>
&gt; &gt; reflection works.=C2=A0=C2=A0E.g.:<br>
&gt; &gt;<br>
&gt; &gt; enum class FooBar { KEKS =3D 2, DOSE =3D 2 };<br>
&gt; &gt;<br>
&gt; &gt; What will the result be for:<br>
&gt; &gt;<br>
&gt; &gt; FooBar fb =3D FooBar::KEKS;<br>
&gt; &gt; cout &lt;&lt; static_cast&lt;char const*&gt;(fb) ;<br>
&gt; &gt;<br>
&gt; that only &quot;throws a wrench into the reflection works&quot; as pro=
posed by the<br>
&gt; OP, by no means generally. the WG proposal linked (A) would not suppor=
t<br>
&gt; this because it is static and (B) has presumably already accounted for=
 such<br>
&gt; possibilities and effortlessly gets around them with compile-time<br>
</span>&gt; wizardry... again, *presumably.*<br>
&gt;<br>
<br>
It&#39;s not really useful for what I&#39;m doing if it&#39;s not runtime c=
apable.<br></blockquote><div><br><br></div><div>Then I am not an &#39;insid=
er&#39; and might well be wrong... but based on how static C++ is, I would =
not expect such a feature to arrive, or really any other dynamic features, =
beyond the &#39;necessary evils&#39; of dynamic_cast/typeinfo.=C2=A0 <br></=
div></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CACGiwhGBkjL_dw%2BfMx_GgYwZmg6O-gKLTV=
JVanerYU8AZN-kLA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhGBkjL_dw=
%2BfMx_GgYwZmg6O-gKLTVJVanerYU8AZN-kLA%40mail.gmail.com</a>.<br />

--001a1146a0dcde811f053ae978e2--

.
