220 34159 <f0a5b11a-7fb8-4243-a8c2-51a6aaaaf1d5@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Curious <rmn100@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Structured bindings with polymorphic lambdas
Date: Sat, 26 Aug 2017 14:54:48 -0700 (PDT)
Lines: 138
Approved: news@gmane.org
Message-ID: <f0a5b11a-7fb8-4243-a8c2-51a6aaaaf1d5@isocpp.org>
References: <b8d14aa1-adcb-41d9-8fe8-d70805927161@isocpp.org>
 <8497b31b-7c9d-4334-ac22-0809c958cb93@isocpp.org> <15a70d94-e039-4f82-ba01-bde9d3fbacbd@isocpp.org>
 <CAGsORuDZ=TVXNXr5NfZv-fry_kCRkmp_0+kNy59EqoRgr_BzPg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4823_1053186380.1503784489073"
X-Trace: blaine.gmane.org 1503784493 13331 195.159.176.226 (26 Aug 2017 21:54:53 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 26 Aug 2017 21:54:53 +0000 (UTC)
Cc: rmn100@gmail.com, zy@miator.net
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCNP5RVE2QIBBKO4Q7GQKGQE5YQ7SQI@isocpp.org Sat Aug 26 23:54:49 2017
Return-path: <std-proposals+bncBCNP5RVE2QIBBKO4Q7GQKGQE5YQ7SQI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f197.google.com ([209.85.223.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCNP5RVE2QIBBKO4Q7GQKGQE5YQ7SQI@isocpp.org>)
	id 1dlj2S-0002xw-JS
	for gclcip-std-proposals@m.gmane.org; Sat, 26 Aug 2017 23:54:44 +0200
Original-Received: by mail-io0-f197.google.com with SMTP id c18sf26765602ioj.3
        for <gclcip-std-proposals@m.gmane.org>; Sat, 26 Aug 2017 14:54:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=zMZoaPF9eYG2Ef4Eg8zhdm+3bqAM0z89ueAfG2+VQQo=;
        b=z1wnfxdi1kFCldrz65IwiKwiWqfzFZQzyPpgbd7Q/+xvR/pbgT96yz9dceJRjpzrpJ
         HjoJapgKlAGBnyJ7VwCXmayw598kKhgk4Ju21lOeAA5bHEB4GXoG6LVRjhbUv+wTlXHX
         kECRuir3pPXhGm95l3j7oddadUkFCLkBTajRASq8P1Z01q5+cA6QfFUMtrNx1h+4hI5z
         zXTV4f0LJ03Eayx49MWHnpocgfhwVvqc7xm2BZ3CqPFFUQ70l3cb7AEmHl/U65qrvvoq
         5dIgRjOra3qLb6GNHWzjmP7lw/dXc7yDbQ4qEDB6Dmi8+rLdlfWjRLM34vKvIYXY7HRw
         NgAg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=zMZoaPF9eYG2Ef4Eg8zhdm+3bqAM0z89ueAfG2+VQQo=;
        b=Av0FVUikcsXySVWlrHol/oKTkS33JZJcKWFxoPWFor+CiqjXsJfxkRWGDElcWo+Q/L
         Z8XmwRtqL+8g4IYiRLS7xlq/WoovRAF+NKgm1b2Od0Tqvstk5xiKbVTsOBeeX+m146Zl
         ++AuVoDhuzy4Pfkqxs7Z62bc2QjlVJorT+wmme3hQjSHjTjSVS/17ddpyjlm3LbEAa/h
         mHJCYQUyPwvyES4x/QFhX8HFkXJ69XuUQ3T7nb8e1GicdkhIvU1JifH8Oa9uHajr4kNN
         wYDAoFXkySXfE7atjCrwwUnAC6uze96ORDjHao7LYwrx29P3QoU2VdeesWslheJCbpol
         22yA==
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:cc: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=zMZoaPF9eYG2Ef4Eg8zhdm+3bqAM0z89ueAfG2+VQQo=;
        b=S38u+vvSbsZYEJUUzMzwzNFBhDjmbogad2AUX5fJ1ETp+w3kh+ccp/ozopf1U1XmTT
         nvWI6eK8nLOvlpDMeTTOjxnDTJmdNy/76GbGw+VMLmTaK0+Dr5bwKSBshhubCiv04eZY
         X9gDoUeEc6a4PJNTT2kminawk1zDzhZmigpyEQIP6nOmTXKSYm8w3ELlTYM+s4doO/wc
         4gPeHkx+PhFI0N3ht7+j1sNXepAzCO22i52XVsc+699TO9LRK6N2FkzML8iUXGAUcz4d
         ff3x6Qd6f6DbLGOw+N+WOSq2jS0lH2AymsApyJbAHM+AAbZEXsPTONt287MVtm8UuUkE
         XsjA==
X-Gm-Message-State: AHYfb5jf4GPprSTqn5Pz2lNjjky43JFN6R5ColM4Y+xet1cIORprrRof
	37P8p2t9eAEclqg/
X-Received: by 10.107.16.77 with SMTP id y74mr1981917ioi.126.1503784490804;
        Sat, 26 Aug 2017 14:54:50 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.142.67 with SMTP id q64ls7633299iod.47.gmail; Sat, 26 Aug
 2017 14:54:49 -0700 (PDT)
X-Received: by 10.31.160.13 with SMTP id j13mr29148vke.25.1503784489541;
        Sat, 26 Aug 2017 14:54:49 -0700 (PDT)
In-Reply-To: <CAGsORuDZ=TVXNXr5NfZv-fry_kCRkmp_0+kNy59EqoRgr_BzPg@mail.gmail.com>
X-Original-Sender: rmn100@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:34159
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34159>

------=_Part_4823_1053186380.1503784489073
Content-Type: multipart/alternative; 
	boundary="----=_Part_4824_639189993.1503784489073"

------=_Part_4824_639189993.1503784489073
Content-Type: text/plain; charset="UTF-8"

Yeah I intentionally defined it like that.  In the expansion of the lambda 
the copy-init (if any) happens before the decomposition; the actual 
decomposition step happens inside the body of the function.  This also fits 
the scope visibility issue that I mentioned.  Did I leave something 
specified ambiguously?

On Saturday, 26 August 2017 14:07:31 UTC-7, Zhihao Yuan wrote:
>
> On Fri, Aug 25, 2017 at 2:19 PM, Curious <rmn...@gmail.com <javascript:>> 
> wrote: 
> > 
> >> Also, now you need to explicitly specify the order in which these 
> >> decompositions happen. That is, if you have two structured binding 
> >> parameters, which one gets decomposed first? At the very least, you 
> should 
> >> explicitly state that there is no order. 
> > 
> >  In my mind they should follow the same order as for a regular function, 
> > with the decompositions happening in the same order as constructions of 
> the 
> > parameters. 
> > 
>
> In your latest draft, you choose to decompose inside 
> function body, so I have a further suggestion: entirely 
> split the decomposition step from the parameter 
> copy-init step and define the decomposition order 
> to be left-to-right. 
>
>   [] (auto [a, b] /* underlying object x */, 
>       auto [c, d] /* underlying object y */) {...} 
>
> When invoking this function, copy-init x and y in 
> unspecific order, then decompose x into a and b, 
> then decompose y into c and d.  This can further 
> simplify the model, because that will be no difference 
> from 
>
>   [] (auto x, auto y) {...} 
>
> from the caller's point of view. 
>
> -- 
> Zhihao Yuan, ID lichray 
> The best way to predict the future is to invent it. 
> _______________________________________________ 
>

-- 
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/f0a5b11a-7fb8-4243-a8c2-51a6aaaaf1d5%40isocpp.org.

------=_Part_4824_639189993.1503784489073
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yeah I intentionally defined it like that. =C2=A0In the ex=
pansion of the lambda the copy-init (if any) happens before the decompositi=
on; the actual decomposition step happens inside the body of the function. =
=C2=A0This also fits the scope visibility issue that I mentioned. =C2=A0Did=
 I leave something specified ambiguously?<div><br>On Saturday, 26 August 20=
17 14:07:31 UTC-7, Zhihao Yuan  wrote:<blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left=
: 1ex;">On Fri, Aug 25, 2017 at 2:19 PM, Curious &lt;<a href=3D"javascript:=
" target=3D"_blank" gdf-obfuscated-mailto=3D"qC4mgfQNDAAJ" rel=3D"nofollow"=
 onmousedown=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"=
this.href=3D&#39;javascript:&#39;;return true;">rmn...@gmail.com</a>&gt; wr=
ote:
<br>&gt;
<br>&gt;&gt; Also, now you need to explicitly specify the order in which th=
ese
<br>&gt;&gt; decompositions happen. That is, if you have two structured bin=
ding
<br>&gt;&gt; parameters, which one gets decomposed first? At the very least=
, you should
<br>&gt;&gt; explicitly state that there is no order.
<br>&gt;
<br>&gt; =C2=A0In my mind they should follow the same order as for a regula=
r function,
<br>&gt; with the decompositions happening in the same order as constructio=
ns of the
<br>&gt; parameters.
<br>&gt;
<br>
<br>In your latest draft, you choose to decompose inside
<br>function body, so I have a further suggestion: entirely
<br>split the decomposition step from the parameter
<br>copy-init step and define the decomposition order
<br>to be left-to-right.
<br>
<br>=C2=A0 [] (auto [a, b] /* underlying object x */,
<br>=C2=A0 =C2=A0 =C2=A0 auto [c, d] /* underlying object y */) {...}
<br>
<br>When invoking this function, copy-init x and y in
<br>unspecific order, then decompose x into a and b,
<br>then decompose y into c and d. =C2=A0This can further
<br>simplify the model, because that will be no difference
<br>from
<br>
<br>=C2=A0 [] (auto x, auto y) {...}
<br>
<br>from the caller&#39;s point of view.
<br>
<br>--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_________________
<br></blockquote></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/f0a5b11a-7fb8-4243-a8c2-51a6aaaaf1d5%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f0a5b11a-7fb8-4243-a8c2-51a6aaaaf1d5=
%40isocpp.org</a>.<br />

------=_Part_4824_639189993.1503784489073--

------=_Part_4823_1053186380.1503784489073--

.
