220 21361 <b5b47646-e458-446a-8e5b-c116142c5010@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Resumable expressions p0114r0 vs async/await P0057R0
Date: Tue, 6 Oct 2015 07:57:15 -0700 (PDT)
Lines: 83
Approved: news@gmane.org
Message-ID: <b5b47646-e458-446a-8e5b-c116142c5010@isocpp.org>
References: <639f0012-8cb4-4db3-82a6-8d042a3497f9@isocpp.org>
 <401aa118-ed0b-4c7b-92cf-3fbd706eff9d@isocpp.org>
 <fcbcc1c4-535c-4fa2-a17d-4acffe84a4b5@isocpp.org>
 <1d15dbc4-e0c1-4df1-86db-014e11f14d26@isocpp.org>
 <1bf00a8f-5f20-43de-a319-2712ab34eafd@isocpp.org>
 <36f46c03-b1f1-4230-b686-a7a9a1c491cb@isocpp.org>
 <f7ecac91-9863-41e0-9b5a-256f8617f5bd@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_262_1179512238.1444143435719"
X-Trace: ger.gmane.org 1444143448 29569 80.91.229.3 (6 Oct 2015 14:57:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 6 Oct 2015 14:57:28 +0000 (UTC)
Cc: german.diago@hubblehome.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBTGCZ6YAKGQECYUKU3Y@isocpp.org Tue Oct 06 16:57:27 2015
Return-path: <std-proposals+bncBCEKFTV6ZUMBBTGCZ6YAKGQECYUKU3Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f200.google.com ([209.85.213.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBTGCZ6YAKGQECYUKU3Y@isocpp.org>)
	id 1ZjTgA-0001nc-Qy
	for gclcip-std-proposals@m.gmane.org; Tue, 06 Oct 2015 16:57:22 +0200
Original-Received: by igbgg5 with SMTP id gg5sf256371965igb.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 06 Oct 2015 07:57:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:content-type: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=zRgZbQZVkBMvENTMVi0KnewPrsOU6gtgi2gTCuVYc3E=;
        b=Fj770FtDfhjpCaqI1dVOnd4yrdGqO6/UFf84FLwzVJKveASyqabLdKTpOHNeFmvi9+
         HcmE82PLTYKj3wX6NRz9SeVm5Fiyovb+gyuw1+jlfjfrmMZXM2dC25/i+CQRGqgeooRV
         M0DLxGfjlIIxuqxuA0yEn95+UA7i2vIwsavgGTnpy/DGbxw1c2RE4LrNSboDJcYCLP4G
         ZmTbP7fWCuFv8g/58rw24wiY13pUn1rQ+xTEJOamUyO20KvkEQQ5WmiCZxR13mle/Ghr
         TjAekuvO2hyYmEoDvkWyy3iozmxkAsNp3mnC8xnBoWnDDkXM52sQa4EJyMGN8hnhmJtZ
         /1ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type: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=zRgZbQZVkBMvENTMVi0KnewPrsOU6gtgi2gTCuVYc3E=;
        b=T/fRqQ2EzQmA5xs+FMWsKlEUO6qzsmGUy6RO/uLiGOgxLAxQIz8th4hufWafSkzbzE
         fyQjDpGpzpUJ3Ws1ARAG+9FEgRtISyrw+Z/kK5hJdENR6qp7G932c54iE+eLlGdoiyYg
         N0Yx1Q4R/tZ9kW8BSuJf48H/ThPLzvdCD7AQkC68dN5axl0FORofwJZAlSofX6nvAbGt
         mCPmtuHvtkLVlSuiHYpmlLURBb6/weTVPw2Pnq8eA4OjoGbi2DfoO0Jgm8OeP4PObVnW
         xvNBcdXvROeZLsN//XgxUOmVDUUts0Cfbd4Nr05WbQaNIz5qVVhZ7b+teaBMkhszmABE
         XBeA==
X-Gm-Message-State: ALoCoQmhDVEJfnTHrnYcLHd6ffzp3qxrPklXSOwzJl6ad42OR/siPIcjoWUGRfDgjuSdJ0goLR3U
X-Received: by 10.107.170.104 with SMTP id t101mr32753942ioe.3.1444143437050;
        Tue, 06 Oct 2015 07:57:17 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.78.6 with SMTP id x6ls1526440igw.39.gmail; Tue, 06 Oct 2015
 07:57:16 -0700 (PDT)
X-Received: by 10.50.43.195 with SMTP id y3mr66042igl.1.1444143436262;
        Tue, 06 Oct 2015 07:57:16 -0700 (PDT)
In-Reply-To: <f7ecac91-9863-41e0-9b5a-256f8617f5bd@isocpp.org>
X-Original-Sender: jmckesson@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:21361
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21361>

------=_Part_262_1179512238.1444143435719
Content-Type: multipart/alternative; 
	boundary="----=_Part_263_1320150312.1444143435719"

------=_Part_263_1320150312.1444143435719
Content-Type: text/plain; charset=UTF-8



On Tuesday, October 6, 2015 at 10:04:25 AM UTC-4, Gor Nishanov wrote:
>
> If it's a choice between forbidding inlining and *forcing* inlining, I'll 
>> accept the overhead of forbidding inlining.
>>
>
> If coroutine lifetime is fully enclosed in the lifetime of the calling 
> function, then we can
> 1) elide allocation and use a temporary on the stack of the caller
> 2) replace indirect calls with direct calls and inline as appropriate:
>

How exactly does std::experimental::generator<T> accomplish that? How can 
the object know that it is contained entirely in this way? After all, the 
promise type is what holds the state, and therefore the promise has to 
decide whether to statically or dynamically allocate memory, as well as how 
to handle the forwarding to the function to be resumed.

Is `generator` a magical compiler-only type, or could a user somehow 
implement these optimizations themselves? Or am I misunderstanding 
something about how all this works?

-- 

--- 
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 http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_263_1320150312.1444143435719
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, October 6, 2015 at 10:04:25 AM UTC-4, =
Gor Nishanov wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;p=
adding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bo=
rder-left-style:solid"><div>If it&#39;s a choice between forbidding inlinin=
g and <i>forcing</i> inlining, I&#39;ll accept the overhead of forbidding i=
nlining.<br></div></blockquote><div><br></div><div>If coroutine lifetime is=
 fully enclosed in the lifetime of the calling function,=C2=A0then we can</=
div><div>1) elide allocation and use a temporary on the stack of the caller=
</div><div>2) replace indirect calls with direct calls and inline as approp=
riate:</div></div></blockquote><div><br>How exactly does std::experimental:=
:generator&lt;T&gt; accomplish that? How can the object know that it is con=
tained entirely in this way? After all, the promise type is what holds the =
state, and therefore the promise has to decide whether to statically or dyn=
amically allocate memory, as well as how to handle the forwarding to the fu=
nction to be resumed.<br><br>Is `generator` a magical compiler-only type, o=
r could a user somehow implement these optimizations themselves? Or am I mi=
sunderstanding something about how all this works?<font size=3D"2"><font fa=
ce=3D"Consolas"><br></font></font></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"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_263_1320150312.1444143435719--
------=_Part_262_1179512238.1444143435719--

.
