220 30756 <6ea7721e-ff20-4a5f-9f32-4fe0d1b3eb1d@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: For expression and pack indexing
Date: Fri, 3 Feb 2017 04:03:35 -0800 (PST)
Lines: 83
Approved: news@gmane.org
Message-ID: <6ea7721e-ff20-4a5f-9f32-4fe0d1b3eb1d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_546_921433929.1486123415387"
X-Trace: blaine.gmane.org 1486123417 19638 195.159.176.226 (3 Feb 2017 12:03:37 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 3 Feb 2017 12:03:37 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCRIRSPDTQIRBGHD2HCAKGQEUWH2EBA@isocpp.org Fri Feb 03 13:03:32 2017
Return-path: <std-proposals+bncBCRIRSPDTQIRBGHD2HCAKGQEUWH2EBA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f200.google.com ([209.85.192.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCRIRSPDTQIRBGHD2HCAKGQEUWH2EBA@isocpp.org>)
	id 1cZcaR-0004tk-Ld
	for gclcip-std-proposals@m.gmane.org; Fri, 03 Feb 2017 13:03:31 +0100
Original-Received: by mail-pf0-f200.google.com with SMTP id e4sf19675294pfg.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 03 Feb 2017 04:03:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=jkZdtYlhjweqOA2kUIMZ1zcQan8vmt5uFG8M9FQlMwg=;
        b=AKBzCO5hi8jB1qDjLT+N+qovkeFhtJnOi3Nw91gxYuJ+GQrcsVNfiA3FzQKncM7ALf
         kW3GzHmC1pOtl06TUgXCSXFkKoEU143eV/n9xBHWDs9LmIFUbfc8eMM6zVfhF1qz385m
         wmniU+WpzmkLL+Hvg/rZk2/PzxvuT3yyeKdV+6wF1WTAx4g8+LFFTG1RKy3ZBc+AAXlb
         sO54iayrBz/2JdhhgHf+q7/qm7GLALLvxkhlA9RNuJbgtqr6nUoD0dlYZ5QheXml7Wt0
         IPnJ7Q3Obn9M/JDv77CX5KCYX6qu9nPYZQ2ij1X/QJYJKGHI7Xhq9kDwbXh3araCNVm8
         Vezg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=jkZdtYlhjweqOA2kUIMZ1zcQan8vmt5uFG8M9FQlMwg=;
        b=GYiZ5AeBDuTOPj6Opt6fUsE5tsD+aU+FIltDRdFQkM3hU0zMBPo1i8LAg3y4bqaWB1
         kQ8XhjOnMpVykUpajxGcJZTXOhl++5jjq8g1YDxtdL3V9mL7TfJ7N6eoCDRwhloYMwiv
         PUODB1UkRVvhYKN87Aw/Y2nox7BvnjrZtk/Bd8pUOPbEjWXh3ENYuFabs3EhMYbRBmfr
         5AW5hLSgA+BLOSCN4z6yWsU89b2DE/TtnyItn+DLw2Eh+n9pKYDTNWbZYk4Y+aVldYDQ
         hZF7k/BMA0CjPskj5DFMbcDNHRlW6cICx9SQPzfkrajMaXVJENBBRSNa8bV59MHCG+fj
         EkYg==
X-Gm-Message-State: AIkVDXJSRDjC74FI2Um7l5AZIz3tPVFqE/eT+XVDvJVzweep5cs6wDIBdWvGdacF0mJXag==
X-Received: by 10.99.238.18 with SMTP id e18mr3834860pgi.39.1486123416855;
        Fri, 03 Feb 2017 04:03:36 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.9.200 with SMTP id 8ls6424630otz.48.gmail; Fri, 03 Feb
 2017 04:03:35 -0800 (PST)
X-Received: by 10.157.20.145 with SMTP id d17mr1295104ote.18.1486123415852;
        Fri, 03 Feb 2017 04:03:35 -0800 (PST)
X-Original-Sender: bengt.gustafsson@beamways.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:30756
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30756>

------=_Part_546_921433929.1486123415387
Content-Type: multipart/alternative; 
	boundary="----=_Part_547_2100640006.1486123415387"

------=_Part_547_2100640006.1486123415387
Content-Type: text/plain; charset=UTF-8


I am writing a proposal to use a for loop embedded in an expression as a 
pack generator. This would simplify many variadic template related issues 
and as a bonus widens the scope of fold expressions to regular containers.

To get a taste of it here is the apply function written with a for 
expression.


    template<typename F, typename T> decltype(auto) apply(F f, T& tuple)
    {
        return f(for (size_t IX : range::ints(tuple_size_v<pars>)) 
std::get<IX>(tuple) ...);
    }

The current draft is available here: P0565 Prefix for and postfix indexing 
<https://github.com/BengtGustafsson/P0565-Prefix-for-and-postfix-indexing>

Thanks to Matthew Woehlke for discussion both leading to the proposal being 
started and for pointing out weaknesses that could be addressed. Note that 
this is not to say that he prefers this over his own D0535 proposal.

Please comment. I intend to get this into the Feb 6 mailing unless you find 
severe road blocks in the line of thinking.

Bengt

-- 
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/6ea7721e-ff20-4a5f-9f32-4fe0d1b3eb1d%40isocpp.org.

------=_Part_547_2100640006.1486123415387
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div>I am writing a proposal to use a for loop embedde=
d in an expression as a pack generator. This would simplify many variadic t=
emplate related issues and as a bonus widens the scope of fold expressions =
to regular containers.</div><div><br></div><div>To get a taste of it here i=
s the apply function written with a for expression.</div><div><br></div><di=
v><div><br></div><div>=C2=A0 =C2=A0 template&lt;typename F, typename T&gt; =
decltype(auto) apply(F f, T&amp; tuple)</div><div>=C2=A0 =C2=A0 {</div><div=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return f(for (size_t IX : range::ints(tuple_si=
ze_v&lt;pars&gt;)) std::get&lt;IX&gt;(tuple) ...);</div><div>=C2=A0 =C2=A0 =
}</div><div><br></div><div>The current draft is available here:=C2=A0<a hre=
f=3D"https://github.com/BengtGustafsson/P0565-Prefix-for-and-postfix-indexi=
ng">P0565 Prefix for and postfix indexing</a><br></div></div><div><br></div=
><div>Thanks to Matthew Woehlke for discussion both leading to the proposal=
 being started and for pointing out weaknesses that could be addressed. Not=
e that this is not to say that he prefers this over his own D0535 proposal.=
</div><div><br></div><div>Please comment. I intend to get this into the Feb=
 6 mailing unless you find severe road blocks in the line of thinking.</div=
><div><br></div><div>Bengt</div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/6ea7721e-ff20-4a5f-9f32-4fe0d1b3eb1d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6ea7721e-ff20-4a5f-9f32-4fe0d1b3eb1d=
%40isocpp.org</a>.<br />

------=_Part_547_2100640006.1486123415387--

------=_Part_546_921433929.1486123415387--

.
