220 24344 <56BEF226.2030700@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: [tuple] extracting tuples out of a tuple
Date: Sat, 13 Feb 2016 10:06:46 +0100
Lines: 933
Approved: news@gmane.org
Message-ID: <56BEF226.2030700@wanadoo.fr>
References: <CA+wfc1-FFqOJ9OSme_SpJAmGz+cshbMDVi_dLrF1ztbzkTN-WQ@mail.gmail.com>
 <n9ksdc$4so$1@ger.gmane.org>
 <CA+wfc18LVMDXhRYhkw0PxeOmPiOoqVteF7V+40EdOOYb2K1snA@mail.gmail.com>
 <n9l3ns$33l$1@ger.gmane.org>
 <7e08b6c5-853c-471e-b248-a9df7e8e27be@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------090706040204090900080905"
X-Trace: ger.gmane.org 1455354418 8036 80.91.229.3 (13 Feb 2016 09:06:58 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 13 Feb 2016 09:06:58 +0000 (UTC)
Cc: mwoehlke.floss@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBBKPE7O2QKGQE5BNXSJQ@isocpp.org Sat Feb 13 10:06:51 2016
Return-path: <std-proposals+bncBDH67CONY4PBBKPE7O2QKGQE5BNXSJQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f71.google.com ([74.125.82.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBBKPE7O2QKGQE5BNXSJQ@isocpp.org>)
	id 1aUWAE-0007iw-CO
	for gclcip-std-proposals@m.gmane.org; Sat, 13 Feb 2016 10:06:50 +0100
Original-Received: by mail-wm0-f71.google.com with SMTP id g62sf16236816wme.1
        for <gclcip-std-proposals@m.gmane.org>; Sat, 13 Feb 2016 01:06:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:cc:from:message-id:date:user-agent
         :mime-version:in-reply-to: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=DIiqf+1xR6DGjaZ9/WZz3+NcQS61fffh1s3PcOzlK5c=;
        b=tC1mvaXPIAmCYv2RSi3XRLIRoF1bFvCR3ZYLrbCz+BV8xAKo4WpjJxykFro7vPRTZO
         jZFzTM8ZB6hz9fMK9e+JSZo3oQXF79JgYjChBOYntSVgwG9KddGkHETMZgwmgdgXlIvu
         s2fSghRxKJrDFdeq23XogxXOQtx6Sraan54gqI5qcRw6qC1Nt8AVIG8+BuQoRI5EDXWs
         knmxSzkk7iuBum6PbLSwyOfY4WROWBE9SrO7rJjMy8jYwx/EVrXksszlrOzMAJJdIOui
         kNzlph00eRXy+ZozQTRZd4IDS0WJegnsOsVM2r0RInlvZ/XQebtZbbwHIgXoYZZPUIMC
         eizA== 
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:cc:from:message-id:date
         :user-agent:mime-version:in-reply-to: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=DIiqf+1xR6DGjaZ9/WZz3+NcQS61fffh1s3PcOzlK5c=;
        b=cak9YjjXTHzgx8b3F2scZbR8SCjVQ0y+PnxCfbVfvAfp8bCpFNZ30zcTiaXrapeYHx
         0TC9zBgTWJKKX/ZqIw/GMazDvuXNNe+2wcc6gAL7gaTQz9nz73u3NtCYieWDqAwEpk4+
         2cQGZ0OAxn7AwxPekxwteFjTDyXN40IYux9ZOsPbCZb/1cVE2s8zYZ/+10jFxOUU6q9s
         ss4jU0jCZspqm1yXaflZcqMVWRCQJBRp6nfBNmFKTGhTaNDtwaN3KUYxN8Oql9rp6SWW
         wBzcobf4JfvpjnfBWKV+zwJjnnCeZYJXmFM5GQluRdgYwDxQYsbCfYIER/TBy/FouBKm
         /s 
X-Gm-Message-State: AG10YOSBC3agOAzTyI4iGgJxNhs2Be6yYDCSjdebosV9x75NMR73n6Vc2W6X+7/SrAihQw==
X-Received: by 10.194.24.233 with SMTP id x9mr541793wjf.0.1455354409828;
        Sat, 13 Feb 2016 01:06:49 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.3.67 with SMTP id 64ls255179wmd.28.canary; Sat, 13 Feb 2016
 01:06:48 -0800 (PST)
X-Received: by 10.28.14.4 with SMTP id 4mr2329805wmo.100.1455354408514;
        Sat, 13 Feb 2016 01:06:48 -0800 (PST)
Original-Received: from smtp.smtpout.orange.fr (smtp01.smtpout.orange.fr. [80.12.242.123])
        by mx.google.com with ESMTPS id n123si9840122wmb.41.2016.02.13.01.06.48
        for <std-proposals@isocpp.org>
        (version=TLS1 cipher=AES128-SHA bits=128/128);
        Sat, 13 Feb 2016 01:06:48 -0800 (PST)
Received-SPF: neutral (google.com: 80.12.242.123 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.123;
Original-Received: from new-host.home ([86.214.221.89])
	by mwinf5d36 with ME
	id Hl6n1s0081wL8VA03l6nmq; Sat, 13 Feb 2016 10:06:48 +0100
X-ME-Helo: new-host.home
X-ME-Auth: dmljZW50ZS5ib3RldEB3YW5hZG9vLmZy
X-ME-Date: Sat, 13 Feb 2016 10:06:48 +0100
X-ME-IP: 86.214.221.89
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0)
 Gecko/20100101 Thunderbird/38.5.1
In-Reply-To: <7e08b6c5-853c-471e-b248-a9df7e8e27be@isocpp.org>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.123 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mailfrom=vicente.botet@wanadoo.fr
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:24344
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24344>

This is a multi-part message in MIME format.
--------------090706040204090900080905
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 13/02/2016 01:28, Arthur O'Dwyer a =C3=A9crit :
> On Friday, February 12, 2016 at 9:11:35 AM UTC-8, Matthew Woehlke wrote:
>
>     On 2016-02-12 11:30, Oliver Kowalke wrote:
>     > 2016-02-12 16:06 GMT+01:00 Matthew Woehlke <mwoehlk...@gmail.com
>     <javascript:>>:
>     >> I'm not a fan of using magical references to do indirect
>     assignment,
>     >> i.e. any of your proposals, but especially `split`. All of
>     these seem
>     >> backwards, i.e. should be `tpl1 =3D head<3>(tpl);` instead.
>     >
>     > I've had std::tie() in mind,
>     >
>     > int i...;
>     > X x...;
>     > std::tie( i, x) =3D get_tuple();
>
>     That's also a horribly ugly interface that we shouldn't be
>     perpetuating;
>     http://wg21.link/p0144 solves that exact example ever so much
>     better...
>
>
> I think maybe Oliver was trying to say that
>
> |
>     tuple<int,string,string,double>tpl {-1,"abc","xyz",.5};
>     tuple<string,string,double>tpl1;
>     tpl1 =3Dtail(tpl);// Python: tpl1 =3D tpl[1:]
>     tail(tpl)=3Dtpl1;// Python: tpl[1:] =3D tpl1
> |
>
>
> should both work, because tail() should return a tuple of references=20
> instead of a tuple of values. I definitely support=20
> not-making-unnecessary-copies in general, and particularly in this=20
> case if it lets tail() work like tie(). But it does seem a little bit=20
> non-orthogonal.  (Also, I'm assuming that Oliver made some typos in=20
> his original post =E2=80=94 notice I've flipped the "tpl" and "tpl1" in t=
he=20
> second line above.)
>
I don't think Oliver made some typos, but it is up to him to confirm.=20
Anyway the name was not good.

std::tuple< int, std::string, std::string, double > tpl{ -1, "abc",=20
"xyz", .5 };
std::tuple< int, std::string, std::string > tpl1;
std::tuple< std::string, double > tpl2;

head( tpl1) =3D tpl;
tail( tpl2) =3D tpl;
split( tpl1, tpl2) =3D tpl;

head(tpl1) returns a reference to tuple that accepts assignment form=20
tuples having the same types from the front and
tail(tpl2) do the opposite, returns a reference to tuple that accepts=20
assignments form tuples having the same types from the back.

head->tie_tuple_at_front
tail->tie_tuple_at_back

It could also be a tie_tuple_at_middle that accepts assignment form=20
tuples having the same types from a unspecified position.

My names are not good neither.

I believe that his split pretended to be a equivalent to his

head( tpl1) =3D tpl;
tail( tpl2) =3D tpl;

but I don't see the added value.

Whether it is worth having this in the standard and looking for a good=20
names is another question.



> Also, of course, head(x) should logically return get<0>(x), not some=20
> weird synonym for reverse(tail(reverse(x))). But that's just poor=20
> naming. The underlying operation here is either "splice" (extract a=20
> contiguous range of indices from the input tuple, as in the Python=20
> above) or "select" (extract a noncontiguous set of indices from the=20
> input tuple and compress them, as in various vector instruction sets).
I'm not saying that a splice function on tuples is not useful, but IMHO=20
Oliver idea was to determine the splice to do depending on the target=20
tuple not on the source tuple.

>
> I agree that
>
> |
>     std::tuple<int,std::string,std::string,double>tpl{-1,"abc","xyz",.5};
>     std::tuple<int,std::string,std::string>tpl1;
>     std::tuple<std::string,double>tpl2;
>     split(tpl1,tpl2)=3Dtpl;
> |
>
> is just nonsense, as written.
See above.
> However, under the "unpacking with postfix tilde" not-a-proposal, a=20
> similar operation could be written like this:
>
> |
>     tuple<int,string,string,double>tpl {-1,"abc","xyz",.5};
>     tuple<int,string>tpl1;
>     tuple<string,double>tpl2;
>
>     std::tie(tpl1~...,tpl2~...)=3Dtpl;
>
> assert(std::get<0>(tpl1)=3D=3Dstd::get<0>(tpl));
> assert(std::get<1>(tpl1)=3D=3Dstd::get<1>(tpl));
> assert(std::get<0>(tpl2)=3D=3Dstd::get<2>(tpl));
> assert(std::get<1>(tpl2)=3D=3Dstd::get<3>(tpl));
> |
>
> In general, I think that the C++ standard library is woefully lacking=20
> in tuple manipulators... but rather than proposing new tuple=20
> manipulators (of which there could be a million: zip, fold, map, car,=20
> cdr, reverse,...), we should be trying to give people the ability to=20
> express those manipulators natively in the language, via something=20
> like Matthew's [:] notation or my ~... notation.
>
>
Just wondering how could help the no-yet-proposed operators  [:], ~,=20
and  ... to implement what I interpreted.

Vicente

--=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/.

--------------090706040204090900080905
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">Le 13/02/2016 01:28, Arthur O'Dwyer a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote
      cite=3D"mid:7e08b6c5-853c-471e-b248-a9df7e8e27be@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">On Friday, February 12, 2016 at 9:11:35 AM UTC-8,
        Matthew Woehlke wrote:
        <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
          0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On
          2016-02-12 11:30, Oliver Kowalke wrote:
          <br>
          &gt; 2016-02-12 16:06 GMT+01:00 Matthew Woehlke &lt;<a
            moz-do-not-send=3D"true" href=3D"javascript:" target=3D"_blank"
            gdf-obfuscated-mailto=3D"ceVKogYTHwAJ" rel=3D"nofollow"
            onmousedown=3D"this.href=3D'javascript:';return true;"
            onclick=3D"this.href=3D'javascript:';return true;"><a class=3D"=
moz-txt-link-abbreviated" href=3D"mailto:mwoehlk...@gmail.com">mwoehlk...@g=
mail.com</a></a>&gt;:
          <br>
          &gt;&gt; I'm not a fan of using magical references to do
          indirect assignment,
          <br>
          &gt;&gt; i.e. any of your proposals, but especially `split`.
          All of these seem
          <br>
          &gt;&gt; backwards, i.e. should be `tpl1 =3D
          head&lt;3&gt;(tpl);` instead.
          <br>
          &gt; <br>
          &gt; I've had std::tie() in mind,
          <br>
          &gt; <br>
          &gt; int i...;
          <br>
          &gt; X x...;
          <br>
          &gt; std::tie( i, x) =3D get_tuple();
          <br>
          <br>
          That's also a horribly ugly interface that we shouldn't be
          perpetuating;
          <br>
          <a moz-do-not-send=3D"true" href=3D"http://wg21.link/p0144"
            target=3D"_blank" rel=3D"nofollow"
            onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%=
3A%2F%2Fwg21.link%2Fp0144\46sa\75D\46sntz\0751\46usg\75AFQjCNHRLy3vqbt_AWP1=
QLZDa6ye86dhPQ';return
            true;"
            onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2=
F%2Fwg21.link%2Fp0144\46sa\75D\46sntz\0751\46usg\75AFQjCNHRLy3vqbt_AWP1QLZD=
a6ye86dhPQ';return
            true;">http://wg21.link/p0144</a> solves that exact example
          ever so much better...
          <br>
        </blockquote>
        <div><br>
        </div>
        <div>I think maybe Oliver was trying to say that</div>
        <div><br>
        </div>
        <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
          250); border: 1px solid rgb(187, 187, 187); word-wrap:
          break-word;"><code class=3D"prettyprint">
            <div class=3D"subprettyprint"><span style=3D"color: #000;"
                class=3D"styled-by-prettify">=C2=A0 =C2=A0 tuple</span><spa=
n
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">double<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl </=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">-</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #080;" class=3D"styled-by-prettify">"abc"</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #080;" class=3D"styled-by-prettify">"xyz"</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">.</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">5</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">};</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 tuple</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">&lt;</span><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">double<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl1</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 tpl1 </span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">=3D</span><span style=3D"color=
:
                #000;" class=3D"styled-by-prettify"> tail</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0=
 =C2=A0</span><span
                style=3D"color: #800;" class=3D"styled-by-prettify">//
                Python: tpl1 =3D tpl[1:]</span><span style=3D"color: #000;"
                class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 tail</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">(</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify">tpl</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl1</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0=
 =C2=A0</span><span
                style=3D"color: #800;" class=3D"styled-by-prettify">//
                Python: tpl[1:] =3D tpl1</span></div>
          </code></div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>should both work, because tail() should return a tuple of
          references instead of a tuple of values. I definitely support
          not-making-unnecessary-copies in general, and particularly in
          this case if it lets tail() work like tie(). But it does seem
          a little bit non-orthogonal. =C2=A0(Also, I'm assuming that Olive=
r
          made some typos in his original post =E2=80=94 notice I've flippe=
d the
          "tpl" and "tpl1" in the second line above.)</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    I don't think Oliver made some typos, but it is up to him to
    confirm. Anyway the name was not good.<br>
    <br>
    std::<span tabindex=3D"-1" id=3D":1tt.15" style=3D"" class=3D"">tuple</=
span>&lt;
    int, std::string, std::string, double &gt; <span tabindex=3D"-1"
      id=3D":1tt.16" style=3D"" class=3D"">tpl</span>{ -1, "<span
      tabindex=3D"-1" id=3D":1tt.17" style=3D"" class=3D"">abc</span>", "<s=
pan
      tabindex=3D"-1" id=3D":1tt.18" style=3D"" class=3D"">xyz</span>", .5 =
};<br>
    std::<span tabindex=3D"-1" id=3D":1tt.19" style=3D"" class=3D"">tuple</=
span>&lt;
    int, std::string, std::string &gt; tpl1;<br>
    std::<span tabindex=3D"-1" id=3D":1tt.20" style=3D"" class=3D"">tuple</=
span>&lt;
    std::string, double &gt; tpl2;<br>
    <br>
    head( tpl1) =3D <span tabindex=3D"-1" id=3D":1tt.21" style=3D"" class=
=3D"">tpl</span>;<br>
    tail( tpl2) =3D <span tabindex=3D"-1" id=3D":1tt.22" style=3D"" class=
=3D"">tpl</span>;<br>
    split( tpl1, tpl2) =3D tpl;<br>
    <br>
    head(tpl1) returns a reference to tuple that accepts assignment form
    tuples having the same types from the front and <br>
    tail(tpl2) do the opposite, returns a reference to tuple that
    accepts assignments form tuples having the same types from the back.<br=
>
    <br>
    head-&gt;tie_tuple_at_front<br>
    tail-&gt;tie_tuple_at_back<br>
    <br>
    It could also be a tie_tuple_at_middle that accepts assignment form
    tuples having the same types from a unspecified position.<br>
    <br>
    My names are not good neither.<br>
    <br>
    I believe that his split pretended to be a equivalent to his<br>
    <br>
    head( tpl1) =3D <span tabindex=3D"-1" id=3D":1tt.21" style=3D"" class=
=3D"">tpl</span>;<br>
    tail( tpl2) =3D <span tabindex=3D"-1" id=3D":1tt.22" style=3D"" class=
=3D"">tpl</span>;<br>
    <br>
    but I don't see the added value. <br>
    <br>
    Whether it is worth having this in the standard and looking for a
    good names is another question.<br>
    <br>
    <br>
    <br>
    <blockquote
      cite=3D"mid:7e08b6c5-853c-471e-b248-a9df7e8e27be@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>Also, of course, head(x) should logically return
          get&lt;0&gt;(x), not some weird synonym for
          reverse(tail(reverse(x))). But that's just poor naming. The
          underlying operation here is either "splice" (extract a
          contiguous range of indices from the input tuple, as in the
          Python above) or "select" (extract a noncontiguous set of
          indices from the input tuple and compress them, as in various
          vector instruction sets).</div>
      </div>
    </blockquote>
    I'm not saying that a splice function on tuples is not useful, but
    IMHO Oliver idea was to determine the splice to do depending on the
    target tuple not on the source tuple.<br>
    <br>
    <blockquote
      cite=3D"mid:7e08b6c5-853c-471e-b248-a9df7e8e27be@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div><br>
        </div>
        <div>I agree that</div>
        <div><br>
        </div>
        <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
          250); border: 1px solid rgb(187, 187, 187); word-wrap:
          break-word;"><code class=3D"prettyprint">
            <div class=3D"subprettyprint"><span style=3D"color: #000;"
                class=3D"styled-by-prettify">=C2=A0 =C2=A0 std</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tuple</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">double<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">-</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #080;" class=3D"styled-by-prettify">"abc"</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #080;" class=3D"styled-by-prettify">"xyz"</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">.</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">5</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">};</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 std</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">::</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify">tuple</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl1</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 std</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">::</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify">tuple</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">double<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl2</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 split</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">(</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify"> tpl1</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl2</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
></div>
          </code></div>
        <div><br>
        </div>
        <div>is just nonsense, as written.</div>
      </div>
    </blockquote>
    See above.<br>
    <blockquote
      cite=3D"mid:7e08b6c5-853c-471e-b248-a9df7e8e27be@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>However, under the "unpacking with postfix tilde"
          not-a-proposal, a similar operation could be written like
          this:</div>
        <div><br>
        </div>
        <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
          250); border: 1px solid rgb(187, 187, 187); word-wrap:
          break-word;"><code class=3D"prettyprint">
            <div class=3D"subprettyprint"><span style=3D"color: #000;"
                class=3D"styled-by-prettify">=C2=A0 =C2=A0 tuple</span><spa=
n
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">double<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl </=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">-</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #080;" class=3D"styled-by-prettify">"abc"</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #080;" class=3D"styled-by-prettify">"xyz"</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">.</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">5</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">};</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 tuple</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">&lt;</span><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl1</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 tuple</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">&lt;</span><span
                style=3D"color: #008;" class=3D"styled-by-prettify">string<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">double<=
/span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl2</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                <br>
                =C2=A0 =C2=A0 std</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">::</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify">tie</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl1</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">~...,</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl2</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">~...)</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> tpl</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                <br>
                =C2=A0 =C2=A0 </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">assert</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">std</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">0</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl1</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">0</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">));</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">assert</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">std</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl1</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">));</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">assert</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">std</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">0</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl2</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">2</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">));</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">assert</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">std</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl2</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D<=
/span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> std</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">get</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">3</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify">tpl</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">));</sp=
an></div>
          </code></div>
        <div>
          <div><br>
          </div>
        </div>
        <div>In general, I think that the C++ standard library is
          woefully lacking in tuple manipulators... but rather than
          proposing new tuple manipulators (of which there could be a
          million: zip, fold, map, car, cdr, reverse,...), we should be
          trying to give people the ability to express those
          manipulators natively in the language, via something like
          Matthew's [:] notation or my ~... notation.</div>
        <div><br>
        </div>
        <br>
      </div>
    </blockquote>
    Just wondering how could help the no-yet-proposed operators=C2=A0 [:], =
~,
    and=C2=A0 ... to implement what I interpreted.<br>
    <br>
    Vicente<br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"https://groups.google.com/a/isocpp.org/group=
/std-proposals/">https://groups.google.com/a/isocpp.org/group/std-proposals=
/</a>.<br />

--------------090706040204090900080905--

.
