220 23733 <CAKiZDp0w6Rz7aDNzWPfvFFtPEOn9JytG2G2uPVWch4naMdinfA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Patrice Roy <patricer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Default tuple-like access
Date: Thu, 14 Jan 2016 21:02:04 -0500
Lines: 195
Approved: news@gmane.org
Message-ID: <CAKiZDp0w6Rz7aDNzWPfvFFtPEOn9JytG2G2uPVWch4naMdinfA@mail.gmail.com>
References: <569583AD.9050208@wanadoo.fr>
	<n78m0f$5al$1@ger.gmane.org>
	<5697E783.2020509@wanadoo.fr>
	<n78ptj$dt3$1@ger.gmane.org>
	<5698067B.3010706@wanadoo.fr>
	<n792h2$iia$1@ger.gmane.org>
	<CAGg_6+PPt=FgSzp8hOUBsxETy1R4vgwiOjhvp2sH-90siSQoxw@mail.gmail.com>
	<n796dp$s8d$1@ger.gmane.org>
	<CAGg_6+OG=EfLBrkDx-BaSRociOevCHmamfksCdfaOQ5dQKVGmA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a113f9b442d4099052955ca8e
X-Trace: ger.gmane.org 1452823332 10980 80.91.229.3 (15 Jan 2016 02:02:12 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 15 Jan 2016 02:02:12 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDSZXMHWZIKBBHFG4G2AKGQEKQJ66HA@isocpp.org Fri Jan 15 03:02:08 2016
Return-path: <std-proposals+bncBDSZXMHWZIKBBHFG4G2AKGQEKQJ66HA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f72.google.com ([209.85.218.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDSZXMHWZIKBBHFG4G2AKGQEKQJ66HA@isocpp.org>)
	id 1aJtiJ-0005U2-7M
	for gclcip-std-proposals@m.gmane.org; Fri, 15 Jan 2016 03:02:07 +0100
Original-Received: by mail-oi0-f72.google.com with SMTP id x185sf1034338330oia.3
        for <gclcip-std-proposals@m.gmane.org>; Thu, 14 Jan 2016 18:02:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from: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=CW+fRO0/CItFs4oSZJnHQ3UHv7JkZGAE87wtjqTVpBc=;
        b=yGwNlvXK8dMmj8lGWXx1b+g7BEcMr028D1ezC0G+ttCVz0a7MwWI9LbjNNFPLUpdn/
         k7ccnH3JjYcgVMN3r5u+t82w67I/zNjE56dDq09XfxoCYRUE6vQ+K7N4yjQygAgA2Lvf
         jAnKqTz3gW2rpEKcA++U4GfEapL0dkfoxgiT+xlYzYxMtE7XwOCSAjnkWDMIEfBkt8gU
         1yI7VAIMBWwwLiZZt6O3LFvZxa9KewCd7ODn5s1KL9bPOV3g8ieDlvlKkVnkcFBFYAb6
         HM0hSWmC3D4S+1yT+XOV0Jh8jIIkpFvXY7DbqGDctNHNMYsr/50LjMJoA2OLyGJ3eOir
         fYQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from: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=CW+fRO0/CItFs4oSZJnHQ3UHv7JkZGAE87wtjqTVpBc=;
        b=d8uyRZ4DRm8vC7lj67eFXm8m6FuDBhCt4hFWJ3pVV+F50BqTJX/8Bugd80VgfDINEk
         IobyqhJUL3UtnzT5eDEbI7qlhuqDHWNe18rJ552KxQB1UlZJbpPqr9br27TXcdmgPNTC
         SGq02/xcWtJ6OoL3qWEIVZ8W72UMfy95Lpjd7LjqjcPT/OfiH/t/lEW+nIabNOrsGcE/
         gvQuaNkxkMqXEEOgfSP/LsnJtzB8tf/L5EBmg24lRP5hpOTk+Sg4Hwr92plr077rslTc
         VS7hhbJJG7rykQ4+JBAd9ewh7WZ1FA6bKv/AE8VkBPiviYCGBXC8Z9hh1/omkt1ULnfQ
         WBHQ==
X-Gm-Message-State: ALoCoQm+2Pi07kYaOk+QQyR2a+w1Ikb6Yd6q8I7he22KH/L7i4mXoepJRXpL1oCI/1Q7W7wM7FvGTAqvNRW366E/yK/qEUXXqA==
X-Received: by 10.107.152.10 with SMTP id a10mr7473728ioe.28.1452823326028;
        Thu, 14 Jan 2016 18:02:06 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.129.163 with SMTP id l35ls688551ioi.95.gmail; Thu, 14 Jan
 2016 18:02:04 -0800 (PST)
X-Received: by 10.107.2.65 with SMTP id 62mr7117139ioc.78.1452823324705;
        Thu, 14 Jan 2016 18:02:04 -0800 (PST)
Original-Received: from mail-io0-x232.google.com (mail-io0-x232.google.com. [2607:f8b0:4001:c06::232])
        by mx.google.com with ESMTPS id v15si887884igd.22.2016.01.14.18.02.04
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 14 Jan 2016 18:02:04 -0800 (PST)
Received-SPF: pass (google.com: domain of patricer@gmail.com designates 2607:f8b0:4001:c06::232 as permitted sender) client-ip=2607:f8b0:4001:c06::232;
Original-Received: by mail-io0-x232.google.com with SMTP id q21so472983188iod.0
        for <std-proposals@isocpp.org>; Thu, 14 Jan 2016 18:02:04 -0800 (PST)
X-Received: by 10.107.10.88 with SMTP id u85mr7955270ioi.5.1452823324473; Thu,
 14 Jan 2016 18:02:04 -0800 (PST)
Original-Received: by 10.79.6.87 with HTTP; Thu, 14 Jan 2016 18:02:04 -0800 (PST)
In-Reply-To: <CAGg_6+OG=EfLBrkDx-BaSRociOevCHmamfksCdfaOQ5dQKVGmA@mail.gmail.com>
X-Original-Sender: patricer@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of patricer@gmail.com designates 2607:f8b0:4001:c06::232 as permitted
 sender) smtp.mailfrom=patricer@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:23733
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/23733>

--001a113f9b442d4099052955ca8e
Content-Type: text/plain; charset=UTF-8

The risks mostly come from program-generated tuples / variadics; these are
the ones that will get long. I'm also uncomfortable with beliefs of low
number of types / elements... Things such as tuples resulting from merging
tuples, for example. Let's play it safe and plan for survival in the face
of big numbers.

2016-01-14 17:21 GMT-05:00 Nevin Liber <nevin@cplusplusguy.com>:

> On 14 January 2016 at 16:11, Matthew Woehlke <mwoehlke.floss@gmail.com>
> wrote:
>
>> On 2016-01-14 16:40, Nevin Liber wrote:
>> > On 14 January 2016 at 15:04, Matthew Woehlke wrote:
>> >>> I don't see how implement the tuple_size you are suggesting
>> efficiently.
>> >>> How will you find the N? trying with get<0>, get<1>, get<2>, ...
>> get<N>,
>> >>> up to a failing get<N+1>?
>> >>
>> >> Yes, exactly. I don't see a serious efficiency problem here; I expect
>> >> that in most cases, the number will be small,
>> >
>> > Please don't make that assumption.  It reminds me of life before
>> variadic
>> > templates.
>>
>> I'm really struggling to think of why you would have a (non-array)
>> tuple-like that has more than a few dozen members.
>
>
> A tuple-like data structure to capture an expression template, for
> instance.  It can be arbitrarily large.
>
> Don't engineer in limits if you don't have to, and don't engineer in O(N)
> algorithms (even at compile time) if you don't have to.  There is no reason
> not to expose it.  What is the actual objection to doing so, other than we
> aren't providing the absolute barest possible minimal set of operations by
> doing so.
>
>
>> That's a *very*
>> complicated complex type. (Array-like types don't count; you'll almost
>> certainly specialize tuple_size for those.)
>>
>> > One use case for knowing N is when you want to get things in reverse
>> > order.  Users shouldn't have to go through hoops just to figure out how
>> to
>> > do that, nor write code that requires O(N) template instantiations to
>> > calculate it, because when they get it wrong, they'll still get horrible
>> > error messages.
>>
>> ...but it *doesn't* "require O(N) template instantiations". That's just
>> the case *if you don't provide a specialization*. If you have a type for
>> which N is large, then provide your own tuple_size.
>
>
> Why should I have to?  This is why people rightly complain about C++.  We
> really don't have to make everything hard to accomplish.
> --
>  Nevin ":-)" Liber  <mailto:nevin@cplusplusguy.com
> <nevin@eviloverlord.com>>  +1-847-691-1404
>
> --
>
> ---
> 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/.
>

-- 

--- 
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/.

--001a113f9b442d4099052955ca8e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The risks mostly come from program-generated tuples / vari=
adics; these are the ones that will get long. I&#39;m also uncomfortable wi=
th beliefs of low number of types / elements... Things such as tuples resul=
ting from merging tuples, for example. Let&#39;s play it safe and plan for =
survival in the face of big numbers.<br></div><div class=3D"gmail_extra"><b=
r><div class=3D"gmail_quote">2016-01-14 17:21 GMT-05:00 Nevin Liber <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:nevin@cplusplusguy.com" target=3D"_blank">=
nevin@cplusplusguy.com</a>&gt;</span>:<br><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr"><span class=3D"">On 14 January 2016 at 16:11, Matthew Woehlk=
e <span dir=3D"ltr">&lt;<a href=3D"mailto:mwoehlke.floss@gmail.com" target=
=3D"_blank">mwoehlke.floss@gmail.com</a>&gt;</span> wrote:<br></span><div c=
lass=3D"gmail_extra"><div class=3D"gmail_quote"><span class=3D""><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">On 2016-01-14 16:40, Nevin Liber wrote:<br>
<span>&gt; On 14 January 2016 at 15:04, Matthew Woehlke wrote:<br>
&gt;&gt;&gt; I don&#39;t see how implement the tuple_size you are suggestin=
g efficiently.<br>
&gt;&gt;&gt; How will you find the N? trying with get&lt;0&gt;, get&lt;1&gt=
;, get&lt;2&gt;, ... get&lt;N&gt;,<br>
&gt;&gt;&gt; up to a failing get&lt;N+1&gt;?<br>
&gt;&gt;<br>
&gt;&gt; Yes, exactly. I don&#39;t see a serious efficiency problem here; I=
 expect<br>
&gt;&gt; that in most cases, the number will be small,<br>
&gt;<br>
&gt; Please don&#39;t make that assumption.=C2=A0 It reminds me of life bef=
ore variadic<br>
&gt; templates.<br>
<br>
</span>I&#39;m really struggling to think of why you would have a (non-arra=
y)<br>
tuple-like that has more than a few dozen members.</blockquote><div><br></d=
iv></span><div>A tuple-like data structure to capture an expression templat=
e, for instance.=C2=A0 It can be arbitrarily large.</div><div><br></div><di=
v>Don&#39;t engineer in limits if you don&#39;t have to, and don&#39;t engi=
neer in O(N) algorithms (even at compile time) if you don&#39;t have to.=C2=
=A0 There is no reason not to expose it.=C2=A0 What is the actual objection=
 to doing so, other than we aren&#39;t providing the absolute barest possib=
le minimal set of operations by doing so.</div><span class=3D""><div>=C2=A0=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"> That&#39;s a *very*<br>
complicated complex type. (Array-like types don&#39;t count; you&#39;ll alm=
ost<br>
certainly specialize tuple_size for those.)<br>
<span><br>
&gt; One use case for knowing N is when you want to get things in reverse<b=
r>
&gt; order.=C2=A0 Users shouldn&#39;t have to go through hoops just to figu=
re out how to<br>
&gt; do that, nor write code that requires O(N) template instantiations to<=
br>
&gt; calculate it, because when they get it wrong, they&#39;ll still get ho=
rrible<br>
&gt; error messages.<br>
<br>
</span>...but it *doesn&#39;t* &quot;require O(N) template instantiations&q=
uot;. That&#39;s just<br>
the case *if you don&#39;t provide a specialization*. If you have a type fo=
r<br>
which N is large, then provide your own tuple_size. </blockquote><div><br><=
/div></span><div>Why should I have to?=C2=A0 This is why people rightly com=
plain about C++.=C2=A0 We really don&#39;t have to make everything hard to =
accomplish.<span class=3D"HOEnZb"><font color=3D"#888888"><br>-- <br><div><=
div dir=3D"ltr">=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=
=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@cplusplusguy.com=
</a>&gt;=C2=A0 <a href=3D"tel:%2B1-847-691-1404" value=3D"+18476911404" tar=
get=3D"_blank">+1-847-691-1404</a><br></div></div>
</font></span></div></div></div>
</div><div class=3D"HOEnZb"><div class=3D"h5">

<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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"https://groups.google.com/a/isocpp.org/group=
/std-proposals/" target=3D"_blank">https://groups.google.com/a/isocpp.org/g=
roup/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--001a113f9b442d4099052955ca8e--

.
