220 41474 <CAC+0CCPKvKDGrYdvLwPGtKYQ-2=mOFdi5tAA0PzwU_JAvQHjtQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Jake Arkinstall <jake.arkinstall@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allow array as function return value
Date: Tue, 19 Feb 2019 16:30:33 +0000
Approved: news@gmane.org
Message-ID: <CAC+0CCPKvKDGrYdvLwPGtKYQ-2=mOFdi5tAA0PzwU_JAvQHjtQ@mail.gmail.com>
References: <e1c07ac6-73d0-40c8-98a0-60a5c8a6c575@isocpp.org>
 <CAM76qmtaaQtCP_+f5Z6B3jCsruZVzSR7Q6ezcVX=zMSjq4ujcQ@mail.gmail.com>
 <8a165c32-718a-4247-93b4-44235a2cf122@isocpp.org> <f870e6c5-4cb2-47f8-d963-363e68626841@gmail.com>
 <65d69c2c-3fa1-40a5-8120-53bfd345ac90@isocpp.org>
Reply-To: std-proposals@isocpp.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="0000000000004e8728058241c312"
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
	logging-data="244259"; mail-complaints-to="usenet@blaine.gmane.org"
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDCZX3WUUQFRBNO6WDRQKGQEGHWTY7Y@isocpp.org Tue Feb 19 17:30:49 2019
Return-path: <std-proposals+bncBDCZX3WUUQFRBNO6WDRQKGQEGHWTY7Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it1-f197.google.com ([209.85.166.197])
	by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.89)
	(envelope-from <std-proposals+bncBDCZX3WUUQFRBNO6WDRQKGQEGHWTY7Y@isocpp.org>)
	id 1gw8IC-0011O5-A8
	for gclcip-std-proposals@m.gmane.org; Tue, 19 Feb 2019 17:30:48 +0100
Original-Received: by mail-it1-f197.google.com with SMTP id m136sf5240624ita.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 19 Feb 2019 08:30:47 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1550593846; cv=pass;
        d=google.com; s=arc-20160816;
        b=F4yElba0PJpMNiTNWI/09qCPcMUlz+3Qswfgu0XSThcOmWQFohwY42OwfGKFb0vn5J
         noD1Ls3xz+VDLyehbE8ESVzyt4B/bsqwVC8qi/Urym0cIgaMCFZNUk1Vw7Vrq/q2HP7e
         jmKsioTVebX9DOA3Z2lYYEXLfeiAf5h/7qSRl9b9Is5PaoYR3AMHpev9sZIuTTaDIrAh
         PAoEwyF+9R1UwHZZNyXY/f1A+1n4zAdl+p4br5g1dn0UKuGxrgnLiw6w8HtsAsW/Kzjl
         MLHS7nTYpor837blff4dFsdaFb/kbKJcBRWDJsq4iDvKsWXYhoi9hR63B2vPXCzPr2LT
         Y6WQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:dkim-signature;
        bh=wyqZaIfeIpfq2IyzCog48FBaphdOGSuZiPtiM47H6dI=;
        b=0IyTybo+XPV8RFpiL3YHzBmCUd5C6eJrN/NH13Zu/C5KJl5kpCakXQ10MaXC++jYco
         0M83GUXZ8j2znBreXjHtVmno6erysJRYGNAuU5OU6IftkcxXsb63SXIueZIPT3fSxzur
         XHE1e7rzdjry2Hti+AEsLt8eCvll0jGfDrw54zV02i42X2hUGUfR3UlFsGgcZI4TSZQ7
         ODIVciURQ/wc5BBuIaB0efw2RYdUFvBxzX5aeC+bFfp5spEqdZqV+J2bZOXinUetPLIv
         2gbnUHi8vtcXYPYi6ApsB+LPiyqCCXquz5fHR+enJH0pIOeONGeqhYuvsbyTy/QULtye
         Srig==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=kGSgFaeU;
       spf=pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=wyqZaIfeIpfq2IyzCog48FBaphdOGSuZiPtiM47H6dI=;
        b=Fp1BH/3w2WPuq3WIANgto8lBgKh+0XoZFj/eec5hx4BGY0iO3dQkCyDsH6huN/5Fqy
         68ZkfjI1jDJ857tP/otiAgMTxCt9Ldnl4Que9gxxbYBUxEXgmqmUxb15KBqohGxh358K
         snIpj+Dd16E49CFRQ0RZZvBSL3eKwNkaMoxLak6kCSQkj+idbZoWsVRxggGwBAaAUqfB
         V6x+l2CRuf2ImbxkzWW5BrYApjTcnLMNb6C0GW7tkFMMCl3eeIQStu2phXQPffe2tPIo
         /00vbnq+aVtphtpcpP9bY9V3Y9ZpoP1Bh40XylDdbJcrpoplQLhKAKbJznEhVEAyeYUg
         8nsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to: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=wyqZaIfeIpfq2IyzCog48FBaphdOGSuZiPtiM47H6dI=;
        b=DBQKnK/82faIKZaPg6L7iVPik8kA6++blJX+57c9NtCvl0i0p9MiB5yfOzoQHoRZux
         gM4VEWrYfa9w7dfwoGWQURL/gECmvUvUSZz1Q6AUXQGS38075/Dy8Rx5aDDP3lTeg47m
         qNPz7hG3hB+/r9gcVpTgqRSshfI0iGBCAoJ8l2ba28Iw4+f/VGTUoZBbLxL7gOh4Tjc2
         Jd17loSa3LxQHe1jelHRItplhE4Ma67Y/ALXcMa+cAPq49/rHUx7Sj+1/7JTaq4TTrYH
         SUCuu1gIL2PH4z6Llhn1GcQs/Uu8hgjniVMaKz7PG3oQA3l2afJcc7Pq7BTuvdQLhkce
         AgqQ==
X-Gm-Message-State: AHQUAuY0vCtZpFZcQ5/8IoeN9exYGLZfU5N7qnqQq5NkSvITlYvaCn+6
	9DfUKS2iSs9hOZE4fMKI8mxm6A==
X-Google-Smtp-Source: AHgI3IbRtcgE1ASVa4KactAYirV5wtrxfQWkURN/JZvz7Lu/nJRDsnTSuiCu6RcrQQVkUopRyldCcg==
X-Received: by 2002:a6b:fb01:: with SMTP id h1mr6031873iog.31.1550593846498;
        Tue, 19 Feb 2019 08:30:46 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a24:694d:: with SMTP id e74ls870906itc.4.canary-gmail; Tue,
 19 Feb 2019 08:30:45 -0800 (PST)
X-Received: by 2002:a24:74d1:: with SMTP id o200mr2706238itc.95.1550593845209;
        Tue, 19 Feb 2019 08:30:45 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1550593845; cv=none;
        d=google.com; s=arc-20160816;
        b=kSK4Ws6+A/Df3diHnGklWqosYvIGwQ0t3emIHj8/3mCy6doc/851ChL5+SGPDV0gI5
         Zh2LE98pfQdO9s4Dk6HbbXBmZTClvWxPW1RlIlMTdq7XG9vTpnzYMu8M/eeJULf7bhGj
         TLToKT3e3RyKme3YnxMOAkHKL2udgrvoUHCw2GaBvl4SeNUh8S6Ea+a/JmZTNxy5AhUx
         TODZsJiyZZkfPRormAO0zjXoSzzzSA5I9hp3O7ir0K1rLEyyfFslUrw0H9HwEo5OOqnK
         jkfiKZkGN/jEZST6IiqA8sKAycjVydmstAOM9YHx3y4CFvE6XIwofmzObbfxHig16vUU
         52vQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=cRw2rDGg5C/ZrlW2wwPOBhsnPU2nq2HYUkooF1J5yZY=;
        b=hkACQWFkMEQNo0Gzqv8dfI30SiQ3HI5Wddg2sdexRrEtlEZk5hHUA9Lm9gHTY7ozOH
         kscyhxBMZFDZlLWy8QR2mltpnAm0mM6FeLONSg7ZJkzTrQvWCzx041LDIeE7sOO9hYO2
         kezmd+3OkRiOy6vv/vcweBWdgbTLY+JlxrErBHeGpVAZQgJ2KCQYJ0tU+b3sxm+XgYhW
         RUTtcHzMEXaKVfDZbK8UX7ZMCSFJy5seHkkeyVYFFjmNr1U2GQKbt9ZCUiXYaJ+LsPZc
         lR8VZS7qCHqxbSld/zSeg/u6AP8LIFENM5Vdob2V5CR1U6XchZUjfMaDVIySgBibWFXI
         wd0A==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=kGSgFaeU;
       spf=pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id d188sor4235179ite.10.2019.02.19.08.30.45
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Tue, 19 Feb 2019 08:30:45 -0800 (PST)
Received-SPF: pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a24:4706:: with SMTP id t6mr2432063itb.109.1550593844740;
 Tue, 19 Feb 2019 08:30:44 -0800 (PST)
In-Reply-To: <65d69c2c-3fa1-40a5-8120-53bfd345ac90@isocpp.org>
X-Original-Sender: jake.arkinstall@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=kGSgFaeU;       spf=pass
 (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE 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-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:41474
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41474>

--0000000000004e8728058241c312
Content-Type: text/plain; charset="UTF-8"

On Tue, 19 Feb 2019, 15:52 will wray <wjwray@gmail.com wrote:

> (Trying one more time - previous attempts went to the google groups spam
> filter)
>
> C-array is an atomic aggregate - a pure crystal condensate of one atom
> type.
>
> This thread is to discuss improved language support for C-array via array
> return.
>
> (It is not about addressing std::array shortcomings.
>  It is not an either / or.
>  C-array and std::array are different tools for different tasks.)
>
>> The fact that array return is now technically feasible shows how far C++
> language
> specification has risen above its C roots.
> What was impossible for forty years is now possible.
>
>> Raw array is analogous to raw pointer.
> We've outgrown the urge to wrap all pointers - that's not so smart.
> Raw pointers have been rehabilitated as the right tool for low level code.
> Raw arrays deserve to be rehabilitated, with a little language level love.
>

I'm not so sure on that. std::array gives the compiler the knowledge of the
size so that the user doesn't have to pass it around manually, but in a
compiled executable I don't see any difference except for removal of jump
instructions in the std::array case thanks to loop unrolling.

Im definitely against any notion of removing raw arrays from the language
(because it is nonsensical), but I also never use them explicitly unless
I'm doing unmentionable casty and c-stringy things in low latency settings
- and even then I'm doing it via std::array.data().


> On Monday, February 18, 2019 at 11:33:19 AM UTC-5, Joel Falcou wrote:
>>
>> C style arrays must disappear as they have no value over std::array
>>
>
> (Eh? Trollish joke?)
> C-array is essential to implement std::array - it can't and won't
> disappear.
>
> std::array is a molecular aggregate, an abstract compound
>
>> 'compound': make (something bad) worse; intensify the negative aspects
>> of.
>
>

-- 
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/CAC%2B0CCPKvKDGrYdvLwPGtKYQ-2%3DmOFdi5tAA0PzwU_JAvQHjtQ%40mail.gmail.com.

--0000000000004e8728058241c312
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, =
19 Feb 2019, 15:52 will wray &lt;<a href=3D"mailto:wjwray@gmail.com">wjwray=
@gmail.com</a> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"l=
tr">(Trying one more time - previous attempts went to the google groups spa=
m filter)<br><div><br><span style=3D"font-family:Roboto,&quot;Helvetica Neu=
e&quot;,Helvetica,Arial,sans-serif;font-size:small">C-array is an atomic ag=
gregate - a pure crystal condensate of one atom type.</span><div><font face=
=3D"Roboto, Helvetica Neue, Helvetica, Arial, sans-serif" size=3D"2"><br></=
font><div><div><div><span style=3D"font-family:Roboto,&quot;Helvetica Neue&=
quot;,Helvetica,Arial,sans-serif;font-size:small">This thread is to discuss=
 improved language support for C-array via array return.</span></div><div><=
span style=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Arial=
,sans-serif;font-size:small"><br></span></div><div><span style=3D"font-fami=
ly:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size:s=
mall">(It is not about addressing std::array shortcomings.</span></div><div=
><span style=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Ari=
al,sans-serif;font-size:small">=C2=A0It is not an either / or.=C2=A0</span>=
</div><div>=C2=A0C-array and std::array are different tools for different t=
asks.)</div><div><div style=3D"font-family:Roboto,&quot;Helvetica Neue&quot=
;,Helvetica,Arial,sans-serif;font-size:small"><blockquote class=3D"gmail_qu=
ote" style=3D"border-left:1px solid rgb(204,204,204);padding-left:1ex"><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex"></blockquote></blockquote>The=
 fact that array return is now technically feasible shows how far C++ langu=
age<br>specification has risen above its C roots.</div><div style=3D"font-f=
amily:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-siz=
e:small">What was impossible for forty years is now possible.</div><div sty=
le=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-se=
rif;font-size:small"><blockquote class=3D"gmail_quote" style=3D"border-left=
:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"></blockquote></blockquote>Raw array is analogous to ra=
w pointer.<br>We&#39;ve outgrown the urge to wrap all pointers - that&#39;s=
 not so smart.<br>Raw pointers have been rehabilitated as the right tool fo=
r low level code.<br>Raw arrays deserve to be rehabilitated, with a little =
language level love.</div></div></div></div></div></div></div></blockquote>=
</div></div><div dir=3D"auto"><br></div><div dir=3D"auto">I&#39;m not so su=
re on that. std::array gives the compiler the knowledge of the size so that=
 the user doesn&#39;t have to pass it around manually, but in a compiled ex=
ecutable I don&#39;t see any difference except for removal of jump instruct=
ions in the std::array case thanks to loop unrolling.</div><div dir=3D"auto=
"><br></div><div dir=3D"auto">Im definitely against any notion of removing =
raw arrays from the language (because it is nonsensical), but I also never =
use them explicitly unless I&#39;m doing unmentionable casty and c-stringy =
things in low latency settings - and even then I&#39;m doing it via std::ar=
ray.data().</div><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div>=
<div><div><div><br style=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,H=
elvetica,Arial,sans-serif;font-size:small"><span style=3D"font-family:Robot=
o,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size:small">On=
 Monday, February 18, 2019 at 11:33:19 AM UTC-5, Joel Falcou wrote:</span><=
blockquote class=3D"gmail_quote" style=3D"font-family:Roboto,&quot;Helvetic=
a Neue&quot;,Helvetica,Arial,sans-serif;font-size:small;margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">C style arra=
ys must disappear as they have no value over std::array=C2=A0<br></blockquo=
te><div style=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Ar=
ial,sans-serif;font-size:small"><br></div><div style=3D"font-family:Roboto,=
&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size:small">(Eh?=
 Trollish joke?)</div><div style=3D"font-family:Roboto,&quot;Helvetica Neue=
&quot;,Helvetica,Arial,sans-serif;font-size:small">C-array is essential to =
implement std::array - it can&#39;t and won&#39;t disappear.</div><div styl=
e=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-ser=
if;font-size:small"><br></div><div style=3D"font-family:Roboto,&quot;Helvet=
ica Neue&quot;,Helvetica,Arial,sans-serif;font-size:small">std::array is a =
molecular aggregate, an abstract compound<div><blockquote class=3D"gmail_qu=
ote" style=3D"font-family:Arial,Helvetica,sans-serif;font-size:13px;margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
<span style=3D"font-family:Roboto,&quot;Helvetica Neue&quot;,Helvetica,Aria=
l,sans-serif;font-size:small">&#39;compound&#39;:=C2=A0</span><span style=
=3D"font-family:arial,sans-serif;font-size:small">make (something bad) wors=
e; intensify the negative aspects of.</span></blockquote></div></div></div>=
</div></div></div></div></div>
</blockquote></div></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/CAC%2B0CCPKvKDGrYdvLwPGtKYQ-2%3DmOFdi=
5tAA0PzwU_JAvQHjtQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCPKvK=
DGrYdvLwPGtKYQ-2%3DmOFdi5tAA0PzwU_JAvQHjtQ%40mail.gmail.com</a>.<br />

--0000000000004e8728058241c312--

.
