220 5226 <CAOfiQq=k=XeS3GNAB96DJj9fw8-dZJG=5EDSeHDKuGCBJvKhVA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: brace-intialization and C++14 generalized lambda capture
Date: Tue, 25 Jun 2013 17:20:57 -0700
Lines: 78
Approved: news@gmane.org
Message-ID: <CAOfiQq=k=XeS3GNAB96DJj9fw8-dZJG=5EDSeHDKuGCBJvKhVA@mail.gmail.com>
References: <10c2a060-47cc-47bc-9114-c599c4986f4f@isocpp.org>
	<CAOfiQqmb5k3rUeJ+eAFRnHPX7oGhqC5faw_q+xTh0DDrnDY_LA@mail.gmail.com>
	<CAFk2RUZ3mgKY2GH+03SOABmYvBBpBwh-9LYqodqdYZYoGDg4mw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1372206058 2733 80.91.229.3 (26 Jun 2013 00:20:58 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 26 Jun 2013 00:20:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBB2XHVCHAKGQE2MAXB4Q@isocpp.org Wed Jun 26 02:21:01 2013
Return-path: <std-proposals+bncBDVNBJG4YAIBB2XHVCHAKGQE2MAXB4Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vc0-f198.google.com ([209.85.220.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBB2XHVCHAKGQE2MAXB4Q@isocpp.org>)
	id 1UrdTn-0006v0-Cp
	for gclcip-std-proposals@m.gmane.org; Wed, 26 Jun 2013 02:20:59 +0200
Original-Received: by mail-vc0-f198.google.com with SMTP id hf12sf1646572vcb.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 25 Jun 2013 17:20:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:sender:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type
         :content-transfer-encoding;
        bh=t14ghUCZ7IKhPtZIT7bAvIpbcABMj8WEUP8UKysisb4=;
        b=uunWOzih/ydh1b6EiTQfqpArqTaSQCRonrs/fOSWD4YtY9LDMLRfzWFxDz2TSa2abQ
         kcLJl25nzXZ0fknMXpZQfsGd1LOuZ5p+pw8YjA9f9flng4GUUPuZW/a4R03OIi3lDEle
         d6XXpCw9iMrh3pukvMTeJTMVVths3EV9/h7CGe9oPmcqGqz44/B0FIIaW5ROs+hXAJ2x
         jjQZtg3bNqaAiCv4X4jc7eiy2t2esTiJ1TpCNakUlRATBSYGLfcAb4a5bVirbLCyguBz
         RTNXKlpdemrHRiDaI80z7C5bzcRylJO3BLnj3YqDUrjHuEUtAFSFrp67DivS/xLDl4Ip
     
X-Received: by 10.224.86.200 with SMTP id t8mr1959313qal.0.1372206058544;
        Tue, 25 Jun 2013 17:20:58 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.108.74 with SMTP id hi10ls265159qeb.50.gmail; Tue, 25 Jun
 2013 17:20:57 -0700 (PDT)
X-Received: by 10.221.39.72 with SMTP id tl8mr833665vcb.29.1372206057890;
        Tue, 25 Jun 2013 17:20:57 -0700 (PDT)
Original-Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236])
        by mx.google.com with ESMTPS id am6si6982670ved.139.2013.06.25.17.20.57
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 25 Jun 2013 17:20:57 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c01::236 as permitted sender) client-ip=2607:f8b0:400c:c01::236;
Original-Received: by mail-ve0-f182.google.com with SMTP id ox1so10849030veb.27
        for <std-proposals@isocpp.org>; Tue, 25 Jun 2013 17:20:57 -0700 (PDT)
X-Received: by 10.58.76.34 with SMTP id h2mr734283vew.93.1372206057765; Tue,
 25 Jun 2013 17:20:57 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.58.125.73 with HTTP; Tue, 25 Jun 2013 17:20:57 -0700 (PDT)
In-Reply-To: <CAFk2RUZ3mgKY2GH+03SOABmYvBBpBwh-9LYqodqdYZYoGDg4mw@mail.gmail.com>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of metafoo@gmail.com designates 2607:f8b0:400c:c01::236 as permitted
 sender) smtp.mail=metafoo@gmail.com;       dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:5226
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5226>

On Tue, Jun 25, 2013 at 2:20 PM, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> On 25 June 2013 22:07, Richard Smith <richard@metafoo.co.uk> wrote:
>> On Tue, Jun 25, 2013 at 11:44 AM,  <tomaszkam@gmail.com> wrote:
>> > The C++14 CD (N3690) at the paragraph $5.1.2/11, says:
>> > For every init-capture a non-static data member named by the identifie=
r
>> > of
>> > the init-capture is declared in
>> > the closure type. This member is not a bit-field and not mutable. The
>> > type
>> > of that member corresponds to
>> > the type of a hypothetical variable declaration of the form =93auto
>> > init-capture ;=94, except that the variable
>> > name (i.e., the identifier of the init-capture) is replaced by a uniqu=
e
>> > identifier.
>> >
>> > As I understand this means that the type of member x declared in lambd=
a
>> > capture as [x{std::move(uniq_ptr)}] () {} will be the same as would be
>> > for
>> > the expression auto x{std::move(unique_ptr)}. That means that type of =
x
>> > would be std::initializer_list<std::unique_ptr<int>> (assuming that ty=
pe
>> > of
>> > unique_ptr is std::unique_ptr<int>). in contrast the original prposal
>> > contains of lambda example [ x { move(x) }, y =3D transform(y, z), foo=
,
>> > bar,
>> > baz ] { ... }, which suggest that type of x would be
>> > std::unique_ptr<int>.
>> >
>> > I am understanding the wording correctly? If so was this change made o=
n
>> > purpose?
>>
>> We discussed this in core. We didn't want init-captures to behave
>> differently from auto variable initialization, but there was a feeling
>> that auto variable initialization from a braced-init-list should be
>> fixed to not produce a std::initializer_list type here. We are
>> expecting at least one national body comment requesting a fix for
>> this, so there's a good chance that auto-deduction from initializer
>> lists will change in the C++14 FDIS to not give an initializer_list
>> type in the above case.
>
>
>
> There's also a paper about it at
> http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3681.html
>
> Richard, if you want to help with the wording, that would be much
> appreciated.
> I can utilize such wording with or without attribution, depending on whet=
her
> you want to be a co-conspirator or an innocent bystander. ;)

I'd be happy to help. You should also contact Jason Merrill; he was
looking at wording changes for this, and they were briefly included in
his drafting for DR1467/1490/1589/1631. The approach of that drafting
made braced auto initialization deduce initializer_list<T> only if
there were multiple initializers in the braces. FWIW, I much prefer
your wholesale removal of deduction of initializer_list.

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.



.
