220 30776 <fc42405f-b5de-492a-9e7e-e191a6dd975c@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: TONGARI J <tongari95@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Make Typedef Great Again
Date: Sun, 5 Feb 2017 04:56:11 -0800 (PST)
Lines: 241
Approved: news@gmane.org
Message-ID: <fc42405f-b5de-492a-9e7e-e191a6dd975c@isocpp.org>
References: <cfbe556f-214a-4245-b257-f746424c63f2@isocpp.org>
 <b1ae66d2-da65-bd04-6ac0-8bed1d13c5c5@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4584_265284119.1486299371968"
X-Trace: blaine.gmane.org 1486299373 4831 195.159.176.226 (5 Feb 2017 12:56:13 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 5 Feb 2017 12:56:13 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCC3NA775MLBB3GB3TCAKGQEWDNXXXA@isocpp.org Sun Feb 05 13:56:09 2017
Return-path: <std-proposals+bncBCC3NA775MLBB3GB3TCAKGQEWDNXXXA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCC3NA775MLBB3GB3TCAKGQEWDNXXXA@isocpp.org>)
	id 1caMMS-00013r-08
	for gclcip-std-proposals@m.gmane.org; Sun, 05 Feb 2017 13:56:08 +0100
Original-Received: by mail-yw0-f199.google.com with SMTP id q71sf67113653ywg.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 05 Feb 2017 04:56:14 -0800 (PST)
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=dDLCvUr8nCD0K5Zwvgiamb7CT+KVC57pDBEGPZ505Lc=;
        b=OFwDjtBr+stkTH5UWrzI4dJy2mlpcp/NYpWRo/wtFrI51RBM3eI5zn/czIKLmz8yjs
         XJddvQME3w2VAtQBn9dMhOo7Xh+qmT4Ybmg0CG9F9jTpYBOHH9cWOu8rDSzKDD+JFad3
         BCtyADHO/6Fc8mJmpXodjg0s9KwwamcPU0da4Tg6/mOCCx4hcWKFm0vZE0pLYpVvIEGY
         OB0i7FO/oeqzIJzVdmWkvYw+XCcbHTSqGb71VALaU2V9xvYyU+aN0YMtc1F8w0xXGfUF
         d3O0UcApHsJpGQ2dv5DRJZT8wefV71vLcJWYsMLVQGEifCoNc5XrvlMFu5jGyuzbyIRk
         TLGQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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=dDLCvUr8nCD0K5Zwvgiamb7CT+KVC57pDBEGPZ505Lc=;
        b=O8KQPTuNNRAMLAGIS1upaB0b70N7sSZdij96dVlWv5/hn/VGaSMpGUXhkMWCLYYGzD
         ItaFEHnauRcz/RR96FxUDXcG32EkKcGGhbN5aSzfnbzQE0bEZ/sY99//MVx2jNNh4buW
         3YiYOzSIOiBKD1QSXE1N1hhazFLcKZ06TzJJ9sxfPQWJ6UR/JmFK0CYG9JYru6qK1Ldt
         5uz7RPj9iWawXQ82GouJvMtMeZI36qhistO/MNs7m04bhPrbKJnqpFWRyEx+F6pD4/Dl
         PRMGZMqrsSMzhVePq9wKdP6r2zhNAT3l9QSvAROANC85iKemV8XrA63dEqZFhTuvvImn
         7maQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        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=dDLCvUr8nCD0K5Zwvgiamb7CT+KVC57pDBEGPZ505Lc=;
        b=LawihblPo3ngraFHjrFvZoV710/t6RkXkWnNExGzpdUvMRkCMBfv7UsqojWzO4Ei4M
         ar3MDDPrOrrhEIjg2nsx0UBvcKFwRBKF8M82IrdijBg+Lp0AKKitpc+qI1+NTuTtRoUc
         gniyTp3w5JipNOF+zouCQFAuLD9tqIZH+Iouok0xN1k1QTDKD0foqoqrJ5dafnDwvOlP
         MOnkfp31hnf/aTf/2du0OGFtYB6O0GQ9+x8SxYExm0uuiaor00jn4DBZoFYxj5Ql5hig
         lOQPCbF5Urn2xotA+PgSUG2BH71/qMXeWpPMoAtg8KPz6seK8xEsRpVJf+PhIrjkc120
         BIxw==
X-Gm-Message-State: AIkVDXI9NXL/3C2oNdgo9cJ5xJQlA2qNigZfDxAky2wzsO8tgRpuIkGIXWcG42tbl9RdaQ==
X-Received: by 10.129.179.202 with SMTP id r193mr1348829ywh.162.1486299373316;
        Sun, 05 Feb 2017 04:56:13 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.17.154 with SMTP id v26ls11040818otf.0.gmail; Sun, 05 Feb
 2017 04:56:12 -0800 (PST)
X-Received: by 10.157.18.211 with SMTP id g77mr318098otg.14.1486299372639;
        Sun, 05 Feb 2017 04:56:12 -0800 (PST)
In-Reply-To: <b1ae66d2-da65-bd04-6ac0-8bed1d13c5c5@wanadoo.fr>
X-Original-Sender: tongari95@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:30776
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30776>

------=_Part_4584_265284119.1486299371968
Content-Type: multipart/alternative; 
	boundary="----=_Part_4585_2063778322.1486299371969"

------=_Part_4585_2063778322.1486299371969
Content-Type: text/plain; charset=UTF-8

On Sunday, February 5, 2017 at 6:41:36 PM UTC+8, Vicente J. Botet Escriba 
wrote: 
>
> I'm not saying the feature is not needed. I believe however that the 
> proposal needs to compare what it is currently doable.
>
> Couldn't we use the existing language already
>
> template<blahblah..., typename T = typename MetaFunc<blahblah...>::type >
> T f() // yay!
> {
>     // Use `T` from now on...
> }
>
> In this case, it's just an alternative w/o (ab)using the template param, 
like how concept-lite tries to eliminate enable_if trick.
 

> template<blahblah..., typename Base=typename MetaFunc<blahblah...>::type>
> class Derived : public Base // yay!
> {
>     // Use `Base` from now on...
> }
>
 
This does not work if "blahblah...", is actually a template parameter pack, 
which has to be the last one.

> In parameter list:
> template<blahblah...>
> void f(typedef SomeTemplate<blahblah...> T a, T b); // yay!
>
> I'm not sure the blahblah could be inferred
>
> Do tou mean
>
>
> template<class U>
> void f(U, typedef SomeTemplate<U> T a, T b);
>

I mean something like:
template<class... Args>
void f(typedef std::tuple<Args...> T a, T b);

f(std::make_tuple(1, 2), std::make_tuple(3, 4)); //Args == {int, int}, T == 
std::tuple<int, int>

-- 
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/fc42405f-b5de-492a-9e7e-e191a6dd975c%40isocpp.org.

------=_Part_4585_2063778322.1486299371969
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, February 5, 2017 at 6:41:36 PM UTC+8, Vicente J=
.. Botet Escriba wrote:=C2=A0<blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><d=
iv bgcolor=3D"#FFFFFF" text=3D"#000000"><div>I&#39;m not saying the feature=
 is not needed. I believe however that the
    proposal needs to compare what it is currently doable.<br></div>
    <br>
    Couldn&#39;t we use the existing language already<br>
    <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">template</span><span style=3D"color=
:#660">&lt;</span><span style=3D"color:#000">blahblah</span><span style=3D"=
color:#660">...,
            typename T =3D </span><span style=3D"color:#660"><code><span st=
yle=3D"color:#000"></span><span style=3D"color:#008">typename</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:#606">MetaFunc</span><span=
 style=3D"color:#660">&lt;</span><span style=3D"color:#000">blahblah</span>=
<span style=3D"color:#660">...&gt;::</span><span style=3D"color:#000">type =
</span></code>&gt;</span><span style=3D"color:#000"><br>
          </span><span style=3D"color:#000">T
            f</span><span style=3D"color:#660">()</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#800">// yay!</span><span style=3D"col=
or:#000"><br>
          </span><span style=3D"color:#660">{</span><span style=3D"color:#0=
00"><br>
            =C2=A0 =C2=A0 </span><span style=3D"color:#800">// Use `T` from=
 now on...</span><span style=3D"color:#000"><br>
          </span><span style=3D"color:#660">}</span></div>
      </code></div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">
        <div></div></div></blockquote></div></blockquote><div>In this case,=
 it&#39;s just an alternative w/o (ab)using the template param, like how co=
ncept-lite tries to eliminate enable_if trick.</div><div>=C2=A0</div><block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#00=
0000">
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">template</span><span style=3D"color=
:#660">&lt;</span><span style=3D"color:#000">blahblah</span><span style=3D"=
color:#660">...,
            typename Base=3D</span><span style=3D"color:#660"><code><span s=
tyle=3D"color:#000"></span><span style=3D"color:#008">typename</span><span =
style=3D"color:#000"> </span><span style=3D"color:#606">MetaFunc</span><spa=
n style=3D"color:#660">&lt;</span><span style=3D"color:#000">blahblah</span=
><span style=3D"color:#660">...&gt;::</span><span style=3D"color:#000">type=
</span></code>&gt;</span><span style=3D"color:#000"><br>
          </span><span style=3D"color:#008">class</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#606">Derived</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#660">:</span><span style=3D"color:#0=
00"> </span><span style=3D"color:#000"></span><span style=3D"color:#008">pu=
blic</span><span style=3D"color:#000"> </span><span style=3D"color:#000"></=
span><span style=3D"color:#606">Base</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#800">// yay!</span><span style=3D"color:#000"><br>
          </span><span style=3D"color:#660">{</span><span style=3D"color:#0=
00"><br>
            =C2=A0 =C2=A0 </span><span style=3D"color:#800">// Use `Base` f=
rom now on...</span><span style=3D"color:#000"><br>
          </span><span style=3D"color:#660">}</span></div></code></div></di=
v></blockquote><div>=C2=A0</div><div>This does not work if &quot;<span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0); font-family=
: monospace;">blahblah...</span>&quot;, is actually a template parameter pa=
ck, which has to be the last one.</div><blockquote class=3D"gmail_quote" st=
yle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-lef=
t: 1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#000000"><blockquote type=3D"cite=
">
      <div dir=3D"ltr">
       =20
        <div>In parameter list:</div>
        <div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
            <div><span style=3D"color:#008">template</span><span style=3D"c=
olor:#660">&lt;</span><span style=3D"color:#000">blahblah</span><span style=
=3D"color:#660">...&gt;</span><span style=3D"color:#000"><br>
              </span><span style=3D"color:#008">void</span><span style=3D"c=
olor:#000"> f</span><span style=3D"color:#660">(</span><span style=3D"color=
:#008">typedef</span><span style=3D"color:#000"> </span><span style=3D"colo=
r:#606">SomeTemplate</span><span style=3D"color:#660">&lt;</span><span styl=
e=3D"color:#000">blahblah</span><span style=3D"color:#660">...&gt;</span><s=
pan style=3D"color:#000"> T a</span><span style=3D"color:#660">,</span><spa=
n style=3D"color:#000"> T b</span><span style=3D"color:#660">);</span><span=
 style=3D"color:#000"> </span><span style=3D"color:#800">// yay!</span></di=
v>
          </code></div>
        <div><br>
        </div>
      </div>
    </blockquote>
    I&#39;m not sure the <code><span style=3D"color:#660"></span><span styl=
e=3D"color:#000">blahblah</span><span style=3D"color:#660"> could be
        inferred<br>
        <br>
        Do tou mean<br>
        <br>
      </span></code><br>
    <code><span style=3D"color:#008">template</span><span style=3D"color:#6=
60">&lt;class U</span><span style=3D"color:#660">&gt;</span><span style=3D"=
color:#000"><br>
      </span><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> f</span><span style=3D"color:#660">(U, </span><span style=3D"color:#008=
">typedef</span><span style=3D"color:#000"> </span><span style=3D"color:#60=
6">SomeTemplate</span><span style=3D"color:#660">&lt;</span><span style=3D"=
color:#000">U</span><span style=3D"color:#660">&gt;</span><span style=3D"co=
lor:#000"> T a</span><span style=3D"color:#660">,</span><span style=3D"colo=
r:#000"> T b</span><span style=3D"color:#660">);<br></span></code></div></b=
lockquote><div><br></div><div>I mean something like:</div><div class=3D"pre=
ttyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(=
187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wo=
rd;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">class</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">...</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"=
styled-by-prettify">Args</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">typedef</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">tuple</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #606;" c=
lass=3D"styled-by-prettify">Args</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">...&gt;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> T a</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> T b</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
</span><font color=3D"#660066"><span style=3D"color: #000;" class=3D"styled=
-by-prettify">f</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">make_tuple</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"=
styled-by-prettify">2</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">),</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span></font><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">make_tuple</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><font =
color=3D"#006666"><span style=3D"color: #066;" class=3D"styled-by-prettify"=
>3</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #066;" class=3D"styled-by-prettify">4</span></font><span style=
=3D"color: #660;" class=3D"styled-by-prettify">));</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;=
" class=3D"styled-by-prettify">//Args =3D=3D {int, int}, T =3D=3D std::tupl=
e&lt;int, int&gt;</span></div></code></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/fc42405f-b5de-492a-9e7e-e191a6dd975c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/fc42405f-b5de-492a-9e7e-e191a6dd975c=
%40isocpp.org</a>.<br />

------=_Part_4585_2063778322.1486299371969--

------=_Part_4584_265284119.1486299371968--

.
