220 5224 <CAOfiQqmb5k3rUeJ+eAFRnHPX7oGhqC5faw_q+xTh0DDrnDY_LA@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 12:07:16 -0700
Lines: 50
Approved: news@gmane.org
Message-ID: <CAOfiQqmb5k3rUeJ+eAFRnHPX7oGhqC5faw_q+xTh0DDrnDY_LA@mail.gmail.com>
References: <10c2a060-47cc-47bc-9114-c599c4986f4f@isocpp.org>
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 1372187238 28593 80.91.229.3 (25 Jun 2013 19:07:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 25 Jun 2013 19:07:18 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBZOUU6HAKGQEV5CBM3Y@isocpp.org Tue Jun 25 21:07:19 2013
Return-path: <std-proposals+bncBDVNBJG4YAIBBZOUU6HAKGQEV5CBM3Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vb0-f71.google.com ([209.85.212.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBZOUU6HAKGQEV5CBM3Y@isocpp.org>)
	id 1UrYaE-0001ON-MO
	for gclcip-std-proposals@m.gmane.org; Tue, 25 Jun 2013 21:07:18 +0200
Original-Received: by mail-vb0-f71.google.com with SMTP id f12sf17141179vbg.6
        for <gclcip-std-proposals@m.gmane.org>; Tue, 25 Jun 2013 12:07:17 -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=Vggb4TEopgKC6xmx9PGnZcQjzkuI73KqtFBxPexE2lY=;
        b=nnrVCKhxS9DZP3LdBsmiR1ZpxG+aPT2FCA6crGbIuV9dnIfsoSDLxMGpSwgzpMZAo8
         FJIOJJ/m3I+pMZY7VJvfrn4cIEYPmT12HM59WI+bRbyLL7YtRTC+VQc/vqYS8VG/lUzq
         X8em1HMszQjQZ3Od8TrmZ9PCsAw5p+1Sv3vrMLLOK1KYn2fteznKUX9EZcMR9E69fhpk
         4la2JH8OVMa7ej817DsSTrNr/ecbL1i0elZh1mTEeirJQV8fHQIGUWfkOiIZqo6p/BQo
         RgUsiNhFf96A0m+DWxvR89gauObaUzMLHzXfS8Lnx+ZFtTzwYjC4YKdnKHmIQkCpKhwX
     
X-Received: by 10.236.110.168 with SMTP id u28mr212857yhg.32.1372187237853;
        Tue, 25 Jun 2013 12:07:17 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.35.50 with SMTP id e18ls123185qej.99.gmail; Tue, 25 Jun
 2013 12:07:17 -0700 (PDT)
X-Received: by 10.220.164.138 with SMTP id e10mr288416vcy.27.1372187237135;
        Tue, 25 Jun 2013 12:07:17 -0700 (PDT)
Original-Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230])
        by mx.google.com with ESMTPS id tq4si6662355vdc.105.2013.06.25.12.07.17
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 25 Jun 2013 12:07:17 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c02::230 as permitted sender) client-ip=2607:f8b0:400c:c02::230;
Original-Received: by mail-vb0-f48.google.com with SMTP id w15so9930719vbf.35
        for <std-proposals@isocpp.org>; Tue, 25 Jun 2013 12:07:17 -0700 (PDT)
X-Received: by 10.58.216.97 with SMTP id op1mr243273vec.60.1372187236985; Tue,
 25 Jun 2013 12:07:16 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.58.125.73 with HTTP; Tue, 25 Jun 2013 12:07:16 -0700 (PDT)
In-Reply-To: <10c2a060-47cc-47bc-9114-c599c4986f4f@isocpp.org>
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:c02::230 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:5224
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5224>

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 identifier o=
f
> the init-capture is declared in
> the closure type. This member is not a bit-field and not mutable. The typ=
e
> 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 unique
> identifier.
>
> As I understand this means that the type of member x declared in lambda
> capture as [x{std::move(uniq_ptr)}] () {} will be the same as would be fo=
r
> 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 type =
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, b=
ar,
> 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 on
> 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.

--=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/.



.
