220 40682 <bdbf2214-87c0-4d14-8831-c6ffd5da2eba@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mihailnajdenov@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Use new keyword to indicate that a function
 should return it's argument allocated on the heap
Date: Tue, 23 Oct 2018 00:16:18 -0700 (PDT)
Lines: 300
Approved: news@gmane.org
Message-ID: <bdbf2214-87c0-4d14-8831-c6ffd5da2eba@isocpp.org>
References: <269cd5f8-0201-431b-9683-52a945aa9c3d@isocpp.org> <c5e8d685-d72c-4163-bb6d-f9cee0fa190b@isocpp.org>
 <CAOfiQqnyH1r5e5QEKEgeSfa0pg3LbcVDb-URGLgGLap2f+J68A@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4882_74888822.1540278979047"
X-Trace: blaine.gmane.org 1540278855 19641 195.159.176.226 (23 Oct 2018 07:14:15 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 23 Oct 2018 07:14:15 +0000 (UTC)
Cc: sunsetburninginmysoul@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUJ3A7GRAPRBQ4VXPPAKGQEAJIUGMY@isocpp.org Tue Oct 23 09:14:11 2018
Return-path: <std-proposals+bncBCUJ3A7GRAPRBQ4VXPPAKGQEAJIUGMY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb1-f200.google.com ([209.85.219.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUJ3A7GRAPRBQ4VXPPAKGQEAJIUGMY@isocpp.org>)
	id 1gEqtG-0004yL-RF
	for gclcip-std-proposals@m.gmane.org; Tue, 23 Oct 2018 09:14:11 +0200
Original-Received: by mail-yb1-f200.google.com with SMTP id z8-v6sf192588ybo.17
        for <gclcip-std-proposals@m.gmane.org>; Tue, 23 Oct 2018 00:16:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc: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=01HzCuaNIIrQcoKIBSJD44OGcjp4iAwpKLE3QhpJ2d4=;
        b=tCYSGNIs6KB+xzHB7kzZX89q1lvQyOS1wQJ3HaDewGTtbkkm7tc7yshjq1MmS7hTfj
         k1gjX25HFa3rRd1a8vCE751e6OOlxYMGJBP1uZjAoBOnuv3UBBfhrc2HdBfOCYe1wQWQ
         /zmtFydaqeRP8X8tucDMsw1rhNVta3GhYdy8fOsM8xqKYIS8XTgj9SftdxpzTeLdkCMX
         aRZdmzkp7mTmzZvKyBmD/ZNLKWkHgCsR1FsiZP1tZpWQq3WHX1JCqkyl0ODO2YIoqif6
         lRrUy9CemrTK/ppPUkuFjY1rUAmlkqzinfwe7UoGZyFjcUbPfWXQGjVU4Vdn9YTezCdK
         Sxeg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc: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=01HzCuaNIIrQcoKIBSJD44OGcjp4iAwpKLE3QhpJ2d4=;
        b=EhrnEBW21S1jaTFLK1Be5hgivMCEVQDqyrk89AX+7gGC1IJHh3F6kT/uzyT4MpNymC
         U0sYwBHW4AQdc6MdY2iu1bHQJ1H5rGf0Lzq7H1+9PezS39bR2fC5JwcBfacMLglwQZoJ
         hJQTCRHLF3MXHSnGHgQLdbb5/TiKPyM1pR228uQ3YevkARlpXaQpH+RJNSWD9KEnQyzX
         mM5xtVuFjIQEshNBsgcUiV/1mdXsKDBDKJw4HdHWni1/Lp5qeu2MTiaR32VZkXbImFUv
         2f11kl/0wSCw+ye4GXARZv/mu5crskIi3h8K7g3JW0lBW6BXcfc8zGWYrO0TxXwYI0xq
         ZQBw==
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:cc: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=01HzCuaNIIrQcoKIBSJD44OGcjp4iAwpKLE3QhpJ2d4=;
        b=Mx429H/1LvrpTxotDvs7BCCJj0L2oshwdItRKjCIL6czzuu3nwLP3A1Qr15bBHYXz8
         QSpyFRlNOBhN/SBQeOJv3KyDlG7gDwrUTCNEBQ8s0Ice8wrS5UiAhcd6H6hIlCeXHgsq
         NRR5p6guVSD6NALl14IcRU5yvCzaZgQptE0Pn4qHlH1vmn0vmBpedKsDmG4MxhlAbriN
         uELFxkE14NGp6jfAADybaZo0ioZHuagy3wZ5EN+Zrini2C61jH7kj4t2RU/QukOZRaFx
         8gc+faXYRlnK+S4hfjOkwvg22/8f+3WPHqCzVtDIPTwZ1nY6YAnYx641hX9j2sjkp76X
         5mxg==
X-Gm-Message-State: ABuFfohDBsQsYiOVWUn2731RqJ8H3CWO6191Tyf/BZfhodhVqxI1xI/Y
	YorCvFZgq4D0Z5VzZbGSBnFWgg==
X-Google-Smtp-Source: ACcGV61j38cP+2m8+2DZYUUamAqb87iCuM385jMmLCxwuooqVSTLmIRiiTa7xHdXrK6dPKCqmTK8VQ==
X-Received: by 2002:a0d:c841:: with SMTP id k62-v6mr28810711ywd.6.1540278981122;
        Tue, 23 Oct 2018 00:16:21 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:bb8d:: with SMTP id y13-v6ls1078339ybg.4.gmail; Tue, 23
 Oct 2018 00:16:19 -0700 (PDT)
X-Received: by 2002:a25:daca:: with SMTP id n193-v6mr107403ybf.7.1540278979705;
        Tue, 23 Oct 2018 00:16:19 -0700 (PDT)
In-Reply-To: <CAOfiQqnyH1r5e5QEKEgeSfa0pg3LbcVDb-URGLgGLap2f+J68A@mail.gmail.com>
X-Original-Sender: MihailNajdenov@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:40682
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40682>

------=_Part_4882_74888822.1540278979047
Content-Type: multipart/alternative; 
	boundary="----=_Part_4883_1926723071.1540278979048"

------=_Part_4883_1926723071.1540278979048
Content-Type: text/plain; charset="UTF-8"



On Tuesday, October 23, 2018 at 5:30:52 AM UTC+3, Richard Smith wrote:
>
> On Mon, 22 Oct 2018 at 01:23, <mihailn...@gmail.com <javascript:>> wrote:
>
>> You must give better motivation. 
>> If you want to use a function that returns an object and have that object 
>> new-ed without copy/move, then you should explain what is stopping you 
>> creating the returned object via the new expression in the first place, 
>> especially now with template deduction guide.
>> If you want a copy/move of the object, returned by the function you can 
>> do this today using new auto(create_object());
>>
>
> If create_object() returns by value (as make_tuple does, for instance), 
> this does not perform a copy or move. Rather, it constructs directly into 
> the allocated storage. That is, we already have the feature that is being 
> requested here: just use 'new'.
>

Great to hear! It didn't know the new RVO rules work here as well as it is 
not so obvious - we tend to think this is stack-only. Very interesting... 
I might as well update cppreference to note that it works here as well.
 

>
> My guess is you want the former, but some better examples would be nice.
>>
>>
>> On Monday, October 22, 2018 at 7:43:42 AM UTC+3, sunsetburn...@gmail.com 
>> wrote:
>>>
>>> We could write a function to take something allocated on the stack and 
>>> return a copy of it on the heap:
>>>
>>> template<class T> T* as_new(T&& obj) {
>>>     return new T{ std::forward<decltype(obj)>(obj)};
>>> }
>>>
>>> And this works in most cases while only incurring a performance hit. 
>>> However, it breaks down when using objects that either can't be copied or 
>>> moved. Providing overloads of functions that allocate something in a 
>>> specific provided space can be tedious, too. 
>>>
>>> *Proposal: *putting the new keyword in parethesis before a function or 
>>> expression results in the output of that expression being allocated on the 
>>> heap, or in the provided buffer. 
>>>
>>> Let's take the function make_tuple as an example:
>>>
>>> #include <tuple> 
>>> int main() {
>>>    using std::tuple;
>>>    using std::make_tuple;
>>>
>>>     /* Allocates tuple normally */
>>>    tuple<int, double> t1 = make_tuple(4, 0.3);
>>>
>>>     /*Allocates tuple on heap, returns pointer */
>>>    tuple<int, double>* t2 = (new) make_tuple(4, 0.3); 
>>>
>>>     char buff[100];
>>>    
>>>    /* Allocates tuple in buff, returns pointer */
>>>    tuple<int, double>* t3 = (new(buff)) make_tuple(4, 0.3);
>>> }
>>>
>>>
>>> if a function returns a reference, it's a compiler error to use this 
>>> construct, and if the function returns a pointer, then this construct 
>>> returns a pointer to that pointer. 
>>>
>>>
>>> -- 
>> 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-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c5e8d685-d72c-4163-bb6d-f9cee0fa190b%40isocpp.org 
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c5e8d685-d72c-4163-bb6d-f9cee0fa190b%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/bdbf2214-87c0-4d14-8831-c6ffd5da2eba%40isocpp.org.

------=_Part_4883_1926723071.1540278979048
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, October 23, 2018 at 5:30:52 AM UTC+3, =
Richard Smith wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, 22 Oct 2018 at=
 01:23, &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"YaEZXMU5CgAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return =
true;">mihailn...@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex"><div dir=3D"ltr">You must give better motivation.=C2=A0<div>If you =
want to use a function that returns an object and have that object new-ed w=
ithout copy/move, then you should explain what is stopping you creating the=
 returned object via the new expression in the first place, especially now =
with template deduction guide.</div><div>If you want a copy/move of the obj=
ect, returned by the function you can do this today using <font face=3D"cou=
rier new, monospace">new auto(create_object());</font></div></div></blockqu=
ote><div><br></div><div>If create_object() returns by value (as make_tuple =
does, for instance), this does not perform a copy or move. Rather, it const=
ructs directly into the allocated storage. That is, we already have the fea=
ture that is being requested here: just use &#39;new&#39;.</div></div></div=
></blockquote><div><br></div><div>Great to hear! It didn&#39;t know the new=
 RVO rules work here as well as it is not so obvious - we tend to think thi=
s is stack-only. Very interesting...=C2=A0</div><div>I might as well update=
 cppreference to note that it works here as well.</div><div>=C2=A0</div><bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div class=3D"gm=
ail_quote"><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><=
div>My guess is you want the former, but some better examples would be nice=
..</div><div><br><br>On Monday, October 22, 2018 at 7:43:42 AM UTC+3, <a>sun=
setburn...@gmail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"m=
argin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
 dir=3D"ltr">We could write a function to take something allocated on the s=
tack and return a copy of it on the heap:<div><br></div><div><div style=3D"=
background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-styl=
e:solid;border-width:1px"><code><div><span style=3D"color:#008">template</s=
pan><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">class<=
/span><span style=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</=
span><span style=3D"color:#000"> T</span><span style=3D"color:#660">*</span=
><span style=3D"color:#000"> as_new</span><span style=3D"color:#660">(</spa=
n><span style=3D"color:#000">T</span><span style=3D"color:#660">&amp;&amp;<=
/span><span style=3D"color:#000"> obj</span><span style=3D"color:#660">)</s=
pan><span style=3D"color:#000"> </span><span style=3D"color:#660">{</span><=
span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#00=
8">return</span><span style=3D"color:#000"> </span><span style=3D"color:#00=
8">new</span><span style=3D"color:#000"> T</span><span style=3D"color:#660"=
>{</span><span style=3D"color:#000"> std</span><span style=3D"color:#660">:=
:</span><font color=3D"#000000"><span style=3D"color:#000">forward</span><s=
pan style=3D"color:#660">&lt;</span><span style=3D"color:#008">decltype</sp=
an><span style=3D"color:#660">(</span><span style=3D"color:#000">obj</span>=
<span style=3D"color:#660">)&gt;</span></font><span style=3D"color:#660">(<=
/span><span style=3D"color:#000">ob<wbr>j</span><span style=3D"color:#660">=
)};</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">=
}</span><span style=3D"color:#000"><br></span></div></code></div><div><br><=
/div>And this works in most cases while only incurring a performance hit. H=
owever, it breaks down when using objects that either can&#39;t be copied o=
r moved. Providing overloads of functions that allocate something in a spec=
ific provided space can be tedious, too.=C2=A0</div><div><br></div><div><b>=
Proposal: </b>putting the new keyword in parethesis before a function or ex=
pression results in the output of that expression being allocated on the he=
ap, or in the provided buffer.=C2=A0</div><div><br></div><div>Let&#39;s tak=
e the function make_tuple as an example:<br></div><div><br></div><div><div =
style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bo=
rder-style:solid;border-width:1px"><code><div><div style=3D"color:rgb(65,65=
,65);background-color:rgb(251,251,251);font-family:&quot;Droid Sans Mono&qu=
ot;,monospace,monospace,&quot;Droid Sans Fallback&quot;;font-size:14px;line=
-height:19px;white-space:pre-wrap"><div style=3D"font-family:&quot;Droid Sa=
ns Mono&quot;,monospace,monospace,&quot;Droid Sans Fallback&quot;;line-heig=
ht:19px"><div><span style=3D"color:#05ad97"><span style=3D"color:#800">#inc=
lude</span></span><span style=3D"color:#000"> </span><span style=3D"color:#=
3d9ca9"><span style=3D"color:#080">&lt;tuple&gt;</span></span><span style=
=3D"color:#000"> </span></div><div><span style=3D"color:#d10771"><span styl=
e=3D"color:#008">int</span></span><span style=3D"color:#000"> </span><span =
style=3D"color:#8d12ba"><span style=3D"color:#000">main</span></span><span =
style=3D"color:#660">()</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:#660">{</span></div><div><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span><span style=3D"color:#05ad97"><span style=3D"color:#008">using</s=
pan></span><span style=3D"color:#000"> std</span><span style=3D"color:#660"=
>::</span><span style=3D"color:#000">tuple</span><span style=3D"color:#660"=
>;</span></div><div><span style=3D"color:#000"> =C2=A0 =C2=A0</span><span s=
tyle=3D"color:#05ad97"><span style=3D"color:#008">using</span></span><span =
style=3D"color:#000"> std</span><span style=3D"color:#660">::</span><span s=
tyle=3D"color:#000">make_tuple</span><span style=3D"color:#660">;</span></d=
iv><span style=3D"color:#000"><br></span><div><span style=3D"color:#000">=
=C2=A0 =C2=A0 </span><span style=3D"color:#555555;font-style:italic"><span =
style=3D"color:#800">/* Allocates tuple normally */</span></span></div><div=
><span style=3D"color:#000"> =C2=A0 =C2=A0tuple</span><span style=3D"color:=
#4d4d4d"><span style=3D"color:#660">&lt;</span></span><span style=3D"color:=
#d10771"><span style=3D"color:#008">int</span></span><span style=3D"color:#=
660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#d1077=
1"><span style=3D"color:#008">double</span></span><span style=3D"color:#4d4=
d4d"><span style=3D"color:#660">&gt;</span></span><span style=3D"color:#000=
"> t1 </span><span style=3D"color:#4d4d4d"><span style=3D"color:#660">=3D</=
span></span><span style=3D"color:#000"> </span><span style=3D"color:#8d12ba=
"><span style=3D"color:#000">make_tuple</span></span><span style=3D"color:#=
660">(</span><span style=3D"color:#cc5200"><span style=3D"color:#066">4</sp=
an></span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </=
span><span style=3D"color:#cc5200"><span style=3D"color:#066">0.3</span></s=
pan><span style=3D"color:#660">);</span></div><span style=3D"color:#000"><b=
r></span><div><span style=3D"color:#000">=C2=A0 =C2=A0 </span><span style=
=3D"color:#555555;font-style:italic"><span style=3D"color:#800">/*Allocates=
 tuple on heap, returns pointer */</span></span></div><div><span style=3D"c=
olor:#000"> =C2=A0 =C2=A0tuple</span><span style=3D"color:#4d4d4d"><span st=
yle=3D"color:#660">&lt;</span></span><span style=3D"color:#d10771"><span st=
yle=3D"color:#008">int</span></span><span style=3D"color:#660">,</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#d10771"><span style=3D=
"color:#008">double</span></span><span style=3D"color:#4d4d4d"><span style=
=3D"color:#660">&gt;*</span></span><span style=3D"color:#000"> t2 </span><s=
pan style=3D"color:#4d4d4d"><span style=3D"color:#660">=3D</span></span><sp=
an style=3D"color:#000"> </span><span style=3D"color:#660">(</span><span st=
yle=3D"color:#05ad97"><span style=3D"color:#008">new</span></span><span sty=
le=3D"color:#660">)</span><span style=3D"color:#000"> </span><span style=3D=
"color:#8d12ba"><span style=3D"color:#000">make_tuple</span></span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#cc5200"><span style=3D"col=
or:#066">4</span></span><span style=3D"color:#660">,</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#cc5200"><span style=3D"color:#066"=
>0.3</span></span><span style=3D"color:#660">);</span><span style=3D"color:=
#000"> </span></div><span style=3D"color:#000"><br></span><div><span style=
=3D"color:#000">=C2=A0 =C2=A0 </span><span style=3D"color:#d10771"><span st=
yle=3D"color:#008">char</span></span><span style=3D"color:#000"> buff</span=
><span style=3D"color:#660">[</span><span style=3D"color:#cc5200"><span sty=
le=3D"color:#066">100</span></span><span style=3D"color:#660">];</span></di=
v><div><span style=3D"color:#000"> =C2=A0 =C2=A0</span></div><div><span sty=
le=3D"color:#000"> =C2=A0 =C2=A0</span><span style=3D"color:#555555;font-st=
yle:italic"><span style=3D"color:#800">/* Allocates tuple in buff, returns =
pointer */</span></span></div><div><span style=3D"color:#000"> =C2=A0 =C2=
=A0tuple</span><span style=3D"color:#4d4d4d"><span style=3D"color:#660">&lt=
;</span></span><span style=3D"color:#d10771"><span style=3D"color:#008">int=
</span></span><span style=3D"color:#660">,</span><span style=3D"color:#000"=
> </span><span style=3D"color:#d10771"><span style=3D"color:#008">double</s=
pan></span><span style=3D"color:#4d4d4d"><span style=3D"color:#660">&gt;*</=
span></span><span style=3D"color:#000"> t3 </span><span style=3D"color:#4d4=
d4d"><span style=3D"color:#660">=3D</span></span><span style=3D"color:#000"=
> </span><span style=3D"color:#660">(</span><span style=3D"color:#8d12ba"><=
span style=3D"color:#008">new</span></span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#000">buff</span><span style=3D"color:#660">))</spa=
n><span style=3D"color:#000"> </span><span style=3D"color:#8d12ba"><span st=
yle=3D"color:#000">make_tuple</span></span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#cc5200"><span style=3D"color:#066">4</span></span>=
<span style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#cc5200"><span style=3D"color:#066">0.3</span></span><span =
style=3D"color:#660">);</span></div><div><span style=3D"color:#660">}</span=
></div><span style=3D"color:#000"><br></span></div></div></div></code></div=
><br>if a function returns a reference, it&#39;s a compiler error to use th=
is construct, and if the function returns a pointer, then this construct re=
turns a pointer to that pointer.=C2=A0</div><div><br></div><div><br></div><=
/div></blockquote></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"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
YaEZXMU5CgAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"YaEZXMU5CgAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@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/c5e8d685-d72c-4163-bb6d-f9cee0fa190b%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c5e8d685-d72c-4163-bb6d-f9cee0fa190b%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c5e8d685-d72c-4163-bb6d-f9cee0fa190b%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c5e8d685-d72c-4163-<wbr>bb6d-=
f9cee0fa190b%40isocpp.org</a><wbr>.<br>
</blockquote></div></div>
</blockquote></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/bdbf2214-87c0-4d14-8831-c6ffd5da2eba%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bdbf2214-87c0-4d14-8831-c6ffd5da2eba=
%40isocpp.org</a>.<br />

------=_Part_4883_1926723071.1540278979048--

------=_Part_4882_74888822.1540278979047--

.
