220 28082 <ce4634af-e0ab-251b-d804-8fb721e855f9@wanadoo.fr> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Make (strongly typed) enums castable to char
 const * const
Date: Wed, 31 Aug 2016 22:20:17 +0200
Lines: 184
Approved: news@gmane.org
Message-ID: <ce4634af-e0ab-251b-d804-8fb721e855f9@wanadoo.fr>
References: <878tvfl89r.fsf@gmail.com>
 <CAKiZDp3O2piEZy7Dr4XSPQqO+Zd-rv06aiQVnaCJ=F8d0A83sw@mail.gmail.com>
 <CAPVNwa9R8EQm_py0x4=sneEog39Ksgxp+oVNiqerxLTO2qxH8w@mail.gmail.com>
 <e8e400ef-d60f-448c-9594-15c75e9728e9@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------C3C4909328531A2728497738"
X-Trace: blaine.gmane.org 1472674822 29154 195.159.176.226 (31 Aug 2016 20:20:22 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 31 Aug 2016 20:20:22 +0000 (UTC)
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0)
 Gecko/20100101 Thunderbird/45.2.0
Cc: chochlik@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBB77XTS7AKGQE5WTYLLQ@isocpp.org Wed Aug 31 22:20:17 2016
Return-path: <std-proposals+bncBDH67CONY4PBB77XTS7AKGQE5WTYLLQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f69.google.com ([74.125.82.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDH67CONY4PBB77XTS7AKGQE5WTYLLQ@isocpp.org>)
	id 1bfBzb-00070h-E9
	for gclcip-std-proposals@m.gmane.org; Wed, 31 Aug 2016 22:20:15 +0200
Original-Received: by mail-wm0-f69.google.com with SMTP id u81sf45984791wmu.3
        for <gclcip-std-proposals@m.gmane.org>; Wed, 31 Aug 2016 13:20:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:cc: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=JE9trEFp1UbM8iTEsv6Elt9Aedv4yMKBVZDCzTyj+0o=;
        b=ymuIxCsQiVeSnvDuBYbqwVs/zVxMGe2qqIQJq+4HzFDCTiRcPTRTN+jvTdyspitxuy
         y+y6hW5AItAKTK2o1/34gxckB6QzEFOfhwWSHcOnP3gNdoOFwpxCfvx9v3Ljy5849ayg
         ya9kcAW8WCoQQfrCR+Er8xSr36UfzzbM1o1HDfGGob2UlDklWZVOm/4k9tbX7ykFW1F/
         OQxvDO7VF3zwPYDIJXcHVpTjZyarvGyybK3UWKUBe3UpApoV18rS5TQOMes4utjJxKj/
         lIwRmgkqylDjopF6G1UfyQzQSvgr7ZRK84Adf1GSFQMGr8KaaSm82Bk+szEsoijO+RyU
         wtkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:cc: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=JE9trEFp1UbM8iTEsv6Elt9Aedv4yMKBVZDCzTyj+0o=;
        b=QtR/ZfXVgrZkuGewx6JxyP/teiYK+n2+HA3Km6IjfrE40pwKzKaeCAG5AIZO7LKoE3
         e4DAaXfknhNjnVJFZrIewOIzGTLhDSaoAQXgn1sOuKcK0nnJg1Xv8EkDPNELVIb6LF9Q
         YpFrnmmBb52A2dHbWdQ4XHkVJbKmmOs5Eooa8DqKyCQ5glIiXsguaPmzWOSpW2Ie1/Im
         b5IxLNjx80kl6FzzDVJWCiK/E8GmCFbzEo2tm2kt6khwqqn1dixTkZRB7+GPH2aJsy+O
         K1rwaxXpC9ObrhepzqfCNg1yhTUNVbQXLizp6RyFRQFpQCZWnd33IGXO8bDgilV4s9Hp
         zFCA==
X-Gm-Message-State: AE9vXwNOWp5tTDVOaDbxKg9b9jetv3hoXXlNLdADyZ4OcgBc0AbeKx3SpnuzS96A8JoDiw==
X-Received: by 10.194.121.137 with SMTP id lk9mr1783401wjb.0.1472674816547;
        Wed, 31 Aug 2016 13:20:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.5.75 with SMTP id 72ls298522wmf.15.gmail; Wed, 31 Aug 2016
 13:20:15 -0700 (PDT)
X-Received: by 10.28.61.215 with SMTP id k206mr22393691wma.80.1472674814983;
        Wed, 31 Aug 2016 13:20:14 -0700 (PDT)
Original-Received: from smtp.smtpout.orange.fr (smtp10.smtpout.orange.fr. [80.12.242.132])
        by mx.google.com with ESMTPS id c3si1732025wjv.231.2016.08.31.13.20.14
        for <std-proposals@isocpp.org>
        (version=TLS1 cipher=AES128-SHA bits=128/128);
        Wed, 31 Aug 2016 13:20:14 -0700 (PDT)
Received-SPF: neutral (google.com: 80.12.242.132 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.132;
Original-Received: from pc38.home ([2.13.33.56])
	by mwinf5d33 with ME
	id dwLA1t00h1CfgbE03wLC46; Wed, 31 Aug 2016 22:20:14 +0200
X-ME-Helo: pc38.home
X-ME-Auth: dmljZW50ZS5ib3RldEB3YW5hZG9vLmZy
X-ME-Date: Wed, 31 Aug 2016 22:20:14 +0200
X-ME-IP: 2.13.33.56
In-Reply-To: <e8e400ef-d60f-448c-9594-15c75e9728e9@isocpp.org>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.132 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mailfrom=vicente.botet@wanadoo.fr
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:28082
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28082>

This is a multi-part message in MIME format.
--------------C3C4909328531A2728497738
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 30/08/2016 =C3=A0 13:05, Edward Catmur a =C3=A9crit :
> On Tuesday, 30 August 2016 06:23:04 UTC+1, Matus Chochlik wrote:
>
>     I've added few examples showing simple implementation of
>     enumerator-to-string and string-to-enumerator using both the TMP and
>     constexpr MP libraries to the mirror reflection utilities:
>
>     https://github.com/matus-chochlik/mirror/blob/develop/example/mirror/=
005_enum_to_string.cpp
>     <https://github.com/matus-chochlik/mirror/blob/develop/example/mirror=
/005_enum_to_string.cpp>
>
>     https://github.com/matus-chochlik/mirror/blob/develop/example/mirror/=
006_string_to_enum.cpp
>     <https://github.com/matus-chochlik/mirror/blob/develop/example/mirror=
/006_string_to_enum.cpp>
>
>     https://github.com/matus-chochlik/mirror/blob/develop/example/puddle/=
005_enum_to_string.cpp
>     <https://github.com/matus-chochlik/mirror/blob/develop/example/puddle=
/005_enum_to_string.cpp>
>
>     https://github.com/matus-chochlik/mirror/blob/develop/example/puddle/=
006_string_to_enum.cpp
>     <https://github.com/matus-chochlik/mirror/blob/develop/example/puddle=
/006_string_to_enum.cpp>
>
>
> Is it really necessary to construct the lookup table as a library=20
> container? Wouldn't a switch statement perform better?
>
No, we don't need a map, but I believe that Matus wanted to show a probe=20
of concept.

I don't know how we can generate a switch with the current language. We=20
can do some recursive if and expect that the compiler optimize it.

Vicente

--=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/ce4634af-e0ab-251b-d804-8fb721e855f9%40wanadoo.f=
r.

--------------C3C4909328531A2728497738
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">Le 30/08/2016 =C3=A0 13:05, Edward Catmu=
r a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote
      cite=3D"mid:e8e400ef-d60f-448c-9594-15c75e9728e9@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">On Tuesday, 30 August 2016 06:23:04 UTC+1, Matus
        Chochlik wrote:
        <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
          0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I've
          added few examples showing simple implementation of
          <br>
          enumerator-to-string and string-to-enumerator using both the
          TMP and
          <br>
          constexpr MP libraries to the mirror reflection utilities:
          <br>
          <br>
          <a moz-do-not-send=3D"true"
href=3D"https://github.com/matus-chochlik/mirror/blob/develop/example/mirro=
r/005_enum_to_string.cpp"
            target=3D"_blank" rel=3D"nofollow"
onmousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fg=
ithub.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fmirror%2F0=
05_enum_to_string.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE9DbRX5PSZWtt=
8yz7NNep01JMqVQ';return
            true;"
onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithu=
b.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fmirror%2F005_e=
num_to_string.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE9DbRX5PSZWtt8yz7=
NNep01JMqVQ';return
            true;">https://github.com/matus-<wbr>chochlik/mirror/blob/devel=
op/<wbr>example/mirror/005_enum_to_<wbr>string.cpp</a>
          <br>
          <a moz-do-not-send=3D"true"
href=3D"https://github.com/matus-chochlik/mirror/blob/develop/example/mirro=
r/006_string_to_enum.cpp"
            target=3D"_blank" rel=3D"nofollow"
onmousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fg=
ithub.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fmirror%2F0=
06_string_to_enum.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHesQobXeGJS94=
EFIkfUtUMX9HWow';return
            true;"
onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithu=
b.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fmirror%2F006_s=
tring_to_enum.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHesQobXeGJS94EFIk=
fUtUMX9HWow';return
            true;">https://github.com/matus-<wbr>chochlik/mirror/blob/devel=
op/<wbr>example/mirror/006_string_to_<wbr>enum.cpp</a>
          <br>
          <a moz-do-not-send=3D"true"
href=3D"https://github.com/matus-chochlik/mirror/blob/develop/example/puddl=
e/005_enum_to_string.cpp"
            target=3D"_blank" rel=3D"nofollow"
onmousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fg=
ithub.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fpuddle%2F0=
05_enum_to_string.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGo7yI9BEgjnzU=
sb4kN2x1BNJHCWg';return
            true;"
onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithu=
b.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fpuddle%2F005_e=
num_to_string.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGo7yI9BEgjnzUsb4k=
N2x1BNJHCWg';return
            true;">https://github.com/matus-<wbr>chochlik/mirror/blob/devel=
op/<wbr>example/puddle/005_enum_to_<wbr>string.cpp</a>
          <br>
          <a moz-do-not-send=3D"true"
href=3D"https://github.com/matus-chochlik/mirror/blob/develop/example/puddl=
e/006_string_to_enum.cpp"
            target=3D"_blank" rel=3D"nofollow"
onmousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fg=
ithub.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fpuddle%2F0=
06_string_to_enum.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF4eoKJLDWYT6U=
8yxVJt7P1xHjOsQ';return
            true;"
onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithu=
b.com%2Fmatus-chochlik%2Fmirror%2Fblob%2Fdevelop%2Fexample%2Fpuddle%2F006_s=
tring_to_enum.cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF4eoKJLDWYT6U8yxV=
Jt7P1xHjOsQ';return
            true;">https://github.com/matus-<wbr>chochlik/mirror/blob/devel=
op/<wbr>example/puddle/006_string_to_<wbr>enum.cpp</a>=C2=A0<br>
        </blockquote>
        <div>=C2=A0</div>
        <div>Is it really necessary to construct the lookup table as a
          library container? Wouldn't a switch statement perform better?</d=
iv>
        <div><br>
        </div>
      </div>
    </blockquote>
    No, we don't need a map, but I believe that Matus wanted to show a
    probe of concept. <br>
    <br>
    I don't know how we can generate a switch with the current language.
    We can do some recursive if and expect that the compiler optimize
    it.<br>
    <br>
    Vicente<br>
  </body>
</html>

<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/ce4634af-e0ab-251b-d804-8fb721e855f9%=
40wanadoo.fr?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ce4634af-e0ab-251b-d804-8fb721e855f9=
%40wanadoo.fr</a>.<br />

--------------C3C4909328531A2728497738--

.
