220 24330 <CA+wfc1-FFqOJ9OSme_SpJAmGz+cshbMDVi_dLrF1ztbzkTN-WQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Oliver Kowalke <oliver.kowalke@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: [tuple] extracting tuples out of a tuple
Date: Fri, 12 Feb 2016 08:34:36 +0100
Lines: 73
Approved: news@gmane.org
Message-ID: <CA+wfc1-FFqOJ9OSme_SpJAmGz+cshbMDVi_dLrF1ztbzkTN-WQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e011762d120f0f8052b8db453
X-Trace: ger.gmane.org 1455262502 17920 80.91.229.3 (12 Feb 2016 07:35:02 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 12 Feb 2016 07:35:02 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCLZHP5J7MHRBIEW622QKGQECXF4UCQ@isocpp.org Fri Feb 12 08:34:58 2016
Return-path: <std-proposals+bncBCLZHP5J7MHRBIEW622QKGQECXF4UCQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qg0-f72.google.com ([209.85.192.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCLZHP5J7MHRBIEW622QKGQECXF4UCQ@isocpp.org>)
	id 1aU8Fm-0005ft-JN
	for gclcip-std-proposals@m.gmane.org; Fri, 12 Feb 2016 08:34:58 +0100
Original-Received: by mail-qg0-f72.google.com with SMTP id b67sf68623058qgb.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 11 Feb 2016 23:34:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:from:date:message-id:subject: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=jgvN2brsTOrEDmJl084QY3oPq3KrUxVmKDqJeXprAqE=;
        b=sCP8AhOgO8jUhjjxVmWCg77ZILYhNgNKHjQ3tlvT9ofoarRFhRcG5mRNH7qJ2RfQg9
         htquIHqhUd3Zju8Gu6/3S7HkTgHgkhOF3w99+rz/+VQBfmJMClGW0Q55ymwTJGeC58PS
         Oeb3CcjVdDcoKg/EZlhGCSfxluVRXLcFUVpRoExDR7gzmg8SMx/j7YSDnIkySoxfz5dV
         FpBlhmTi/sCLlKa4OFURYSFtzYy8OsZmBuMD08cZAaQ69Wc5duT7fl00BDuyHT5uxnPi
         8NSFLsmv0xGfHlTVQZrp+s+L7PefvjD3dIsxDjfURBSinHarC99DLJjEsorK55bIkLO8
         tE5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:from:date:message-id:subject: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=jgvN2brsTOrEDmJl084QY3oPq3KrUxVmKDqJeXprAqE=;
        b=hx8Vux+Isu+k7hZfmngzke2tzVPws8dYW6PUEjgNae9J7ZUnYO57+9+KCi7fMHKsf6
         6bDW5bnexwr1ZKCRe0pUuCRH7Wp5v63x0i7aXLbLmGNhbaqi4EnG7Xs6xbtIVy6l8YTB
         8B54xl3PuO8SK2Xyie+W9neP8OCUmdXDntFA5ZTX6502rUJp62N3FrDomB+QUB8r3f7d
         rnfbPN1CGQJIf2uXotZK7jyMKY3yOFzW4UB+XJondz0DlJGovbWDiVSUZ/fa1y5II4p4
         cvEbzp+/HmZk+iejh/ZMXBuH8XfU9yUi2ToJ9hSJ3ZgqeLTz9k+UVW0T/i4YZiwbIL+h
         tjrA==
X-Gm-Message-State: AG10YOSBK9560gN+yRPUOanWI27K85mlElJowN754Vth/bdeoSzLj7SixNT5BwfdVs1lYA==
X-Received: by 10.129.25.212 with SMTP id 203mr36679ywz.35.1455262497827;
        Thu, 11 Feb 2016 23:34:57 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.29.194 with SMTP id m2ls788176obh.0.gmail; Thu, 11 Feb
 2016 23:34:56 -0800 (PST)
X-Received: by 10.202.169.198 with SMTP id s189mr40180oie.35.1455262496560;
        Thu, 11 Feb 2016 23:34:56 -0800 (PST)
Original-Received: from mail-ob0-x234.google.com (mail-ob0-x234.google.com. [2607:f8b0:4003:c01::234])
        by mx.google.com with ESMTPS id e4si13679311obn.90.2016.02.11.23.34.56
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 11 Feb 2016 23:34:56 -0800 (PST)
Received-SPF: pass (google.com: domain of oliver.kowalke@gmail.com designates 2607:f8b0:4003:c01::234 as permitted sender) client-ip=2607:f8b0:4003:c01::234;
Original-Received: by mail-ob0-x234.google.com with SMTP id xk3so109667573obc.2
        for <std-proposals@isocpp.org>; Thu, 11 Feb 2016 23:34:56 -0800 (PST)
X-Received: by 10.60.178.180 with SMTP id cz20mr54534oec.15.1455262495976;
 Thu, 11 Feb 2016 23:34:55 -0800 (PST)
Original-Received: by 10.76.26.82 with HTTP; Thu, 11 Feb 2016 23:34:36 -0800 (PST)
X-Original-Sender: oliver.kowalke@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of oliver.kowalke@gmail.com designates 2607:f8b0:4003:c01::234 as
 permitted sender) smtp.mailfrom=oliver.kowalke@gmail.com;       dkim=pass
 header.i=@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-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:24330
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24330>

--089e011762d120f0f8052b8db453
Content-Type: text/plain; charset=UTF-8

In one project I've had the need for extracting tuples from the head/tail
of a given tuple.
Looking at cppreference.com it seams such functions are not part of the
standard yet.
Does a proposal exist that deals with this topic?

I would suggest something like:

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;

head( tpl1) = tpl;
tail( tpl2) = tpl;
split( tpl1, tpl2) = tpl;

Oliver

-- 

--- 
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.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-proposals/.

--089e011762d120f0f8052b8db453
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>In one project I&#39;ve had the need for extract=
ing <span tabindex=3D"-1" id=3D":1tt.12" style=3D"" class=3D"">tuples</span=
> from the head/tail of a given <span tabindex=3D"-1" id=3D":1tt.13" style=
=3D"" class=3D"">tuple</span>.<br></div><div>Looking at <span tabindex=3D"-=
1" id=3D":1tt.14" style=3D"" class=3D"">cppreference</span>.com it seams su=
ch functions are not part of the standard yet.<br></div><div>Does a proposa=
l exist that deals with this topic?<br></div><div><br></div>I would suggest=
 something like:<br></div><div><br>std::<span tabindex=3D"-1" id=3D":1tt.15=
" style=3D"" class=3D"">tuple</span>&lt; int, std::string, std::string, dou=
ble &gt; <span tabindex=3D"-1" id=3D":1tt.16" style=3D"" class=3D"">tpl</sp=
an>{ -1, &quot;<span tabindex=3D"-1" id=3D":1tt.17" style=3D"" class=3D"">a=
bc</span>&quot;, &quot;<span tabindex=3D"-1" id=3D":1tt.18" style=3D"" clas=
s=3D"">xyz</span>&quot;, .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"">tu=
ple</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( t=
pl2) =3D <span tabindex=3D"-1" id=3D":1tt.22" style=3D"" class=3D"">tpl</sp=
an>;<br></div><div>split( tpl1, tpl2) =3D tpl;<br></div><div><br></div>Oliv=
er<br><div><br></div></div>

<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 />

--089e011762d120f0f8052b8db453--

.
