220 41468 <8a165c32-718a-4247-93b4-44235a2cf122@isocpp.org> article
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: will wray <wjwray@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allow array as function return value
Date: Mon, 18 Feb 2019 08:24:36 -0800 (PST)
Approved: news@gmane.org
Message-ID: <8a165c32-718a-4247-93b4-44235a2cf122@isocpp.org>
References: <e1c07ac6-73d0-40c8-98a0-60a5c8a6c575@isocpp.org>
 <CAM76qmtaaQtCP_+f5Z6B3jCsruZVzSR7Q6ezcVX=zMSjq4ujcQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_693_1766519651.1550507077021"
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
	logging-data="81372"; mail-complaints-to="usenet@blaine.gmane.org"
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC7LL4HG4IBRBRNYVPRQKGQEBGR2ZNA@isocpp.org Mon Feb 18 17:24:46 2019
Return-path: <std-proposals+bncBC7LL4HG4IBRBRNYVPRQKGQEBGR2ZNA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw1-f71.google.com ([209.85.161.71])
	by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.89)
	(envelope-from <std-proposals+bncBC7LL4HG4IBRBRNYVPRQKGQEBGR2ZNA@isocpp.org>)
	id 1gvlin-000Kpo-J1
	for gclcip-std-proposals@m.gmane.org; Mon, 18 Feb 2019 17:24:45 +0100
Original-Received: by mail-yw1-f71.google.com with SMTP id c74sf11383002ywc.9
        for <gclcip-std-proposals@m.gmane.org>; Mon, 18 Feb 2019 08:24:39 -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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=FlHWQYbgHMjaeYscvThPHb6nOYrAy0jVlkcXJVCj5Rg=;
        b=oXDoKVoYV+J8UAqxlrLtv9NDjrluTIDu7KZ6GDyL3LRdJJ6wNUOTu+L/YEQqFAGSiT
         cH6jhYvgC3Z8/MO5SchJXYLAry5uLFzIpjVnlkQJdzlNiRkH+YsdtPmthgKFYcsXrzi+
         93GCIsEpdR/IKrDg8dnDfOC8E6s7Ane/wEOQiGorK8QPoFsRLdUE+KwG/vbVaY+ocLep
         F1V6FWExzdf2CyJxjg4RzB3H17E4hYsenz3V228vGt7+vNk7cOwcX7iPA0XdUdJjVZO6
         KLLhaOFnuDgl+vtm5/itVe14DzDm3EuE7eOYSQNCEB04dPVwUR8C/k9UFvoOnCBGy2dv
         NDaA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=FlHWQYbgHMjaeYscvThPHb6nOYrAy0jVlkcXJVCj5Rg=;
        b=OH1OzcjeGGsmz0GSh6vcSBPDT20wa5HvxmgzPkfxUVIHzZaGowY9DBBup9MHyUOF+X
         zdIvm99KI6Vf2u4U5eL9I8/1MGmJCffA2hEt0SXunI2BsXfNKFdcvANzfyInsTNIblbo
         f2SMCgEGykv4ufcZZP6HYCrksmfyChx0wGYaGP7PPlknnk5M0e+dGOJCBP+urfNc5H4K
         TDqkJmMJx13cEvSIhy63RVLh+upuCbdCG+0204JkA0hA61ZJxXy7ysV/ev3PR4SPM8zg
         r6z7opiSk8CoOmXXPGLWA8b43z+2XCNuwz9leIRm01a63bS+NFV8ojgs/qYdlgiWiSUV
         n7qA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        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=FlHWQYbgHMjaeYscvThPHb6nOYrAy0jVlkcXJVCj5Rg=;
        b=QidQKjfk9P56N6XSkn9cJ7i6etuTTV2abtzq8sFKmdNcqGT2zdFa2HinGCg3hXWwY9
         4xe6yAB4tH8N8VShCY2AJ13wba4F8omzvc3WIfIDPlH09tpvgRGA5ImQvZS71jQAldbw
         iH3fnd5KmPIErgZ6gGnXLZL7cQ/ARifzAOiUiOEHsbZYn6sTbm7kLZl0DgF9vBnhlhQR
         lcLkn09dGqPFGJZyF2GIZSjkM6EzlH0LlaAZYofjF71t4uodSBs2VUL2ZJZqtPV4brIg
         cef58emMU4zc7dwzmGBX6/SjJ/ob2ARrnABNvvMf5b7zZvj7OdReVUCHolBrp/mWxtpQ
         ankA==
X-Gm-Message-State: AHQUAuayeiLkIWQ0eeCp/jdqUnYTrRZU5mas9XRjBl7zUkv4dDsyqFKF
	ATWOGVpzdsoSG2tpsr6dAOlAmw==
X-Google-Smtp-Source: AHgI3IYsokdkanPjoixOGPbAybeTGe+j+xQPMRHkmB5hbISQMLwEK6+r0XGstuELM8C9m+5MFWrSIA==
X-Received: by 2002:a25:4fc3:: with SMTP id d186mr11975441ybb.54.1550507078731;
        Mon, 18 Feb 2019 08:24:38 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:2f0a:: with SMTP id v10ls5163914ywv.10.gmail; Mon, 18
 Feb 2019 08:24:37 -0800 (PST)
X-Received: by 2002:a81:5f89:: with SMTP id t131mr218778ywb.2.1550507077568;
        Mon, 18 Feb 2019 08:24:37 -0800 (PST)
In-Reply-To: <CAM76qmtaaQtCP_+f5Z6B3jCsruZVzSR7Q6ezcVX=zMSjq4ujcQ@mail.gmail.com>
X-Original-Sender: wjwray@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:41468
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41468>

------=_Part_693_1766519651.1550507077021
Content-Type: multipart/alternative; 
	boundary="----=_Part_694_347649933.1550507077022"

------=_Part_694_347649933.1550507077022
Content-Type: text/plain; charset="UTF-8"

std::array is long in the tooth as an early C++11 demo class.

std::array hasn't proved itself as a 'vocabulary' type for API usage -
spans and ranges supersede and they operate fine with built-in array.

std::array does not 'roundtrip' the wrapped array type; data() returns a 
pointer.
std::array tuple-access customization for structured binding access trumps 
the regular
aggregate structured binding access which would have given direct 
'roundtrip' access...
std::array is awkward to use for multidimensional arrays.
std::array CTAD guides added for 17 only give 'all or none' deduction - you 
can't provide
just the type and deduce size - function's deducing built-in array are more 
flexible.

std::array doesn't have C-linkage.
std::array may add end-padding (?).

Built-in array, despite the danger, is a simple language-level solution.
Built-in array has std::swap specialization... 

On Monday, February 18, 2019 at 10:49:31 AM UTC-5, Manuel Bergler wrote:
>
>
> Am Mo., 18. Feb. 2019 um 16:30 Uhr schrieb will wray <wjw...@gmail.com 
> <javascript:>>:
>
>> [...]
>>
>> With array return allowed, struct wrappers like std::array are not 
>> necessary:
>>
>  
> What's wrong with std::array as a function return type? Both returning 
> with brace-init and structured bindings work for std::array.
>  
>

-- 
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/8a165c32-718a-4247-93b4-44235a2cf122%40isocpp.org.

------=_Part_694_347649933.1550507077022
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>std::array is long in the tooth as an early C++11 dem=
o class.</div><div><br></div><div>std::array hasn&#39;t proved itself as a =
&#39;vocabulary&#39; type for API usage -</div><div>spans and ranges supers=
ede and they operate fine with built-in array.</div><div><br></div><div>std=
::array does not &#39;roundtrip&#39; the wrapped array type; data() returns=
 a pointer.<br></div><div>std::array tuple-access customization for structu=
red binding access trumps the regular</div><div>aggregate structured bindin=
g access which would have given direct &#39;roundtrip&#39; access...</div><=
div>std::array is awkward to use for multidimensional arrays.<br></div><div=
><div>std::array CTAD guides added for 17 only give &#39;all or none&#39; d=
eduction - you can&#39;t provide<br></div><div><div>just the type and deduc=
e size - function&#39;s deducing built-in array are more flexible.</div></d=
iv><div><br></div><div><div>std::array doesn&#39;t have C-linkage.<br></div=
><div>std::array may add end-padding (?).</div><div></div></div><div><br></=
div><div>Built-in array, despite the danger, is a simple language-level sol=
ution.</div><div>Built-in array has std::swap specialization...=C2=A0</div>=
<div><br>On Monday, February 18, 2019 at 10:49:31 AM UTC-5, Manuel Bergler =
wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div di=
r=3D"ltr"></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">Am Mo., 18.=
 Feb. 2019 um 16:30=C2=A0Uhr schrieb will wray &lt;<a href=3D"javascript:" =
target=3D"_blank" gdf-obfuscated-mailto=3D"uATE48hQAAAJ" rel=3D"nofollow" o=
nmousedown=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"th=
is.href=3D&#39;javascript:&#39;;return true;">wjw...@gmail.com</a>&gt;:<br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><d=
iv>[...]</div><div><br></div><div>With array return allowed, struct wrapper=
s like std::array are not necessary:</div></div></blockquote><div>=C2=A0</d=
iv><div>What&#39;s wrong with std::array as a function return type? Both re=
turning with brace-init and structured bindings work for std::array.</div><=
div>=C2=A0<br></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/8a165c32-718a-4247-93b4-44235a2cf122%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8a165c32-718a-4247-93b4-44235a2cf122=
%40isocpp.org</a>.<br />

------=_Part_694_347649933.1550507077022--

------=_Part_693_1766519651.1550507077021--

.
