220 24126 <53952014.4UIbchGS4l@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: lambda template?
Date: Mon, 01 Feb 2016 22:33:21 -0800
Lines: 64
Approved: news@gmane.org
Message-ID: <53952014.4UIbchGS4l@tjmaciei-mobl4>
References: <64578f60-f8cf-4fdf-91c2-9df72e9dfe09@isocpp.org> <3943320.mcaVf4CF4p@tjmaciei-mobl4> <678fc289-199f-425c-bdad-3499190d770f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1454394813 17163 80.91.229.3 (2 Feb 2016 06:33:33 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 2 Feb 2016 06:33:33 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBM43YG2QKGQEGKK26WI@isocpp.org Tue Feb 02 07:33:25 2016
Return-path: <std-proposals+bncBCB4TK757YBRBM43YG2QKGQEGKK26WI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBM43YG2QKGQEGKK26WI@isocpp.org>)
	id 1aQUWi-0000n0-Dn
	for gclcip-std-proposals@m.gmane.org; Tue, 02 Feb 2016 07:33:24 +0100
Original-Received: by mail-lf0-f70.google.com with SMTP id e36sf49247910lfi.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 01 Feb 2016 22:33:24 -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:content-transfer-encoding:content-type
         :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=r8XaeqcO8yO1mo660wkFWJigF1Og2qQvnKYvx/+DcvI=;
        b=mf02unjjux0tIBu+ANbJuLo2qtGH8Kfj+jDNXwKpDFe5D25fXXTvUazmIf+Ul/xqLg
         yMnnNSrYwy2CSUbt81MPnbPLWoY/ZdbA5IF7HlWQimk08VIIyg4/C5vBmkEF1Ugzgkni
         X5bLgtYSOsyrKBRVW7rPLqd1i5c3w7R1kAW20jjIuQ6oGJZN0KRyF4JnYyz4NNipYk1v
         uLv/gPQEPWZ9I23bLnbQs8seuVNu1BO7P+/sSwNGBCZRXx63/lVW/CJAX9kDK3XPu+6g
         G+LIyUG+FYq8g4IEQRkBkQs5LTpdPOXAEU8LC2oPLZG/W0ovgLKsREEcsXNO9 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:content-transfer-encoding
         :content-type: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=r8XaeqcO8yO1mo660wkFWJigF1Og2qQvnKYvx/+DcvI=;
        b=mlUK8CzZ/70CZ3Jvi/nSjpPXIN8/jk0I/1Am4hWqaHlf9bt3cD6ljTrAelAmVMQAPZ
         nF3e27rgGI8ddHWzskJck2mfau8RuKk1vtcwyyUgE9dmq5ldeZaSy3XffKytU2lFQEVl
         gkigI4gNIuz1MacfnTPZVKRLjbcF2QWh8wEhYqMMWWUdiAWfml16eLWu5ixMe0fyk6ye
         XvgC8ITMuW0/uflLsd2i92Mp3b67tLG5WVJE8l/Ad5fm6bhkEJND0pDzklNWszwvRYQW
         TL31S44Ut/vDUtWYSZ/RdOzhBO6OD/zKEOmiwvlcRvyzMJxYdnzkcULqj 
X-Gm-Message-State: AG10YOSJEw+FU0x7z140U8/fN5IwOlXsPCdIS9cwLk/3uzwy+IxrxPH+7rtZrmjPhS338w==
X-Received: by 10.28.156.83 with SMTP id f80mr2106771wme.1.1454394804018;
        Mon, 01 Feb 2016 22:33:24 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.213.132 with SMTP id m126ls43923wmg.24.gmail; Mon, 01 Feb
 2016 22:33:23 -0800 (PST)
X-Received: by 10.194.114.164 with SMTP id jh4mr26287464wjb.153.1454394803288;
        Mon, 01 Feb 2016 22:33:23 -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 k124si20235842wmf.79.2016.02.01.22.33.23
        for <std-proposals@isocpp.org>;
        Mon, 01 Feb 2016 22:33:23 -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-mobl4.localnet (unknown [IPv6:2601:1c0:5803:81c9:bce6:2840:8111:8dba])
	by gondolin.macieira.info (Postfix) with ESMTPSA id C764C11A430
	for <std-proposals@isocpp.org>; Mon,  1 Feb 2016 22:33:22 -0800 (PST)
User-Agent: KMail/4.14.10 (Linux/4.3.3-6-default; KDE/4.14.15; x86_64; ; )
In-Reply-To: <678fc289-199f-425c-bdad-3499190d770f@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-Spam-Checked-In-Group: 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:24126
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24126>

On Monday 01 February 2016 20:03:32 =EC=9C=A4=ED=9B=88=EB=82=A8 wrote:
> #include <iostream>
> #include <string>
> // Move or Copy Check
> struct CheckString {
> std::string data_{ "hello" };
> CheckString() =3D default;
> CheckString(const CheckString& rhs) : data_{ rhs.data_ } {
> std::cout << "copying\n";
> }
>=20
> CheckString(CheckString&& rhs) : data_{ std::move(rhs.data_) } {
> std::cout << "moving\n";
> }
> };
>=20
> void f(CheckString ts1, CheckString ts2, CheckString arg1, CheckString
> arg2) {
> }
>=20
> //#case 1
> template<typename... TS>
> auto test(TS&&... ts1) {
> return  [&ts1...](auto&&... args) mutable {
> // error 'TS': parameter pack must be expanded in this context
> // TS type not capture. just value capture.
> return f(std::forward<TS>(ts1)..., std::forward<decltype(args)>(args)...)
> };
> }

No error here, Clang 3.7, GCC 5.3, ICC 16.0.

> int main() {
> CheckString ts1, ts2, arg1, arg2;
> auto fn =3D test(ts1, std::move(ts2));
> fn(arg1, std::move(arg2));
> // ts2, arg2 ->moving
> // ts1, arg1 ->copying
> }
>=20
> Something seems to be possible also for other purposes, a variety of uses=
..

Please explain with words what this is supposed to do. And considering case=
 1=20
works, why do we need cases 2 or 3?

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=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 https://groups.google.com/a/isocpp.org/group/std-propos=
als/.

.
