220 34275 <4b5d3a6b-dbbc-4685-9cd5-7eb02b92db63@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Idea: Extension of structured bindings to
 definition of structs
Date: Sat, 2 Sep 2017 07:12:05 -0700 (PDT)
Lines: 127
Approved: news@gmane.org
Message-ID: <4b5d3a6b-dbbc-4685-9cd5-7eb02b92db63@isocpp.org>
References: <59dcbbbc-c536-4b7b-9c88-0638fb0cd58a@technion.ac.il>
 <7b9bf263-d3ca-42bf-aed6-4c7606782a28@isocpp.org>
 <1762295.OciJaA9sdk@tjmaciei-mobl1>
 <ff2ceb41-caca-4659-9a7d-4da9c2046810@isocpp.org>
 <74349bfe-bb5a-a2ce-4142-5d46103d1d9f@technion.ac.il>
 <CAGg_6+MPQTnqdWLQ1UV8jF173jDXYQQx-abwwNV3v3iknocJ=Q@mail.gmail.com>
 <oodqev$t5m$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2188_1456321742.1504361525594"
X-Trace: blaine.gmane.org 1504361552 28104 195.159.176.226 (2 Sep 2017 14:12:32 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 2 Sep 2017 14:12:32 +0000 (UTC)
Cc: cppljevans@suddenlink.net
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBNXYVLGQKGQEO3APYCI@isocpp.org Sat Sep 02 16:12:18 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBNXYVLGQKGQEO3APYCI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f71.google.com ([209.85.213.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBNXYVLGQKGQEO3APYCI@isocpp.org>)
	id 1do99U-0005qE-Q2
	for gclcip-std-proposals@m.gmane.org; Sat, 02 Sep 2017 16:12:00 +0200
Original-Received: by mail-vk0-f71.google.com with SMTP id c82sf2157054vkd.14
        for <gclcip-std-proposals@m.gmane.org>; Sat, 02 Sep 2017 07:12:08 -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=w+tDgSxsEjXGjBTZ9hYsKoZ7MPUd82i22yJNwDigtV4=;
        b=qMz5aFU9OlJSEUB2fu2DMFJdWSPVDgyfFzFc9dG4xJ7nPKyKYvkFsueV7T8k60FmPh
         eIVY+GYbGyv0O4iT4IQUIvYeOYzLazUoBl7zeYZeexO8vO7SkOoajUKcLdRmvbvMHro3
         kVbIu1mYLYXzlwcKHAbqu7r61VGdbBKjTYh7PNP7fcNxj49hTZkAeg03TT1bxgpUSjd9
         VRxef4T4WkQKhC9bNhwDQgk7R+tgo0x39Ab1qZvZwk3hS5ziLqucFWUOewwA/f94UL2P
         s76Q7OhQxwVTgo76Vdha/pGAAv09uyQVhPxkq4/DpDvxDOb5hqADUDrrflk7m5A0dJBC
         3WjA==
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=w+tDgSxsEjXGjBTZ9hYsKoZ7MPUd82i22yJNwDigtV4=;
        b=uoo9l0ahzuqfta07OgY/p1gMAvrusJmrXfEO3K1YCyAqPNUMCRyCLOKoepsIv1KXkP
         X6CY4vJsW1uEPccvrTVOuA3pbDNpLlQ0CdE3sp9gvQeMjcX9DlxNlpIJtv/UHUWxgfb+
         1Yi6tbz4yvcM/tYqFCYRIrlxif8YbIztawYheynwrY5UDIAIc0/VW7dmHiUxuMZHSPdn
         CtczDb7ez73WgDLliZ+H4/vPqLiyVWnonw8L42Wk/ZImjbNbhOeP/shZZHK9golapgBd
         VDkF6x9I0y6dgZ0gFDGEd6W7X5iRFsGEKeXxwF1F4UreTd7Zl69+FmS8WMdpmzRUNYT9
         SLIw==
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=w+tDgSxsEjXGjBTZ9hYsKoZ7MPUd82i22yJNwDigtV4=;
        b=TLL4CV4Tu2STC9i61G53MsQHtkfBr43vbzFsgNddpYEkjPVHXwk8pEhWjjFT76LPv4
         6QF4/6T0PdSYCvZSEx0ewtiOOvVfgKcd8JY8VQZqV+RzAM9e7EuVTlTgLfs8Owgvi0hI
         Juxo94vCmFU0yyZX8OVJ9GIcTHCk7qHw0Vfqr1CWwV9JUxL+IdJQkx+5GdqhhhVmYhXI
         bRfPjzbyOwhfmdZf0PQFq/K1TBjbibCdgoqW+/F13c02Txh6OgDLe2B63vHbM/RleUCV
         hXc1kB7LgzkW2DR6/rLH2eLmzxPeqLyjqsaPjX7/sAQEkJfn/FlqBYfu6G0yQyB4vRun
         jBPQ==
X-Gm-Message-State: AHYfb5hR0jKLbGnmuieIa0kKtJT3FHzvarPBCgYn1gOnSKJOJNglzveH
	njPVcaifG1t/hEYo
X-Google-Smtp-Source: ADKCNb7ZTFS9kvyBrPEx/6Osoqdk2d1Du7YWHHR/ElJlkLE/x5uliVf+2v3Wa5eRbyyLY8LykZ0gtw==
X-Received: by 10.176.5.4 with SMTP id 4mr7182171uax.54.1504361527457;
        Sat, 02 Sep 2017 07:12:07 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.120.77 with SMTP id p74ls1236444itc.2.canary-gmail; Sat, 02
 Sep 2017 07:12:06 -0700 (PDT)
X-Received: by 10.31.150.150 with SMTP id y144mr104942vkd.29.1504361526085;
        Sat, 02 Sep 2017 07:12:06 -0700 (PDT)
In-Reply-To: <oodqev$t5m$1@blaine.gmane.org>
X-Original-Sender: jmckesson@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:34275
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34275>

------=_Part_2188_1456321742.1504361525594
Content-Type: multipart/alternative; 
	boundary="----=_Part_2189_2126878340.1504361525595"

------=_Part_2189_2126878340.1504361525595
Content-Type: text/plain; charset="UTF-8"

On Saturday, September 2, 2017 at 4:35:24 AM UTC-4, Larry Evans wrote:
>
> On 08/30/2017 10:16 AM, Nevin Liber wrote: 
> > On Wed, Aug 30, 2017 at 2:59 AM, Eyal Rozenberg <eya...@technion.ac.il 
> <javascript:>> 
> > wrote: 
> > 
> >> You would be using an unnamed struct for the same reason you use an 
> >> "unnamed type" for non-struct variables with auto. We write: 
> >> 
> >>    auto x = expr; 
> >> 
> > 
> > Even though you don't spell it out, that type already has a name.  auto 
> > doesn't create a new type. 
> > 
> > You are proposing yet another syntax to create a new type.  As for its 
> use, 
> > about the only thing you can do with it is pass it to a template 
> function 
> > (or equivalent).  That use seems fairly marginal.  You need much better 
> > usage examples for motivation. 
> > 
> Boost spirit has a macro, BOOST_FUSION_ADAPT_STRUCT, which maps a tuple 
> to a struct, as explained here: 
>
>
> http://ciere.com/cppnow15/x3_docs/spirit/tutorials/employee___parsing_into_structs.html 
>
> What the OP is proposing *seems* to obviate the need for 
> BOOST_FUSION_ADAPT_STRUCT. 
>

P0648 <http://wg21.link/P0648> would do so far more effectively. And far 
more *directly*, without having to create a new type.

-- 
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/4b5d3a6b-dbbc-4685-9cd5-7eb02b92db63%40isocpp.org.

------=_Part_2189_2126878340.1504361525595
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Saturday, September 2, 2017 at 4:35:24 AM UTC-4, Larry =
Evans wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;" zoompage-fontsize=
=3D"13">On 08/30/2017 10:16 AM, Nevin Liber wrote:
<br>&gt; On Wed, Aug 30, 2017 at 2:59 AM, Eyal Rozenberg &lt;<a href=3D"jav=
ascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"a3nOsw06AAAJ" rel=3D"n=
ofollow" onmousedown=3D"this.href=3D&#39;javascript:&#39;;return true;" onc=
lick=3D"this.href=3D&#39;javascript:&#39;;return true;" zoompage-fontsize=
=3D"13">eya...@technion.ac.il</a>&gt;
<br>&gt; wrote:
<br>&gt;=20
<br>&gt;&gt; You would be using an unnamed struct for the same reason you u=
se an
<br>&gt;&gt; &quot;unnamed type&quot; for non-struct variables with auto. W=
e write:
<br>&gt;&gt;
<br>&gt;&gt; =C2=A0 =C2=A0auto x =3D expr;
<br>&gt;&gt;
<br>&gt;=20
<br>&gt; Even though you don&#39;t spell it out, that type already has a na=
me. =C2=A0auto
<br>&gt; doesn&#39;t create a new type.
<br>&gt;=20
<br>&gt; You are proposing yet another syntax to create a new type. =C2=A0A=
s for its use,
<br>&gt; about the only thing you can do with it is pass it to a template f=
unction
<br>&gt; (or equivalent). =C2=A0That use seems fairly marginal. =C2=A0You n=
eed much better
<br>&gt; usage examples for motivation.
<br>&gt;=20
<br>Boost spirit has a macro, BOOST_FUSION_ADAPT_STRUCT, which maps a tuple
<br>to a struct, as explained here:
<br>
<br><a href=3D"http://ciere.com/cppnow15/x3_docs/spirit/tutorials/employee_=
__parsing_into_structs.html" target=3D"_blank" rel=3D"nofollow" onmousedown=
=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fciere.com%=
2Fcppnow15%2Fx3_docs%2Fspirit%2Ftutorials%2Femployee___parsing_into_structs=
..html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHH3CjrXtV-zxUoCpCLRYRswj8_-w&=
#39;;return true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\=
x3dhttp%3A%2F%2Fciere.com%2Fcppnow15%2Fx3_docs%2Fspirit%2Ftutorials%2Femplo=
yee___parsing_into_structs.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHH3=
CjrXtV-zxUoCpCLRYRswj8_-w&#39;;return true;" zoompage-fontsize=3D"13">http:=
//ciere.com/cppnow15/x3_<wbr>docs/spirit/tutorials/<wbr>employee___parsing_=
into_<wbr>structs.html</a>
<br>
<br>What the OP is proposing *seems* to obviate the need for
<br>BOOST_FUSION_ADAPT_STRUCT.
<br></blockquote><div zoompage-fontsize=3D"13"><br></div><div zoompage-font=
size=3D"13"><a href=3D"http://wg21.link/P0648" zoompage-fontsize=3D"13">P06=
48</a> would do so far more effectively. And far more <i zoompage-fontsize=
=3D"13">directly</i>, without having to create a new type.<br></div><br></d=
iv>

<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/4b5d3a6b-dbbc-4685-9cd5-7eb02b92db63%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4b5d3a6b-dbbc-4685-9cd5-7eb02b92db63=
%40isocpp.org</a>.<br />

------=_Part_2189_2126878340.1504361525595--

------=_Part_2188_1456321742.1504361525594--

.
