220 32492 <CAFk2RUY1AYOen-Rb8n6yzc1jsOiydbUCUDqLdKMPyiyiHnnO4w@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Allow Structured Binding Outside of Variable Declaration
Date: Tue, 16 May 2017 20:35:52 +0300
Lines: 36
Approved: news@gmane.org
Message-ID: <CAFk2RUY1AYOen-Rb8n6yzc1jsOiydbUCUDqLdKMPyiyiHnnO4w@mail.gmail.com>
References: <e02d79e8-7d80-4614-bd25-e73fb43dad9d@isocpp.org>
 <10b21241-b683-44d5-82ce-90681b2643a4@isocpp.org> <CAFk2RUbf5skMEcsLd_hUiZrib2bGCvyrJbgsx9LV-rXaj=fBZw@mail.gmail.com>
 <CAFk2RUbgg7UMc_mFGKQZF7-PVVbEDsdoZoXL46oyxr+PLRTfvw@mail.gmail.com>
 <08ff73f1-6989-393e-ee4e-8158af2e7bed@honermann.net> <CAFk2RUaBhq7KVukgRMvqBMuBiBwZmCf+xZpD9jRtBberFoU2Rg@mail.gmail.com>
 <c70b0cd6-fa3e-d215-3fef-06eb231ed3cd@honermann.net> <CAFk2RUbiUZ4n_mXdBUTGEZSsh5C=Mf0hKbKu76PKzCCWnZfrgA@mail.gmail.com>
 <d184a83a-4f99-a8d2-6bba-1b8aeedd797c@honermann.net> <20170516164245.GA16348@fukushima.lysator.liu.se>
 <ffcb4ca3-5fb8-41b4-8b38-cfd287148cd5@honermann.net>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1494956153 4917 195.159.176.226 (16 May 2017 17:35:53 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 16 May 2017 17:35:53 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRB6PQ5TEAKGQE7C6WSSY@isocpp.org Tue May 16 19:35:48 2017
Return-path: <std-proposals+bncBC5JHI7A7ALRB6PQ5TEAKGQE7C6WSSY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f200.google.com ([209.85.213.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRB6PQ5TEAKGQE7C6WSSY@isocpp.org>)
	id 1dAgNw-000196-FF
	for gclcip-std-proposals@m.gmane.org; Tue, 16 May 2017 19:35:48 +0200
Original-Received: by mail-yb0-f200.google.com with SMTP id t11sf102909971yba.13
        for <gclcip-std-proposals@m.gmane.org>; Tue, 16 May 2017 10:35:54 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1494956153; cv=pass;
        d=google.com; s=arc-20160816;
        b=s0VeTcpLsPs066P6W4OEVY6OtrDIC7n4ffCFwm4Gk/8QG1fEnCae8HVp9Bb0TdtqZx
         SDIHzx1N3xk3xdD18uzHyWtN7dy3X4f2W2z1lKiOVaaJJAi8vXeDrHWgeY1FiNi3dKAl
         XW3F50/F9rX6sHSstr3Z2ejgJeiyX6oZBNRrVCXbz1XeX4K4ysRnHGeS6RLsIRbuRAzi
         76Rq6ohWQaQAfuB77zinm9P57FkTLFd8dwHKiUQrqVyb+y6tnJKoueGgmAmKptAZpLwt
         bx03AV3CReIdJ4uvyTcMA5nEKDa3AKciOLkkVGmxchcxw+aFXSsByFrnw7B8xsFMumtt
         8/Ag==
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:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=VouSRnexW0TAfjMUyxfFd1zolVGa+FHlQxExw3+e2Qs=;
        b=BsHE2AXw0yt7HOV1s+ip7qG9q1HFFzYoXsqoOLfQgL68SkhLj5o3Z1NQSzjQrdxJKK
         Sz5zzZZWKansQgab6ntPxEzymkryubKSEWdx0SzvuJi360tnxS1GjB8a8OxLl2fB/nfG
         COgO3FVU1PEzbMYzCeTTbVWieimf7Ff6Y80VGWiv6S32MAw5VhUJCmaEMMOITwPYaxth
         IuhJA8I/iSV70c1XVsu5xXrFYPhdrdB+xaGpOIqIhWdIt2OlBTqJlozYKIPKcOUu1PIx
         ABvlEZddNFycqairwc1YTbX7j//LsUD3HxwTDCKXHSe8Xoi7m/fLAtzOI+rfrCNEoIGz
         IY9Q==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com;
       spf=pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :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=VouSRnexW0TAfjMUyxfFd1zolVGa+FHlQxExw3+e2Qs=;
        b=x297+JIxgA6aE49pODZ+91XIMvQuYaaVMladL/yHDwIYwpAxiWA/2gaeksUFjhtHLI
         sH1BX46KwJhRQh2xytlD+0X5W++5JY7RGud/7/iW24OIDfSwVErsMKWdvUl6r+vknfv2
         esMcsvhdozX+4uXEK0ZR4ON31dcCIAeDpoZqes1iHwVSwq9/EA8G4klK4sCYBIyorUK5
         qRJsEyYvxGBEhfLrlHvRbT9oPX7ijDd///vPCsrMt9DQ3xy4accez+t7mKWdraMc2JaK
         43+zbkiujU+KujD6zveAR3SEOiBZ3JvTP301jsh8ciNYedQZiFsVv4gaGAQRS/w39Bdt
         v8rQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to: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=VouSRnexW0TAfjMUyxfFd1zolVGa+FHlQxExw3+e2Qs=;
        b=kvFg9fA2QcvqRo55eIDN9fQwwcboCce49j85csQYYjDqTcrMWnYoch8I+ec7yXoZ0P
         /9qdj/o+zTuoCrvcHeZCgK5/GM9MRpEnm8/SYtW/iivS5HSqtKJ+jqaoYrgBGby8nJdF
         pGO0zLXhfp0tEWikJMNfzewMahsR72c68sTrSmLzCoygw7RcUScn66o6hx5bvG9UvWSK
         OihVVnoIiatU/WzksUBcxGiP+zVPKD8Yb8O+uOEWbsJvKQPr83uB9MDfIW+8g3ZLoPJW
         k3kiR65XZdyNaU16Ogum/zG2uyJPaBjrbH/8nk/hDGZfnLSLqUijDU5AQKN0sPkxdxzW
         xxGg==
X-Gm-Message-State: AODbwcDELnBVgny4uowmJpbibAOiJnIm4It+soaVSM7ID5t0HpUrSbwM
	aU6Ks3VaCdDlUQ==
X-Received: by 10.13.208.6 with SMTP id s6mr5659091ywd.154.1494956153877;
        Tue, 16 May 2017 10:35:53 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.37.76 with SMTP id j12ls2003548otd.27.gmail; Tue, 16 May
 2017 10:35:53 -0700 (PDT)
X-Received: by 10.202.223.70 with SMTP id w67mr2265021oig.124.1494956153051;
        Tue, 16 May 2017 10:35:53 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1494956153; cv=none;
        d=google.com; s=arc-20160816;
        b=l0/XToXRG9wTBYE56l1/zLZRKX97WgSft6E386zywrMn9ZRbRTr11oEUVVndsJUYwp
         dj+QYCul96u57A5s6CXgka8QsYD4AToPJW2VdZ87ZC4q1/4piIvSE9TM3peSVvtuFDjK
         bOJs4XaX44h4b/W4k6HD7xSOPqJHN3zcdWwIsVOHT3px/LbE68dQO5C+M8Lj0ESl9rlQ
         dBViEUusx08Wtu/rmCyZLF9C+2+mKr+z8rDOfFKq2RSWuZOew/ewPrKRB77G1N+Ehk7B
         zYWmGpy3AgWwcjxzQ5+L7uq9sMYyDglDYCW3XgNq5DmckGClB3I6qK+8qCmfOZabzWgQ
         RVkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=Rx+UWjd4CnNR02lHFmlgy1oQKaFlusrAIE7nMeuCeSQ=;
        b=bR7O/PHYMZBswWEJwVAPH0HqT+frskR2YAtmKBlchPRFggeHNjVa7hPETNL2yu2Rcj
         42yitkruQ3m/b7NH0CfZ1elu2i0DqYn7QmY2/Lux8ff2BkiKjzeM1MqpYrcT9WnkhKAQ
         Ywl88W8y4htc1W+Czr4LJdjbp0beCOegVR9wa3C/t5jbUnJD2gP10p0QVNezXL+FWrKh
         vS3mlVtqtNqtgbAoz+CKW2hLzKUrdwFYmjTgpmxHNI/6rYZGfUnxmJcAxeEMOkyDBERo
         Cid/TqHdFwvjwbKne5KM5rV6UO8jfoWUBfQyVUEDkKfWKdlXgkKRrmdlMgISwnZ2T6M8
         OF3A==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com;
       spf=pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com. [2607:f8b0:4003:c06::234])
        by mx.google.com with ESMTPS id f124si1187684oig.186.2017.05.16.10.35.53
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 16 May 2017 10:35:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender) client-ip=2607:f8b0:4003:c06::234;
Original-Received: by mail-oi0-x234.google.com with SMTP id l18so34590634oig.2
        for <std-proposals@isocpp.org>; Tue, 16 May 2017 10:35:53 -0700 (PDT)
X-Received: by 10.202.226.85 with SMTP id z82mr2242457oig.183.1494956152606;
 Tue, 16 May 2017 10:35:52 -0700 (PDT)
Original-Received: by 10.157.17.253 with HTTP; Tue, 16 May 2017 10:35:52 -0700 (PDT)
In-Reply-To: <ffcb4ca3-5fb8-41b4-8b38-cfd287148cd5@honermann.net>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 ville.voutilainen@gmail.com designates 2607:f8b0:4003:c06::234 as permitted
 sender) smtp.mailfrom=ville.voutilainen@gmail.com;       dmarc=pass (p=NONE
 sp=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: <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:32492
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32492>

On 16 May 2017 at 20:01, Tom Honermann <tom@honermann.net> wrote:
>> What is wrong with the good old way?
>>
>> auto [SomeType x, =k->Key] = parseKey();
>
>
> There is the question of what happens if the decomposed type of the matching
> element is not reference compatible with type 'SomeType'. Ill-formed?  Does
> 'x' change from being a structured binding to a variable of the declared
> type?  If so, are conversions performed? What type is decltype(x) and does

Why on earth would it change from being a structured binding to something else?

> it depend on the type of the matching element?  A syntax that indicates a
> type constraint (which is, I think, what is desired regardless of the syntax
> used) rather than a variable declaration avoids these questions.


Funny, such "type constraints" were something I always considered to
be an integral and fundamental
part of variable declarations. I don't write

auto x = foo(); static_assert(is_same_v<decltype(x), int>);

but for some reason it's been suggested that I should do that for
structured bindings, conveniently forgetting
that then I will need to put that "type constraint" far far away from
my structured bindings, like into a for-loop body
when the structured binding is in the loop header.

-- 
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/CAFk2RUY1AYOen-Rb8n6yzc1jsOiydbUCUDqLdKMPyiyiHnnO4w%40mail.gmail.com.

.
