220 26326 <CADvuK0JihA=K8PMhBMG3OKkq6JTRgqDtCkNM+9FWnuTxvV-d1w@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "Arthur O'Dwyer" <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: statement folding on variadic templates
 parameters pack
Date: Mon, 13 Jun 2016 11:58:55 -0700
Lines: 306
Approved: news@gmane.org
Message-ID: <CADvuK0JihA=K8PMhBMG3OKkq6JTRgqDtCkNM+9FWnuTxvV-d1w@mail.gmail.com>
References: <1e3daa7c-e10a-4589-8118-26f47bc1a0df@isocpp.org>
 <f11d3266-3407-4c00-a578-5d07beeb1071@isocpp.org> <b967b669-6c28-4295-b5c8-6a2f2ed7a174@isocpp.org>
 <9c425e18-e592-4cfd-9e41-b37b212a6b9d@isocpp.org> <1015518c-c0e4-4397-b946-df7834a2c3c0@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a113a55d4ff8ecb05352d7a20
X-Trace: ger.gmane.org 1465844340 17675 80.91.229.3 (13 Jun 2016 18:59:00 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 13 Jun 2016 18:59:00 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDLZJYWNDQIPDBH4XICRUBGFKQZOE@isocpp.org Mon Jun 13 20:58:59 2016
Return-path: <std-proposals+bncBDLZJYWNDQIPDBH4XICRUBGFKQZOE@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f69.google.com ([209.85.220.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDLZJYWNDQIPDBH4XICRUBGFKQZOE@isocpp.org>)
	id 1bCX4d-0005IN-7q
	for gclcip-std-proposals@m.gmane.org; Mon, 13 Jun 2016 20:58:59 +0200
Original-Received: by mail-pa0-f69.google.com with SMTP id he1sf82964360pac.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 13 Jun 2016 11:58:58 -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=dL9/UR7gkJd22qq9oh3fuK/ORw+RW50THZMPkTyDsKc=;
        b=DnKCAMjOFDbi/StmOcjCDOoLOK7jcp4GBKr2YjH8abA2R7DowPtB8FA0ivhZzKsyQs
         Jrpl2EqNPQFhcyxNasn2xrplTrLwcH5kwqhpQ4wX1S9XYhjNkLqu2s+N2X3j9Xg1Bfd5
         QVtsKsLrkt/aJVAOh1u187O/cLiaSsz5PzPIJsV8IjCFBagn/6p2JSWC+yZfDAKKg3H+
         FCxQvkJjkHWujXA7EJvpP4eE07Mazd2weuFFkUfsO/Vr/4Yn7Uildn1MIsjsswP/oEiS
         1Ho1izgjEU/4pgI3DeqJ5lbNrkB3OS6LZSJ50IQMMTV4ha89+R48LSTRkEHSFiT8e0YN
         HXfg==
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=dL9/UR7gkJd22qq9oh3fuK/ORw+RW50THZMPkTyDsKc=;
        b=ND7z6iVQzj6joXiaCNbe2QnN2Gro4ncLxnUJL7pqrs+BLTFoX3WZ5UYBo1yQbwnDkv
         uiD72B0yWi0DJvayRFOfgZjABQd4xhK0JLE5fqxWAhu4hKqjpsl4TqXdbbv9oQBHsGQ+
         SIGkvxYIDfArNKSZ3hqIev83BFMmmjbNhOnW1PT0NR6oJRzNOwYFQwNoD1lZfH5iosmY
         TPA/R0GUoTfkh9tombMlSifEVvvyzleqMsiaErAiTjVhdJOrXkbkiuRR8oYF+YDvQnBR
         9QPfyrBQBO4FFuHvz9LGFT4FGonNP8ABq8ZEZa3YOcNh5TVENRzhgSrUybbR3DXJZd6O
         //rg==
X-Gm-Message-State: ALyK8tIL16O319fY5ENO+Lpb4u/pSpBU7+QWCniorMpkkxYfy1IB03m3k+HO5s0mpA9JtQ==
X-Received: by 10.98.29.15 with SMTP id d15mr13326304pfd.5.1465844338264;
        Mon, 13 Jun 2016 11:58:58 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.35.83 with SMTP id m77ls3501061qgm.24.gmail; Mon, 13 Jun
 2016 11:58:57 -0700 (PDT)
X-Received: by 10.55.11.6 with SMTP id 6mr16737335qkl.160.1465844337166;
        Mon, 13 Jun 2016 11:58:57 -0700 (PDT)
Original-Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com. [2607:f8b0:400d:c04::232])
        by mx.google.com with ESMTPS id w62si16015720qhw.12.2016.06.13.11.58.57
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 13 Jun 2016 11:58:57 -0700 (PDT)
Received-SPF: pass (google.com: domain of arthur.j.odwyer@gmail.com designates 2607:f8b0:400d:c04::232 as permitted sender) client-ip=2607:f8b0:400d:c04::232;
Original-Received: by mail-qg0-x232.google.com with SMTP id l44so72225653qgd.0
        for <std-proposals@isocpp.org>; Mon, 13 Jun 2016 11:58:57 -0700 (PDT)
X-Received: by 10.140.96.199 with SMTP id k65mr15289040qge.27.1465844336920;
 Mon, 13 Jun 2016 11:58:56 -0700 (PDT)
Original-Received: by 10.200.51.177 with HTTP; Mon, 13 Jun 2016 11:58:55 -0700 (PDT)
In-Reply-To: <1015518c-c0e4-4397-b946-df7834a2c3c0@isocpp.org>
X-Original-Sender: arthur.j.odwyer@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 arthur.j.odwyer@gmail.com designates 2607:f8b0:400d:c04::232 as permitted
 sender) smtp.mailfrom=arthur.j.odwyer@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-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:26326
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26326>

--001a113a55d4ff8ecb05352d7a20
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 13, 2016 at 10:56 AM, Sergey Vidyuk <sir.vestnik@gmail.com>
wrote:

> =D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 11 =D0=B8=D1=8E=D0=BD=D1=8F 2=
016 =D0=B3., 1:10:04 UTC+6 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=
=D1=82=D0=B5=D0=BB=D1=8C inkwizyt...@gmail.com
> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>>
>>  I think that `for constexpr` should be allowed to extracting parameters
>> from templates, some thing like that:
>> using type =3D std::tuple<int, long long, char>;
>>
>> int main()
>> {
>>     for constexpr (typename T : type) //without `...`
>>     {
>>         f<T>();
>>     } //equal: `f<int>(); f<long long>(); f<char>();`
>> }
>>
>>
> Am I right tha the main and only reason you would like to grab template
> parameters with 'for constexpr' is to have type list outside of template?
>
>
>> This will allow usage outside of template function and simplify complex
>> operation:
>> template<typename T>
>> using MetaFunc =3D std::tuple<int, T, T, char>;
>>
>>
>> int main()
>> {
>>     for constexpr (typename T : MetaFunc<long>)
>>     {
>>         f<T>();
>>     } //equal: `f<int>(); f<long>(); f<long>(); f<char>();`
>>     for constexpr (typename T : MetaFunc<char>)
>>     {
>>         for constexpr (typename TT : MetaFunc<T>)
>>         {
>>            g<T,TT>();
>>         }
>>     }
>> }
>>
>>
>>  I see one issue with this example. Your MetaFunc is template typedef an=
d
> instead of iteraating over single element list you are iterating through =
 4
> elements list since you are grabbing parameters of type mapped my templat=
e
> typedef but not parameters of teemplate typedef itself. The simpliest way
> to have list of types which is never can accidentally create some nonvoid
> variable is template typedef std::void_t which can be implemented as
>
> template<typename... T>
> using void_t =3D void;
>
> how the following loop should work then?
>
> for constexpr (typename T: void_t<int8_t, int16_t, int32_t, int64_t>) {
>     do_something();
> }
>
> My personal opinion on such feature: there should be separate syntax to
> grab template parameters like
>
> for constexpr (typename T: params_of<void_t<int8_t, int16_t, int32_t,
> int64_t>>) {
>     do_something();
> }
>
> but it require some extra work on how this should actually work.
>

Sorry, that's impossible in C++.  Intuitively,

    using result =3D void_t<A,B,C,D>;
    ... some expression involving params_of<result> ...

is a non-starter for the same reason that

    auto sum =3D a + b + c + d;
    ... some expression involving addends_of<sum> ...

is a non-starter. Alias templates are referentially transparent (at compile
time) in the same way that ints are (at runtime); void_t<A,B,C,D> *is* void
as far as the compiler is concerned.  That's an intentional feature; it
allows type deduction to "see through" parameters whose types are template
aliases whereas type deduction can't "see through" parameters whose types
are member typedefs of template classes.

HTH,
Arthur

--=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/CADvuK0JihA%3DK8PMhBMG3OKkq6JTRgqDtCkNM%2B9FWnuT=
xvV-d1w%40mail.gmail.com.

--001a113a55d4ff8ecb05352d7a20
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Mon, Jun 13, 2016 at 10:56 AM, Sergey Vidyuk <span dir=
=3D"ltr">&lt;<a href=3D"mailto:sir.vestnik@gmail.com" target=3D"_blank">sir=
..vestnik@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div=
 class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=D1=
=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 11 =D0=B8=D1=8E=D0=BD=D1=8F 2016 =
=D0=B3., 1:10:04 UTC+6 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=
=82=D0=B5=D0=BB=D1=8C <a href=3D"mailto:inkwizyt...@gmail.com" target=3D"_b=
lank">inkwizyt...@gmail.com</a> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:=
<span class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0;margin=
-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
=C2=A0I think that `for constexpr` should be allowed to extracting paramete=
rs from templates, some thing like that:<br><div><div style=3D"background-c=
olor:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;bord=
er-width:1px;word-wrap:break-word"><code><div><span style=3D"color:#008">us=
ing</span><span style=3D"color:#000"> type </span><span style=3D"color:#660=
">=3D</span><span style=3D"color:#000"> std</span><span style=3D"color:#660=
">::</span><span style=3D"color:#000">tuple</span><span style=3D"color:#660=
">&lt;</span><span style=3D"color:#008">int</span><span style=3D"color:#660=
">,</span><span style=3D"color:#000"> </span><span style=3D"color:#008">lon=
g</span><span style=3D"color:#000"> </span><span style=3D"color:#008">long<=
/span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span=
><span style=3D"color:#008">char</span><span style=3D"color:#660">&gt;;</sp=
an><span style=3D"color:#000"><br><br></span><span style=3D"color:#008">int=
</span><span style=3D"color:#000"> main</span><span style=3D"color:#660">()=
</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">{</=
span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"col=
or:#008">for</span><span style=3D"color:#000"> </span><span style=3D"color:=
#008">constexpr</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#660">(</span><span style=3D"color:#008">typename</span><span style=3D"c=
olor:#000"> T </span><span style=3D"color:#660">:</span><span style=3D"colo=
r:#000"> type</span><span style=3D"color:#660">)</span><span style=3D"color=
:#000"> </span><span style=3D"color:#800">//without `...`</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">{</span=
><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 f</span><span s=
tyle=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span sty=
le=3D"color:#660">&gt;();</span><span style=3D"color:#000"><br>=C2=A0 =C2=
=A0 </span><span style=3D"color:#660">}</span><span style=3D"color:#000"> <=
/span><span style=3D"color:#800">//equal: `f&lt;int&gt;(); f&lt;long long&g=
t;(); f&lt;char&gt;();`</span><span style=3D"color:#000"><br></span><span s=
tyle=3D"color:#660">}</span></div></code></div><br></div></div></blockquote=
></span><div><br>Am I right tha the main and only reason you would like to =
grab template=20
parameters with &#39;for constexpr&#39; is to have type list outside of=20
template?<br>=C2=A0</div><span class=3D""><blockquote class=3D"gmail_quote"=
 style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div dir=3D"ltr"><div>This will allow usage outside of template func=
tion and simplify complex operation:<br><div style=3D"background-color:rgb(=
250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:=
1px;word-wrap:break-word"><code><div><span style=3D"color:#008">template</s=
pan><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">typena=
me</span><span style=3D"color:#000"> T</span><span style=3D"color:#660">&gt=
;</span><span style=3D"color:#000"><br></span><span style=3D"color:#008">us=
ing</span><span style=3D"color:#000"> </span><span style=3D"color:#606">Met=
aFunc</span><span style=3D"color:#000"> </span><span style=3D"color:#660">=
=3D</span><span style=3D"color:#000"> std</span><span style=3D"color:#660">=
::</span><span style=3D"color:#000">tuple</span><span style=3D"color:#660">=
&lt;</span><span style=3D"color:#008">int</span><span style=3D"color:#660">=
,</span><span style=3D"color:#000"> T</span><span style=3D"color:#660">,</s=
pan><span style=3D"color:#000"> T</span><span style=3D"color:#660">,</span>=
<span style=3D"color:#000"> </span><span style=3D"color:#008">char</span><s=
pan style=3D"color:#660">&gt;;</span><span style=3D"color:#000"><br><br><br=
></span><span style=3D"color:#008">int</span><span style=3D"color:#000"> ma=
in</span><span style=3D"color:#660">()</span><span style=3D"color:#000"><br=
></span><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color:#008">for</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#008">constexpr</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">(</span><span style=3D"colo=
r:#008">typename</span><span style=3D"color:#000"> T </span><span style=3D"=
color:#660">:</span><span style=3D"color:#000"> </span><span style=3D"color=
:#606">MetaFunc</span><span style=3D"color:#080">&lt;long&gt;</span><span s=
tyle=3D"color:#660">)</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </=
span><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 f</span><span style=3D"color:#660">&lt;</span><spa=
n style=3D"color:#000">T</span><span style=3D"color:#660">&gt;();</span><sp=
an style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660"=
>}</span><span style=3D"color:#000"> </span><span style=3D"color:#800">//eq=
ual: `f&lt;int&gt;(); f&lt;long&gt;(); f&lt;long&gt;(); f&lt;char&gt;();`</=
span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"col=
or:#008">for</span><span style=3D"color:#000"> </span><span style=3D"color:=
#008">constexpr</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#660">(</span><span style=3D"color:#008">typename</span><span style=3D"c=
olor:#000"> T </span><span style=3D"color:#660">:</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#606">MetaFunc</span><span style=3D"co=
lor:#080">&lt;char&gt;</span><span style=3D"color:#660">)</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">{</span=
><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span st=
yle=3D"color:#008">for</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">constexpr</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#008">typename</span><span =
style=3D"color:#000"> TT </span><span style=3D"color:#660">:</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#606">MetaFunc</span><span =
style=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span st=
yle=3D"color:#660">&gt;)</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 </span><span style=3D"color:#660">{</span><span style=3D"col=
or:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0g</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000">TT</span><span style=3D"=
color:#660">&gt;();</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color:#660">}</span><span style=3D"color:#=
000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">}</span><span styl=
e=3D"color:#000"><br></span><span style=3D"color:#660">}</span></div></code=
></div><br><br></div></div></blockquote></span><div>=C2=A0I see one issue w=
ith this example. Your MetaFunc is template typedef and instead of iteraati=
ng over single element list you are iterating through=C2=A0 4 elements list=
 since you are grabbing parameters of type mapped my template typedef but n=
ot parameters of teemplate typedef itself. The simpliest way to have list o=
f types which is never can accidentally create some nonvoid variable is tem=
plate typedef std::void_t which can be implemented as<br><br><div style=3D"=
background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-styl=
e:solid;border-width:1px;word-wrap:break-word"><code><div><span style=3D"co=
lor:#008">template</span><span style=3D"color:#660">&lt;</span><span style=
=3D"color:#008">typename</span><span style=3D"color:#660">...</span><span s=
tyle=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span><span st=
yle=3D"color:#000"><br></span><span style=3D"color:#008">using</span><span =
style=3D"color:#000"> void_t </span><span style=3D"color:#660">=3D</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#008">void</span><spa=
n style=3D"color:#660">;</span><span style=3D"color:#000"><br></span></div>=
</code></div><br>how the following loop should work then?<br><br><div style=
=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-=
style:solid;border-width:1px;word-wrap:break-word"><code><div><span style=
=3D"color:#008">for</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">constexpr</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">(</span><span style=3D"color:#008">typename</span><span sty=
le=3D"color:#000"> T</span><span style=3D"color:#660">:</span><span style=
=3D"color:#000"> void_t</span><span style=3D"color:#660">&lt;</span><span s=
tyle=3D"color:#000">int8_t</span><span style=3D"color:#660">,</span><span s=
tyle=3D"color:#000"> int16_t</span><span style=3D"color:#660">,</span><span=
 style=3D"color:#000"> int32_t</span><span style=3D"color:#660">,</span><sp=
an style=3D"color:#000"> int64_t</span><span style=3D"color:#660">&gt;)</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#660">{</span><s=
pan style=3D"color:#000"><br>=C2=A0 =C2=A0 do_something</span><span style=
=3D"color:#660">();</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#660">}</span><span style=3D"color:#000"><br></span></div></code>=
</div><br>My personal opinion on such feature: there should be separate syn=
tax to grab template parameters like<br><br><div style=3D"background-color:=
rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-wi=
dth:1px;word-wrap:break-word"><code><div><span style=3D"color:#008">for</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#008">constexpr<=
/span><span style=3D"color:#000"> </span><span style=3D"color:#660">(</span=
><span style=3D"color:#008">typename</span><span style=3D"color:#000"> T</s=
pan><span style=3D"color:#660">:</span><span style=3D"color:#000"> params_o=
f</span><span style=3D"color:#660">&lt;</span><span style=3D"color:#000">vo=
id_t</span><span style=3D"color:#660">&lt;</span><span style=3D"color:#000"=
>int8_t</span><span style=3D"color:#660">,</span><span style=3D"color:#000"=
> int16_t</span><span style=3D"color:#660">,</span><span style=3D"color:#00=
0"> int32_t</span><span style=3D"color:#660">,</span><span style=3D"color:#=
000"> int64_t</span><span style=3D"color:#660">&gt;&gt;)</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">{</span><span style=3D"c=
olor:#000"><br>=C2=A0 =C2=A0 do_something</span><span style=3D"color:#660">=
();</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">=
}</span><span style=3D"color:#000"><br></span></div></code></div><br>but it=
 require some extra work on how this should actually work.</div></div></blo=
ckquote><div><br></div><div>Sorry, that&#39;s impossible in C++.=C2=A0 Intu=
itively,</div><div><br></div><div><font face=3D"monospace, monospace">=C2=
=A0 =C2=A0 using result =3D void_t&lt;A,B,C,D&gt;;</font></div><div><font f=
ace=3D"monospace, monospace">=C2=A0 =C2=A0 ... some expression involving pa=
rams_of&lt;result&gt; ...</font></div><div><br></div><div>is a non-starter =
for the same reason that</div><div><br></div><div><font face=3D"monospace, =
monospace">=C2=A0 =C2=A0 auto sum =3D a + b + c + d;</font></div><div><font=
 face=3D"monospace, monospace">=C2=A0 =C2=A0 ... some expression involving =
addends_of&lt;sum&gt; ...</font></div></div><br></div><div class=3D"gmail_e=
xtra">is a non-starter. Alias templates are referentially transparent (at c=
ompile time) in the same way that ints are (at runtime); <font face=3D"mono=
space, monospace">void_t&lt;A,B,C,D&gt;</font> <b><i>is</i></b> <font face=
=3D"monospace, monospace">void</font> as far as the compiler is concerned.=
=C2=A0 That&#39;s an intentional feature; it allows type deduction to &quot=
;see through&quot; parameters whose types are template aliases whereas type=
 deduction can&#39;t &quot;see through&quot; parameters whose types are mem=
ber typedefs of template classes.</div><div class=3D"gmail_extra"><br></div=
><div class=3D"gmail_extra">HTH,</div><div class=3D"gmail_extra">Arthur</di=
v><div class=3D"gmail_extra"><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/CADvuK0JihA%3DK8PMhBMG3OKkq6JTRgqDtCk=
NM%2B9FWnuTxvV-d1w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CADvuK0JihA%3=
DK8PMhBMG3OKkq6JTRgqDtCkNM%2B9FWnuTxvV-d1w%40mail.gmail.com</a>.<br />

--001a113a55d4ff8ecb05352d7a20--

.
