220 34297 <603cdb5a-4da5-5f75-55ec-6292bd4ef229@technion.ac.il> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Eyal Rozenberg <eyalroz@technion.ac.il>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Idea: Extension of structured bindings to
 definition of structs
Date: Tue, 5 Sep 2017 00:00:35 +0200
Lines: 55
Approved: news@gmane.org
Message-ID: <603cdb5a-4da5-5f75-55ec-6292bd4ef229@technion.ac.il>
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>
 <f9ccebb4-6704-167c-5f1e-b0f58794a15d@technion.ac.il>
 <CAGg_6+MCgpaOxQBm1ees1bCJVWrh7=qWWkVKWZu3DmeMO6TvMA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1504562460 14577 195.159.176.226 (4 Sep 2017 22:01:00 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 4 Sep 2017 22:01:00 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101
 Thunderbird/56.0
To: Nevin Liber <nevin@eviloverlord.com>, std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDHKZN7LR4ARBEE2W7GQKGQET7KFPJI@isocpp.org Tue Sep 05 00:00:45 2017
Return-path: <std-proposals+bncBDHKZN7LR4ARBEE2W7GQKGQET7KFPJI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f72.google.com ([74.125.82.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDHKZN7LR4ARBEE2W7GQKGQET7KFPJI@isocpp.org>)
	id 1dozQA-0002v9-9z
	for gclcip-std-proposals@m.gmane.org; Tue, 05 Sep 2017 00:00:42 +0200
Original-Received: by mail-wm0-f72.google.com with SMTP id f4sf348915wmh.10
        for <gclcip-std-proposals@m.gmane.org>; Mon, 04 Sep 2017 15:00:49 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1504562449; cv=pass;
        d=google.com; s=arc-20160816;
        b=EYJFyL8q4OmWsEhH5WRpriZabLtMlrtEaDHEua3atUnV52NZEfX3tm917QhW+zC+FM
         fvWQ9DHQiwsOJq5IkFxsJ4uMW/Or0oMHIj1N7Lf3O63cPvzHnQVaCFOBmG0wFqXKSK7Z
         a9JSv78MTju0lJFcD5Iz430+vA9vNd8REwb73h/X7TLvHLaNb+Ts8ie+bKrEQ9n/y32d
         KTHLWiuDRYuwxUrc9E0JAvGs6aeBfrF8VpcL477BNYJRlf83FSFep2MEMD93hmKG+pwx
         TUDEfnn9pEmji/QaSXhy6QYIGvfpcopki9ygsR6045PuzC8yJVT6313SBuurMg2XKBSr
         W3wA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-transfer-encoding
         :content-language:in-reply-to:mime-version:user-agent:date
         :message-id:from:references:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=L5RO8yGDxH+voMdZHFXwFqNUuB7DGy1gJNs6dTwy59Y=;
        b=iw/tk5FIK6WUdozeIsxwLbuqFVU+N8H7TlxbekkF0pvDsK6+GCRyO5tFoJ7BXLJ6Cx
         Bg5++ErgYlra5ofZMIesWt9WgnFWR2bPhUQlsA4+kxLeZH7eHqrrjThs5Wh9jSls/lnM
         nX3Ib539xYAyJgm7R/NM33CEK0ZxYENgmeP0SLGagPjZgd7LBldwPdT8ES0lERzdJKyh
         j3JPyk83S8S0JyE7q16ynRtmtb9tRBsUj9YuROzH53Tx1r3dzdZE2dK0zD0gJBjqIXXu
         KXBd9Xcv6hYco8zSMM+0K/7k3l3c8/4gwVXAp8CJrdqaW/BMieJ3ovfAd+dSej 
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of srs0=5sp6a=af=technion.ac.il=eyalroz@cwi.nl designates 192.16.191.27 as permitted sender) smtp.mailfrom=SRS0=5SP6A=AF=technion.ac.il=eyalroz@cwi.nl
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:content-language:content-transfer-encoding
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=L5RO8yGDxH+voMdZHFXwFqNUuB7DGy1gJNs6dTwy59Y=;
        b=CS4S6ZqDnTr6nUfXPupAZUNmuuAW2VUpoq2FjBb2XDASULCVUYyie6OFpnd+HcJWN4
         +XfvWhlh16C0jdkmopDw0GTqCGmE2HuVIDGObE8u33vWx3VD9dD2Mq7C8SvC3aJQaz2A
         BTLXEw1nZbjpxxCUOJNyXrqZ4NxACx4W5y0o/GNvT3PdxEReeYmN8LfGKV/bq6euN9u/
         aWq/WrvHtLFPYw4HabhCimZS9jyR4UiHkKPgilOHjT2ib1PIiCxwStnayUzE+7qVa/MO
         d2uDwnKZra55CBebCO/xXol1QFQgN8xilb+LRudDybUdpfJotbAQeJI4MPMTXfoUYBmK
         O80 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-language
         :content-transfer-encoding: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=L5RO8yGDxH+voMdZHFXwFqNUuB7DGy1gJNs6dTwy59Y=;
        b=BI4sxZtQ/QEzQXFmT1uU1h+OUdlpeUmUH0XHqSzIednbTISkZmErQArjsx/jvNGHEs
         lDSZB4MZJuI/PLRlXm32pqcCrvyf03+DERWniPqi9RNHoIB2SPwUXk7UpvJMjQ1IpBZK
         DTlzTpGW87vqpJYexxmEM5hEmtTnwMUmPbWI5yXhSMuA5Hcq9XyugkxEDlimL5tNCUoy
         CI0X3PvTOy3gr8x20cRXEUHSoE5FPhR/yMuk+7FTXQXALGEX7uj3Fn0WlPCKrKZBjYb/
         DTWGFZ22zzsEpuGe1zJwHu0E7EPwxJXsm4vBVsx/LKY 
X-Gm-Message-State: AHPjjUgPsOSrs93W/R6p+ZK+MCE0g98ttynxlP32T3Npj3J4C6CY5nMH
	igfUERTNomzH3w==
X-Google-Smtp-Source: ADKCNb5epnsjJlzLp6tVvFgwt+Hc0VtUZiUWWQ47yGdZZly5UF1JPW5T2mOy2Lk3IyB1vSIl6mRxUw==
X-Received: by 10.28.136.212 with SMTP id k203mr209550wmd.3.1504562449619;
        Mon, 04 Sep 2017 15:00:49 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.167.65 with SMTP id q62ls1517107wme.5.canary-gmail; Mon, 04
 Sep 2017 15:00:48 -0700 (PDT)
X-Received: by 10.80.152.117 with SMTP id h50mr1508857edb.254.1504562448205;
        Mon, 04 Sep 2017 15:00:48 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1504562448; cv=none;
        d=google.com; s=arc-20160816;
        b=SUdA31psmWjJXqqslwWNzfNasko8AA7RzDTh2he45RwxFHpkAYHZY77kyPrvsiYmy3
         pvdThGh6Cu/zDWKTZWRrvx7rZBwXCXkxwg6uDg50oW/1N2lYzt03AbI1VVi00+hv6CTa
         JrLJerND2ORqBIk2kjLJH223tbvrMuK53sjBrPw9Q/P5XGBKo5dbu0zl2/qLQcfEkdhv
         OxSf1e54CDYaTRw38W79p+bEtq4fIJc2oZwTCJUzBqFq54+WkJn5/JX+l2hrHljCrtkb
         BWM/GmPMgG+Gj7s95HjQ78xRvu5aT7QTbss21Rw82l2XveW5WKGlPYsZSAPh/KC57GFF
         oIgw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:to:subject
         :arc-authentication-results;
        bh=J8pj1S8MN7+ZPeGqK8iLA/N0Kvjs0gRg6N0h9x4GTRM=;
        b=nBXgI0WFZ4bYt2mGeIBjsmQPaeADMPJ6dfj2dQr2Ii3SMzky+SFdwUBRAtLTzhVVtH
         SXhDSqEnpdOIvkJikAELArsfBBROFpFekbszKyFVMRZ6z5mF6FhKKNw9dcqLN1HZJfoG
         wjVN5KYYCNQwwa3wGgEAlMEbryY1DIJt/nATBYMPhGvELVNoGkrF12sZAImidCzDU9Zt
         LE7H/GMuAVPiCqc4B7hzv2wf4igvuqutCB3b3ZULx0F7CCtKNivabDjQSJPWA5pA4AQn
         oaFP0PwzdtQF9KjREqZxoidBUhdtmdRyZLf+vBLvbPHD9nUHn7B0AUC+W8ujgZlGOFCt
         oWQA==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of srs0=5sp6a=af=technion.ac.il=eyalroz@cwi.nl designates 192.16.191.27 as permitted sender) smtp.mailfrom=SRS0=5SP6A=AF=technion.ac.il=eyalroz@cwi.nl
Original-Received: from fester.cwi.nl (fester.cwi.nl. [192.16.191.27])
        by mx.google.com with ESMTPS id z55si8586241edb.21.2017.09.04.15.00.48
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 04 Sep 2017 15:00:48 -0700 (PDT)
Received-SPF: pass (google.com: domain of srs0=5sp6a=af=technion.ac.il=eyalroz@cwi.nl designates 192.16.191.27 as permitted sender) client-ip=192.16.191.27;
Original-Received: from fester.cwi.nl (fester.cwi.nl [192.16.191.27])
	by fester.cwi.nl (8.14.4/8.12.3) with ESMTP id v84M0gBd032432;
	Tue, 5 Sep 2017 00:00:42 +0200
Original-Received: from [192.168.2.1] (ip565d4370.direct-adsl.nl [86.93.67.112] (may be forged))
	(authenticated bits=0)
	by fester.cwi.nl (8.14.4/8.12.3) with ESMTP id v84M0emG032430
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
	Tue, 5 Sep 2017 00:00:41 +0200
In-Reply-To: <CAGg_6+MCgpaOxQBm1ees1bCJVWrh7=qWWkVKWZu3DmeMO6TvMA@mail.gmail.com>
Content-Language: en-US
X-Original-Sender: eyalroz@technion.ac.il
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of srs0=5sp6a=af=technion.ac.il=eyalroz@cwi.nl designates
 192.16.191.27 as permitted sender) smtp.mailfrom=SRS0=5SP6A=AF=technion.ac.il=eyalroz@cwi.nl
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:34297
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34297>

Please read my answer to Nicol Bolas.

To reiterate briefly:

I don't want to do any of those things. I would use this struct's=20
members, and they're in a struct to indicate that they're related and to=20
name them together.

More importantly, I would have the person reading my code go "Oh, so=20
he's using parts of the car" rather than have to to keep track of the=20
relation of the loose variables in his/her mind.

(This especially true if my function was named scavage_junkyard() rather=20
than get_car_parts() ).

Eyal

On 9/4/17 9:04 PM, Nevin Liber wrote:
> On Mon, Sep 4, 2017 at 9:16 AM, Eyal Rozenberg <eyalroz@technion.ac.il=20
> <mailto:eyalroz@technion.ac.il>> wrote:
>=20
>     I'm not actually suggesting a new way to create a type. The type is
>     created anyway if I write:
>=20
>      =C2=A0 struct {
>      =C2=A0 =C2=A0 =C2=A0 decltype(std::get<0>(get_car_parts())) engine;
>      =C2=A0 =C2=A0 =C2=A0 decltype(std::get<0>(get_car_parts())) dashboar=
d;
>      =C2=A0 =C2=A0 =C2=A0 decltype(std::get<0>(get_car_parts())) stickshi=
ft;
>      =C2=A0 } car_parts =3D get_car_parts();
>=20
>=20
> Syntactic sugar or not, what can you do with an object of that type? =20
> You can either:
>=20
>   * Pass it to a templated function
>   * Capture it in a lambda
>=20
> As I stated before, that usage seems fairly marginal and not worth a=20
> language feature.
> --=20
>  =C2=A0Nevin ":-)" Liber=C2=A0 <mailto:nevin@eviloverlord.com=20
> <mailto:nevin@eviloverlord.com>> =C2=A0+1-847-691-1404

--=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/603cdb5a-4da5-5f75-55ec-6292bd4ef229%40technion.=
ac.il.

.
