220 29863 <296450916.pPnEejVmnO@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Default constructor for lambdas
Date: Fri, 16 Dec 2016 22:33:51 -0800
Lines: 31
Approved: news@gmane.org
Message-ID: <296450916.pPnEejVmnO@tjmaciei-mobl1>
References: <13497310-30de-4542-9ba4-fb1fbd730cb6@isocpp.org>
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 1481956439 31539 195.159.176.226 (17 Dec 2016 06:33:59 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Dec 2016 06:33:59 +0000 (UTC)
User-Agent: KMail/5.3.3 (Linux/4.8.13-1-default; KDE/5.28.0; x86_64; ; )
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBU5Y2PBAKGQE3FQBX4I@isocpp.org Sat Dec 17 07:33:55 2016
Return-path: <std-proposals+bncBCB4TK757YBRBU5Y2PBAKGQE3FQBX4I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f71.google.com ([209.85.215.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBU5Y2PBAKGQE3FQBX4I@isocpp.org>)
	id 1cI8Z6-0006w0-BN
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Dec 2016 07:33:52 +0100
Original-Received: by mail-lf0-f71.google.com with SMTP id g12sf12726415lfe.5
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 Dec 2016 22:33:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:user-agent:in-reply-to:references
         :mime-version: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=Mr6msET42WoNZx3SQuek0ivxmZtxVDyUTrf8FqYGK1A=;
        b=I4Pts6pk140i3c5a7laswkgiYKbDC+u39u76D10X+aYugncDGh0IGAOmAPrCvKemH7
         fkHhjcrrAcJzwSvuMvi0wAICWDDqS6frFFZOHeSyeNKVQQqj4K/DZNCQa3V2Sf42qgc1
         rs+dHBWOlxdK7YU4fox7Rw5yl5EYpo9+IuDEprtTvXjoqqoGjPUDt7mLCPAXS/v708V+
         AQj1aNIGBqp2zEOQ92MBmFNOC1AKjRUpF5GcEaR1H3siheXtODmf6LCkSchnjxcvE7Ur
         8nBOou8uDbRV48aNGOHzrgfFEtH240kLffRvDB8REmVC9qXZrCk1+AWS0l9rj7U9obiW
         Pstg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version: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=Mr6msET42WoNZx3SQuek0ivxmZtxVDyUTrf8FqYGK1A=;
        b=Nwzl4LVKNwOo6CBurduc1lN3ENQ8nGycVmDdfo6wHzGv9n1t7kfu25kF9cQlaPCj7R
         UtxpZVUKDgttuVwznYKISGTrUPvbkm2+8PnnSKNXJwfL1N2cLvqyBpjhN9TLOb52DfEu
         lwcO2sc4JImciGxxqduAtwx9Jy1sNOYDEI7bhXI4C+Wt3k5xeJLk+11b7viQkeJxW2+0
         +6MMVBIw697rUecqnrL9s3iOWEM69qguIYDZyFiqsfQzhZVyRInDIyKRl+FDOQpATojf
         ICTpqerTrQMYO+jSDpF3pWSkhBrx+WKhHjPzJPL7SQo8GOIXpD0D2r7KoItw4a++h7v7
         0YAQ==
X-Gm-Message-State: AIkVDXKqmCVVO8E0jcXt7DOZjU2lzcUcX7migFGynwD5tzpzIPoxh3mqVZMB2VXPIj4KqA==
X-Received: by 10.46.5.209 with SMTP id 200mr637178ljf.11.1481956436485;
        Fri, 16 Dec 2016 22:33:56 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.148.208 with SMTP id w199ls573058wmd.2.canary-gmail; Fri,
 16 Dec 2016 22:33:55 -0800 (PST)
X-Received: by 10.28.226.7 with SMTP id z7mr5930414wmg.83.1481956434966;
        Fri, 16 Dec 2016 22:33:54 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id p194si7241232wme.0.2016.12.16.22.33.54
        for <std-proposals@isocpp.org>;
        Fri, 16 Dec 2016 22:33:54 -0800 (PST)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:c54a:9ee:a270:4023])
	by gondolin.macieira.info (Postfix) with ESMTPSA id EDE9B11B3C3
	for <std-proposals@isocpp.org>; Fri, 16 Dec 2016 22:33:53 -0800 (PST)
In-Reply-To: <13497310-30de-4542-9ba4-fb1fbd730cb6@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:29863
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29863>

On sexta-feira, 16 de dezembro de 2016 14:47:45 PST Vincent Reverdy wrote:
> Hello.
> 
> What is the reason why lambdas have no default constructor? Is there any
> technical reason behind that, or is it a pure design decision?

What would you initialise the captures-by-reference to?

	[i] { ++i; } 

has struct equivalent:

struct Lambda
{
	int &i;
	Lambda(int &i) : i(i) {}
	operator()() { ++i; }
};

The above cannot have a default constructor.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

-- 
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/296450916.pPnEejVmnO%40tjmaciei-mobl1.

.
