220 29454 <110fecc1-a731-f6ad-fa8d-cfe2cb36faaa@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Simon Brand <tartanllama@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: for...(T : t) // fold expression improvement
Date: Fri, 18 Nov 2016 08:34:04 +0000
Lines: 33
Approved: news@gmane.org
Message-ID: <110fecc1-a731-f6ad-fa8d-cfe2cb36faaa@gmail.com>
References: <7c87350a-7ac2-489b-b107-ea25a7bd6c74@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; format=flowed
X-Trace: blaine.gmane.org 1479458048 6265 195.159.176.226 (18 Nov 2016 08:34:08 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 18 Nov 2016 08:34:08 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.3.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDQ5T5PGQUKRB7XZXLAQKGQEIHQ26YI@isocpp.org Fri Nov 18 09:34:04 2016
Return-path: <std-proposals+bncBDQ5T5PGQUKRB7XZXLAQKGQEIHQ26YI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDQ5T5PGQUKRB7XZXLAQKGQEIHQ26YI@isocpp.org>)
	id 1c7ecV-0000g4-I6
	for gclcip-std-proposals@m.gmane.org; Fri, 18 Nov 2016 09:34:03 +0100
Original-Received: by mail-pf0-f199.google.com with SMTP id 83sf136788747pfx.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 18 Nov 2016 00:34:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-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=wsyKtdGkBcLW3biyUuPm7ojaP+S7U1iHu052oc1x0m4=;
        b=ubg5F+rkb1NbDfjWh7QAyfuxo9q7FzR5E67/VcBq5I0p0G8rcPXgdyLRhO9XAvkvjm
         hcg8kiUFlYkHqPHi6wgQHz6qP9bZZssBXzEX6iQ53WxG+IeONZMo4ky9hW+3wF2Wpimd
         vluGeed16ofMC7tnqH0twbqSUQtT+mgDE6ylgPc0JCJwcR1Z18/iZv02eG9ADiYqypBH
         jUbQAZKOVPnBX4X2y9UYzEuBhMQzfB6HXOVYpP6Sbtw4JcS4AQRsvKQYuqhMAv35oquo
         KWSwQsiXpb8tBJ2UjYlC3HWtAKGAEeNR2/KkVk0p+Hrs/DQGZOv/g7m/IrKMEhItfeku
         Utmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-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=wsyKtdGkBcLW3biyUuPm7ojaP+S7U1iHu052oc1x0m4=;
        b=NtO2TJoW2DmuyMqZ06HBHhBHSeVjIzLw0gWKlZ/Ktb2SIto12052dKf/Obc4R/DFZ0
         8wVThv1Vp9Ntm/KK3fYUCvnTmFbjJiOAH1fOv20pAVWjYBA82Zg8LFGT2lYpqUzr42rS
         ZIK4YDKXCl1ze/Yf3oLqKVdMvhlTOCDMHILMA1LKLcmyblICjreqcpWLpc/b8VV60LCW
         +pd3l5g3rwoKKoxObap27Q/l9oLHiFTs+IIeV+gUCONKoJlfEsXKVQFLj0rUAMhSAlHu
         ki4fp2jQVJ3geqSpxhgU1tKA7fLhz3oY2cXkKH/AIzAzHMbyLUwCwFtkTXs9JCH1s+n5
         rTEQ==
X-Gm-Message-State: ABUngvdm4CNDSnnPp0154PphhKOj6B0TsBkSuLYcQeRxCa0eyb5yvjhV+FnT75XwxpDlug==
X-Received: by 10.99.95.151 with SMTP id t145mr2776407pgb.131.1479458046779;
        Fri, 18 Nov 2016 00:34:06 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.15.106 with SMTP id 97ls6513649ott.11.gmail; Fri, 18 Nov
 2016 00:34:05 -0800 (PST)
X-Received: by 10.55.49.203 with SMTP id x194mr10130507qkx.93.1479458045920;
        Fri, 18 Nov 2016 00:34:05 -0800 (PST)
Original-Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com. [2607:f8b0:400d:c09::242])
        by mx.google.com with ESMTPS id n54si2117950qta.44.2016.11.18.00.34.05
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 18 Nov 2016 00:34:05 -0800 (PST)
Received-SPF: pass (google.com: domain of tartanllama@gmail.com designates 2607:f8b0:400d:c09::242 as permitted sender) client-ip=2607:f8b0:400d:c09::242;
Original-Received: by mail-qk0-x242.google.com with SMTP id n204so30581212qke.2
        for <std-proposals@isocpp.org>; Fri, 18 Nov 2016 00:34:05 -0800 (PST)
X-Received: by 10.194.60.195 with SMTP id j3mr5014185wjr.149.1479458045474;
        Fri, 18 Nov 2016 00:34:05 -0800 (PST)
Original-Received: from [10.54.100.137] ([185.34.9.74])
        by smtp.googlemail.com with ESMTPSA id f126sm2060605wme.22.2016.11.18.00.34.04
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 18 Nov 2016 00:34:04 -0800 (PST)
In-Reply-To: <7c87350a-7ac2-489b-b107-ea25a7bd6c74@isocpp.org>
X-Original-Sender: tartanllama@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 tartanllama@gmail.com designates 2607:f8b0:400d:c09::242 as permitted sender)
 smtp.mailfrom=tartanllama@gmail.com;       dmarc=pass (p=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:29454
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29454>

If I understand your code correctly, you could implement it with the 
current fold expression proposal like this:

template <typename... Ts>
void foo(Ts... ts) {
     ((std::cout << ts), ...);
}


On 18/11/16 08:14, z.p.gaal@gmail.com wrote:
> During metaprogramming lots of dummy functions have to be implemented to process tuples and/or variadic templates. I don't know too much about proposal submission and I don't have so deep knowledge of the language either.
> But it'd be great to have expressions something like
>
> template<typename... T>
> void foo(T... a) {
> for...( Ti ai : a ) {
> std::cout << a
> }
> }
>
> It'd make the code more readable and remove lots of index_sequence based hacks.
>
> Is there any similar proposal already. What do you think of this idea?
>
> thanks Gzp
>

-- 
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/110fecc1-a731-f6ad-fa8d-cfe2cb36faaa%40gmail.com.

.
