220 29600 <4fd0a3a2-5f0f-4c58-9184-d23827a802d4@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Add a "tuple_slice" function in <tuple>
Date: Wed, 30 Nov 2016 14:40:20 -0800 (PST)
Lines: 116
Approved: news@gmane.org
Message-ID: <4fd0a3a2-5f0f-4c58-9184-d23827a802d4@isocpp.org>
References: <490cad18-4302-4350-976f-2bc394a1a350@isocpp.org>
 <583F4A4F.7020708@gmail.com>
 <18998acd-2c2e-713b-29d2-4874400b35b7@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_82_1460773536.1480545621070"
X-Trace: blaine.gmane.org 1480545630 9423 195.159.176.226 (30 Nov 2016 22:40:30 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 30 Nov 2016 22:40:30 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBVVK7XAQKGQEMH4EXLI@isocpp.org Wed Nov 30 23:40:24 2016
Return-path: <std-proposals+bncBCEKFTV6ZUMBBVVK7XAQKGQEMH4EXLI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f69.google.com ([74.125.83.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBVVK7XAQKGQEMH4EXLI@isocpp.org>)
	id 1cCDY8-0000hL-Cd
	for gclcip-std-proposals@m.gmane.org; Wed, 30 Nov 2016 23:40:24 +0100
Original-Received: by mail-pg0-f69.google.com with SMTP id 3sf55638234pgd.3
        for <gclcip-std-proposals@m.gmane.org>; Wed, 30 Nov 2016 14:40:23 -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:in-reply-to:references: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=iNlRr/ytJYGYwn2+Q7ug+zEbyCqD8U0yWASA+Oug8IA=;
        b=c+cJQcghY4bIn+mcZn5ZGiY4fBhaJS6DYYMq24F2pFoKtZqoCYcZRw5qR0NDbKNDBT
         5uDW+Usxi50wmZUe8Sew9kk4cdG1pzVvOK0xLueyGdJbIdJCrkNsfEHSqDj5bYf+bmXA
         LAvWPZCPbwH9kUuSrG50R9T7fe9P4EeOUQQw3xRSFvTwkQnUQBUQbIodVj38+oEHsNG8
         6FLW1fk8hYbf5xuby0KHkJ/I+Di62m2Keo8ui0w4QIMuyZK6pRb8oMTFSvKmzzEbMWYb
         uGvrHA/1sQb7/ZHjYth5/+MU/gEszTOuCc2c/GFGi4B//UoRLuFTO/TdhgqeKeyRB+1K
         dd3w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references: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=iNlRr/ytJYGYwn2+Q7ug+zEbyCqD8U0yWASA+Oug8IA=;
        b=UG46eUO2dGPQCpQ+pPiuxOKNFhZBmJakBDOTK2itb7hPEWvAv8SJ1jTUHbR1xwUuy5
         pRGPYVd/YiiUNaMKlxT6jaq4pDECjlnr6Lcaxdn5gYD5eny75sN1pNfjPmnNxj4GDWGj
         060qbp3vQ7xRDnE7s6DQN4Q1vR14T/GgT8aFlOW5MYVCaY0u+2krjVUiufPOrxy69RrU
         YYKiKPnSaVt25PfV8+WF+hYGzM5jll1zgzPkBlt+Bdt/rrFV5IATEaYQ3M9+KmkU/jrz
         ZZ5qS69D/Blaa5cy0B2e02OWZgXLjz4wbabhMDYrMxlbE49zt7qJQ7MUMITuMfvEfQvW
         xIhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :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=iNlRr/ytJYGYwn2+Q7ug+zEbyCqD8U0yWASA+Oug8IA=;
        b=FNbJEGziftnJ/WADCUDCA3M9rbAb27VzaYIhsh5UYhVGXIf8RVFc5xYo5zRLU9Ybzy
         7R5XPY+WNkixQVmK50Pf/RWjsCZUT79ZPvm9UMQwAPk7i6ZRVqUzy2hZffJB+Kyz9VmA
         lPkALD8imetwudg5V6N7aS7G7awchWvYdQGF9wTYILViuGhIrSCrkgS7YusUbCzuRBb5
         iZIZvsLJbx0SN4eOKjYnLc475EqMI/qYxAnzmL+kVbm6M0TYMt++ceHeblFv1a94B7kr
         2Z8jeuYoNB1EQfqLTEshz79PsoByR2PQaMaupE0szyGZC5nSfjn9CNUA0u0PmsDSjeas
         Tmew==
X-Gm-Message-State: AKaTC00S97rejpd8NShX97vPdA3GDIqImZuR+QjCMp9K91kpMKGMOA4yK7Zxwr7g2efnVQ==
X-Received: by 10.99.45.197 with SMTP id t188mr17089214pgt.150.1480545622775;
        Wed, 30 Nov 2016 14:40:22 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.11.242 with SMTP id 105ls17173722oth.30.gmail; Wed, 30 Nov
 2016 14:40:21 -0800 (PST)
X-Received: by 10.157.4.119 with SMTP id 110mr2211014otc.11.1480545621865;
        Wed, 30 Nov 2016 14:40:21 -0800 (PST)
In-Reply-To: <18998acd-2c2e-713b-29d2-4874400b35b7@gmail.com>
X-Original-Sender: jmckesson@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:29600
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29600>

------=_Part_82_1460773536.1480545621070
Content-Type: multipart/alternative; 
	boundary="----=_Part_83_606739694.1480545621070"

------=_Part_83_606739694.1480545621070
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wednesday, November 30, 2016 at 5:19:13 PM UTC-5, =CE=9D=CE=B9=CE=BA=CF=
=8C=CE=BB=CE=B1=CE=BF=CF=82 =CE=91=CE=B8=CE=B1=CE=BD=CE=B1=CF=83=CE=AF=CE=
=BF=CF=85=20
wrote:
>
> Please refer to the related material, the proposed function does not=20
> operate only on std::tuple. It works on any type/entity that is a valid=
=20
> argument to std::tuple_size and std::get (namely std::array and=20
> std::pair) - the reason why it's bound to produce "tuple slices" is=20
> described in section 3 "Design consideration". I'm by no means implying=
=20
> this is superior to generalized slicing, but merely more simple and not=
=20
> requiring a language extension (plus it feels like it plays well with=20
> the existing tuple toolkit - it doesn't need to introduce extra machinery=
)=20
>

But if we have a language feature like that, it can do what your=20
tuple-slice function does, plus plenty of other things. Like this:

std::make_tuple(some_func([I1:I2]product_type)...);

You can find ways to make that work with lambdas, function calls, and=20
various other things. But it will never be as easily understandable and=20
easy-to-use as that. Better to go for the language feature, so that tuple=
=20
manipulation can be used by novices, rather than reserving it for complex=
=20
metaprogramming libraries.

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/4fd0a3a2-5f0f-4c58-9184-d23827a802d4%40isocpp.or=
g.

------=_Part_83_606739694.1480545621070
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, November 30, 2016 at 5:19:13 PM UTC-5, =CE=
=9D=CE=B9=CE=BA=CF=8C=CE=BB=CE=B1=CE=BF=CF=82 =CE=91=CE=B8=CE=B1=CE=BD=CE=
=B1=CF=83=CE=AF=CE=BF=CF=85 wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">Please refer to the related material, the proposed function does not=
=20
<br>operate only on std::tuple. It works on any type/entity that is a valid=
=20
<br>argument to std::tuple_size and std::get (namely std::array and=20
<br>std::pair) - the reason why it&#39;s bound to produce &quot;tuple slice=
s&quot; is=20
<br>described in section 3 &quot;Design consideration&quot;. I&#39;m by no =
means implying=20
<br>this is superior to generalized slicing, but merely more simple and not=
=20
<br>requiring a language extension (plus it feels like it plays well with=
=20
<br>the existing tuple toolkit - it doesn&#39;t need to introduce extra mac=
hinery)
<br></blockquote><div><br>But if we have a language feature like that, it c=
an do what your tuple-slice function does, plus plenty of other things. Lik=
e this:<br><br><div style=3D"background-color: rgb(250, 250, 250); border-c=
olor: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-=
wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div c=
lass=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">make_tup=
le</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">some_func</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">([</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">I1</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">I2</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">]</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">product_type</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">)...);</span></div></code></div><br>You can find ways to m=
ake that work with lambdas, function calls, and various other things. But i=
t will never be as easily understandable and easy-to-use as that. Better to=
 go for the language feature, so that tuple manipulation can be used by nov=
ices, rather than reserving it for complex metaprogramming libraries.<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/4fd0a3a2-5f0f-4c58-9184-d23827a802d4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4fd0a3a2-5f0f-4c58-9184-d23827a802d4=
%40isocpp.org</a>.<br />

------=_Part_83_606739694.1480545621070--

------=_Part_82_1460773536.1480545621070--

.
