220 26313 <55892254-d646-4cc3-b10c-a0f0a5eb665c@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Giovanni Piero Deretta <gpderetta@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: statement folding on variadic templates
 parameters pack
Date: Mon, 13 Jun 2016 02:33:25 -0700 (PDT)
Lines: 83
Approved: news@gmane.org
Message-ID: <55892254-d646-4cc3-b10c-a0f0a5eb665c@isocpp.org>
References: <1e3daa7c-e10a-4589-8118-26f47bc1a0df@isocpp.org>
 <f11d3266-3407-4c00-a578-5d07beeb1071@isocpp.org> <CAOfiQq=hhVBJAQ3Ekeo6mkWxPasnURXOW6r8zNo8oOk93ptbAQ@mail.gmail.com>
 <CADvuK0K+_d_h1eby+nFE0wmdK+3+B=zFOG5nLp1H15jRTo0Jgg@mail.gmail.com>
 <2d8458f8-27b2-464f-a16e-fc866ccfd2cd@isocpp.org> <b448d4b9-c76d-4d27-8b16-0e005478320f@isocpp.org>
 <d90bb3eb-e1d4-4a29-bb7e-63c097f49f96@isocpp.org> <bf02cde4-5da6-4a0b-903f-8b9230d4869c@isocpp.org>
 <CALbYwOymuWcO0WO6aSGCd1iv-dTUxPXP1BMYDdv5Pfcafw_xcQ@mail.gmail.com>
 <CAJnLdOZ5L0P6qdoer6jntOjtYwCTpV_VEGJv6bZUmGk6zmoQ2g@mail.gmail.com> <a731ae2e-9519-4d03-81ec-506b7bbda8b5@isocpp.org>
 <CAFk2RUZBSMsJOkjDaU=9xz4iJ9qNadygbPiB004oCh2p3jfgFg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_131_1998868029.1465810405949"
X-Trace: ger.gmane.org 1465810412 9202 80.91.229.3 (13 Jun 2016 09:33:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 13 Jun 2016 09:33:32 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDEP3I7TGEIOP67ZXICRUBBT6Z7F2@isocpp.org Mon Jun 13 11:33:32 2016
Return-path: <std-proposals+bncBDEP3I7TGEIOP67ZXICRUBBT6Z7F2@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f197.google.com ([209.85.220.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDEP3I7TGEIOP67ZXICRUBBT6Z7F2@isocpp.org>)
	id 1bCOFN-0000HJ-4Q
	for gclcip-std-proposals@m.gmane.org; Mon, 13 Jun 2016 11:33:29 +0200
Original-Received: by mail-qk0-f197.google.com with SMTP id d2sf178288096qkg.1
        for <gclcip-std-proposals@m.gmane.org>; Mon, 13 Jun 2016 02:33:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Zn6TBUStdqbK8JWZdkJiUg2KmJTLmUBSHmqH3PlLH68=;
        b=kU7GACG5vr/ob5zhLJg9fbM2+MbS4gtx63kOWpDjDZOI6jIzKg/TIBDx5bOEVzBdHW
         9DjIcU605Qn5GOPLlpEcpt0IZ0aC21dwsrfdVi1JgertRRaRD21VZEz0PP4b1WPtGkgH
         Hu9INkromvLw1buEJAbaaz1fSRZYCplIGswS15JSc9EgI+b8kzUwHgaFynfu7qkTdkbh
         7vHTlhj+UDJI4puEj801cZLQWOFetWsuoFK02bxNo1CdIOAOgol0uhZlVGZ23wb2D+/4
         nVlo1PrA376KxbR2HRgo3HBykVDJ6/vQw+F/8vs6Cx38bDsVTv1DhBpKoovKNEWwx4ul
         Zx4w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Zn6TBUStdqbK8JWZdkJiUg2KmJTLmUBSHmqH3PlLH68=;
        b=M1qD3ufVPaR/qlgE27QqJwmlYLJWGc9RInttLBE7f4PjZ1AOebEU1mv1sjM66Zqpo1
         IAw678JHAZgw33gul3ZYziqY1EkBmLOGWRLryMfNTKCCCluz2NwtyYBXw6X/Yfyr7zwd
         9F0gM0a9gA8WwI1QL0V5xvL3+CquK50+CeFL0/2rtJd3EYQFe2tsscTP5cGTLSTTVVPV
         R/c/ldkuH2+JYAvCgSImynzMuYqntJA6hkSJ2pnXCCNoVb2eYBeyl+EYbMBDZWCMrnmc
         kbgblEesCU2ttTXXB3RSeiVnxajBcDCq8poJX9vg6DH28dF9rgYi8tq9NXcCQ8xs7lul
         PfsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=Zn6TBUStdqbK8JWZdkJiUg2KmJTLmUBSHmqH3PlLH68=;
        b=G4s56ou/ZaDl5uvQqMHlIPm8YHziD9n+7DFabo1LenGjvK3FzrgkrdyZA6j7hzIMxV
         W37p3m1rL/uydJWAiRKyAMhefvUr+YSJxpnFr78hRkCW67j6HhQDogjm/OAYgMN6IEhY
         pQGlDkOttoywLZGczu2MJmNMCmOyLMcMosyF1ZYcQYyrzvLqt2HRYbEExvmw0DtWJTV7
         84VjL9TWETxfebBcnLVrB5dhhLprrBGiprSmzTSNGKzsPH9r9JvSatEXJD3nn8KidO74
         YmrNb+NwW9FP1bHhCLkbJofF6YBsx2fxXroNPags3oPDy+a7LCG8EjWGOHclSD10Jju4
         tGxQ==
X-Gm-Message-State: ALyK8tLD+TcArS9Da89cXTnpP/yR7eeA31qrChLrsI/s6g/oOIZ7MAXo0a2MOsdK1J7CBg==
X-Received: by 10.237.37.87 with SMTP id w23mr6904296qtc.7.1465810408176;
        Mon, 13 Jun 2016 02:33:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.34.142 with SMTP id i136ls1519717ioi.55.gmail; Mon, 13 Jun
 2016 02:33:27 -0700 (PDT)
X-Received: by 10.36.68.65 with SMTP id o62mr218387ita.0.1465810407154;
        Mon, 13 Jun 2016 02:33:27 -0700 (PDT)
In-Reply-To: <CAFk2RUZBSMsJOkjDaU=9xz4iJ9qNadygbPiB004oCh2p3jfgFg@mail.gmail.com>
X-Original-Sender: gpderetta@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:26313
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26313>

------=_Part_131_1998868029.1465810405949
Content-Type: multipart/alternative; 
	boundary="----=_Part_132_383559435.1465810405949"

------=_Part_132_383559435.1465810405949
Content-Type: text/plain; charset=UTF-8

On Sunday, June 12, 2016 at 11:25:50 AM UTC+1, Ville Voutilainen wrote:
>
> On 12 June 2016 at 13:23,  <inkwizyt...@gmail.com <javascript:>> wrote: 
> > This code should be fast as manually written switch, it would be trivial 
> for 
> > compiler to create jump table to have best performance. 
>
>
> I'm sure the open-source compilers will happily accept an extension 
> patch that shows how trivial it is. 
>

For what is worth, you can abuse GCC statement expressions plus variadics 
to get variadic expansion of switch statements. Although 'case' in 
statement expressions is explicitly documented not to be supported, it does 
work in practice (nothing I would use in production of course).

So, while I wouldn't call it trivial, it seems to me that it souldn't be 
too hard to implement the extension in GCC, and you could even consider 
statement expressions as existing practice.

-- gpd

-- 
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/55892254-d646-4cc3-b10c-a0f0a5eb665c%40isocpp.org.

------=_Part_132_383559435.1465810405949
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, June 12, 2016 at 11:25:50 AM UTC+1, Ville Vouti=
lainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 12 June 2016 a=
t 13:23, =C2=A0&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated=
-mailto=3D"B0T3BgNpAQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;j=
avascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;=
return true;">inkwizyt...@gmail.com</a>&gt; wrote:
<br>&gt; This code should be fast as manually written switch, it would be t=
rivial for
<br>&gt; compiler to create jump table to have best performance.
<br>
<br>
<br>I&#39;m sure the open-source compilers will happily accept an extension
<br>patch that shows how trivial it is.
<br></blockquote><div><br>For what is worth, you can abuse GCC statement ex=
pressions plus variadics to get variadic expansion of switch statements. Al=
though &#39;case&#39; in statement expressions is explicitly documented not=
 to be supported, it does work in practice (nothing I would use in producti=
on of course).<br><br>So, while I wouldn&#39;t call it trivial, it seems to=
 me that it souldn&#39;t be too hard to implement the extension in GCC, and=
 you could even consider statement expressions as existing practice.<br><br=
>-- gpd<br></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/55892254-d646-4cc3-b10c-a0f0a5eb665c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/55892254-d646-4cc3-b10c-a0f0a5eb665c=
%40isocpp.org</a>.<br />

------=_Part_132_383559435.1465810405949--

------=_Part_131_1998868029.1465810405949--

.
