220 13496 <7b8958e6-93c6-48ec-98a9-75a0fad8482d@email.android.com> article
Path: news.gmane.org!not-for-mail
From: George Makrydakis <irrequietus@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Generalizing the equivalence of auto and
 template type deduction
Date: Thu, 02 Oct 2014 12:05:04 +0300
Lines: 116
Approved: news@gmane.org
Message-ID: <7b8958e6-93c6-48ec-98a9-75a0fad8482d@email.android.com>
References: <b34d67b1-53fb-449e-be78-579bd0e48f31@isocpp.org> <0bf78c13-6ee2-4a9a-9de5-5ce2dc0e5a66@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="----F271HYFDCQPIQOAYFNL1WUSGZKY52W"
Content-Transfer-Encoding: 8bit
X-Trace: ger.gmane.org 1412240726 8614 80.91.229.3 (2 Oct 2014 09:05:26 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 2 Oct 2014 09:05:26 +0000 (UTC)
To: std-proposals@isocpp.org,Tomasz <tomaszkam@gmail.com>
Original-X-From: std-proposals+bncBDG4XBF6YIPBBT5KWSQQKGQEHFYIFRA@isocpp.org Thu Oct 02 11:05:20 2014
Return-path: <std-proposals+bncBDG4XBF6YIPBBT5KWSQQKGQEHFYIFRA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f70.google.com ([74.125.82.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDG4XBF6YIPBBT5KWSQQKGQEHFYIFRA@isocpp.org>)
	id 1XZcK8-0004qi-AK
	for gclcip-std-proposals@m.gmane.org; Thu, 02 Oct 2014 11:05:20 +0200
Original-Received: by mail-wg0-f70.google.com with SMTP id a1sf889659wgh.5
        for <gclcip-std-proposals@m.gmane.org>; Thu, 02 Oct 2014 02:05:20 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:user-agent:in-reply-to:references:mime-version
         :subject:from:date:to:message-id:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type:content-transfer-encoding;
        bh=1tCxcyoqJSQ4gS0dUm9f9Q5qXzrakF/75fkUVi2uEmE=;
        b=bvGBj+FMepjgRlhvIruHNLzVfU9HR3di3+HwIrTr7dsFqAq5nEj2FYBBK+6fXQa0zt
         3ucO2HN920AYOB4i6jsYsCfLXP/1Iao3+PUMYwvTbGMPl9Ea7/+/I/VprZujZq5SN4H7
         yGpG+d9nddROtbEUzdVpe7yn64XCScfMgNKI0mdCy0R2tCqklN0GVAWSmRUAkjDH2QmU
         yzh9PA4aSBDgfPi5+OuKI8CM9Fo1flgte2RzMQTfyF9Vjegr3rXDv3D1QVRoSN8QNHdL
         muhIQHlTS/1npVEWpKWroWUFK6dHzfZ/ElKcyv58LTCvIpebEi/IGqqFgGfTnbVkrQUH
         RnC 
X-Gm-Message-State: ALoCoQnAl0YnhPSAOhktW75OT7kcTGaZVPL7pbDCxcOpeS1V95WlueuHYnuz217iw3T9adeY2qVN
X-Received: by 10.194.7.199 with SMTP id l7mr9162379wja.2.1412240719885;
        Thu, 02 Oct 2014 02:05:19 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.99.9 with SMTP id em9ls47001wib.2.canary; Thu, 02 Oct 2014
 02:05:18 -0700 (PDT)
X-Received: by 10.180.126.39 with SMTP id mv7mr2222426wib.73.1412240718770;
        Thu, 02 Oct 2014 02:05:18 -0700 (PDT)
Original-Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [2a00:1450:400c:c05::229])
        by mx.google.com with ESMTPS id ef9si488613wic.17.2014.10.02.02.05.18
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 02 Oct 2014 02:05:18 -0700 (PDT)
Received-SPF: pass (google.com: domain of irrequietus@gmail.com designates 2a00:1450:400c:c05::229 as permitted sender) client-ip=2a00:1450:400c:c05::229;
Original-Received: by mail-wi0-f169.google.com with SMTP id cc10so872771wib.0
        for <std-proposals@isocpp.org>; Thu, 02 Oct 2014 02:05:18 -0700 (PDT)
X-Received: by 10.194.58.108 with SMTP id p12mr72371665wjq.71.1412240718652;
        Thu, 02 Oct 2014 02:05:18 -0700 (PDT)
Original-Received: from 178-146-131-90.mobile.cosmote.net (178-146-131-90.mobile.cosmote.net. [178.146.131.90])
        by mx.google.com with ESMTPSA id ma8sm3837532wjb.46.2014.10.02.02.05.12
        for <multiple recipients>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 02 Oct 2014 02:05:16 -0700 (PDT)
User-Agent: Kaiten Mail
In-Reply-To: <0bf78c13-6ee2-4a9a-9de5-5ce2dc0e5a66@isocpp.org>
X-Original-Sender: irrequietus@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of irrequietus@gmail.com designates 2a00:1450:400c:c05::229 as
 permitted sender) smtp.mail=irrequietus@gmail.com;       dkim=pass
 header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:13496
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13496>

------F271HYFDCQPIQOAYFNL1WUSGZKY52W
Content-Type: text/plain; charset=UTF-8

Again, this has already been discussed. See previous emails on this thread on why you would have problems with that as it is. You do not even gain total equivalence over canonical template syntax, if that is your goal.

On October 2, 2014 11:43:58 AM EEST, Tomasz <tomaszkam@gmail.com> wrote:
>My proposal is that every use of placholder (today we have only auto,
>but 
>concept name would be a possible extension) would introduce separate 
>typename, so:
>std::pair<auto, auto> p = f();
>
>Would use equivalent deduction as:
>template<typename T1, typename T2>
>void foo(std::pair<T1, T2>);
>
>And two different types can be deduced. To achieve the pair of the same
>
>types I would use syntax proposed in 
>http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3878.pdf 
><http://n3878>, that allow us to introduce indentyfier for a type
>deduced 
>from placeholder. So if we want to have pair of same types we would
>write:
>std::pair<auto{T}, T> p = f();
>Which will use deduction as:
>template<typename T>
>void foo(std::pair<T,T>);
>
>We will benefit from being able to refer to type T without use of 
>std::decay_t<decltype(p)>::first_type and have same treatment of
>multiple 
>placeholders in every context.
>
>This syntaxt can be extended to use concept names as placeholders:
>std::pair<Iterator, Iterator> f = ...;
>Will allow pair of two interator with unrelated types that fullfills 
>iterator concept. To have pair of iterator with same type only, we
>could 
>write
>std::pair<Iterator{I}, I> f = ...;
>
>-- 
>
>--- 
>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.
>Visit this group at
>http://groups.google.com/a/isocpp.org/group/std-proposals/.

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------F271HYFDCQPIQOAYFNL1WUSGZKY52W
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><p dir=3D"ltr">Again, this has already been discus=
sed. See previous emails on this thread on why you would have problems with=
 that as it is. You do not even gain total equivalence over canonical templ=
ate syntax, if that is your goal.</p>
<br><br><div class=3D"gmail_quote">On October 2, 2014 11:43:58 AM EEST, Tom=
asz &lt;tomaszkam@gmail.com&gt; wrote:<blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);=
 padding-left: 1ex;">
<div dir=3D"ltr">My proposal is that every use of placholder (today we have=
 only auto, but concept name would be a possible extension) would introduce=
 separate typename, so:<br />std::pair&lt;auto, auto&gt; p =3D f();<br /><b=
r />Would use equivalent deduction as:<br />template&lt;typename T1, typena=
me T2&gt;<br />void foo(std::pair&lt;T1, T2&gt;);<br /><br />And two differ=
ent types can be deduced. To achieve the pair of the same types I would use=
 syntax proposed in <a href=3D"http://n3878">http://www.open-std.org/JTC1/S=
C22/WG21/docs/papers/2014/n3878.pdf</a>, that allow us to introduce indenty=
fier for a type deduced from placeholder. So if we want to have pair of sam=
e types we would write:<br />std::pair&lt;auto{T}, T&gt; p =3D f();<br />Wh=
ich will use deduction as:<br />template&lt;typename T&gt;<br />void foo(st=
d::pair&lt;T,T&gt;);<br /><br />We will benefit from being able to refer to=
 type T without use of std::decay_t&lt;decltype(p)&gt;::first_type and have=
 same treatment of multiple
placeholders in every context.<br /><br />This syntaxt can be extended to u=
se concept names as placeholders:<br />std::pair&lt;Iterator, Iterator&gt; =
f =3D ...;<br />Will allow pair of two interator with unrelated types that =
fullfills iterator concept. To have pair of iterator with same type only, w=
e could write<br />std::pair&lt;Iterator{I}, I&gt; f =3D ...;<br /><br /></=
div>

<p></p>
</blockquote></div></body></html>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------F271HYFDCQPIQOAYFNL1WUSGZKY52W--


.
