220 21962 <CA+wfc1_s1zFZJGVYA4UACqroqU7tWhBvzU5RUDmAo_5hCS_Rfw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Oliver Kowalke <oliver.kowalke@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: is await an extension of the do-notation? (was Re:
 Re: Resumable expressions p0114r0 vs async/await P0057R0)
Date: Fri, 23 Oct 2015 10:57:02 +0200
Lines: 78
Approved: news@gmane.org
Message-ID: <CA+wfc1_s1zFZJGVYA4UACqroqU7tWhBvzU5RUDmAo_5hCS_Rfw@mail.gmail.com>
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> <56114953.4030701@wanadoo.fr>
 <561B403D.4030403@gmail.com> <CAOfiQqkKvZfVatJ1Bz4qSvGc-g6iep0xeP1B1=J1-gCu43NXxg@mail.gmail.com>
 <561C07D1.3080304@gmail.com> <CAOfiQqnR4GYCttwu8G-44_UEN4WekW19uorEvf-5VC3vOpej-g@mail.gmail.com>
 <561C213F.1060009@gmail.com> <fb82d876-8a54-4c28-8e53-297018470cf6@isocpp.org>
 <561C3875.2050701@gmail.com> <86924069-44d0-447f-bf8a-a42e46579832@isocpp.org>
 <561D79A7.8080007@gmail.com> <894616d6-9609-4038-b2bc-d2c62df21e0f@isocpp.org>
 <99bdb3ae-9214-4440-8572-4c47a61eda46@isocpp.org> <58628096-14ae-42b2-89d3-c0bd2183bbc0@isocpp.org>
 <561DC957.8080603@gmail.com> <a44dae17-5f63-4c60-a943-d74a1332b54c@isocpp.org>
 <d3723a3d-1b73-4c6c-bc7f-3d224d2ec8a2@isocpp.org> <2e09660f-d688-474a-8811-85fb041f68b8@isocpp.org>
 <f3dbc6ee-80cf-43f1-9b49-7ed1879de0cc@isocpp.org> <8b78abb4-16b6-4b65-8513-6e2c17317647@isocpp.org>
 <CAL52AasThHcBZUbyT1NfgzEe+qaWKuO9eE6pxS-qfXxxSSbcbQ@mail.gmail.com>
 <779be861-3b2a-427a-b36b-ad2874c81129@isocpp.org> <CAL52AasaxsP2i-Bh-kVrCoKad_Z08dUpL-0w=Lb2dyTGz3f9PQ@mail.gmail.com>
 <767364f8-785d-4f8f-9bc0-852df56ee4eb@isocpp.org> <f27fd4c9-86c4-44a7-8162-991a32a38e63@isocpp.org>
 <CA+wfc1-qmKY-yA1fPOmWjGuR7qTMY3PRVbjxtPaPn2FLad2hBA@mail.gmail.com>
 <d7653631-b45c-4952-a308-9919e84c538e@isocpp.org> <CA+wfc1-s0_TZUn_FcoPnEFTOiofM8oLwdy_4EWDmtK+wApratw@mail.gmail.com>
 <f03a6bdc-6719-4f4a-bcff-e39d819e2eff@isocpp.org> <CA+wfc1_16+NXesmOFUrOJpPa=X+RGm0Rr89CTe1mGFWK8JUAiA@mail.gmail.com>
 <0a728eee-e8e7-48ea-adf6-2a8dae63916e@isocpp.org> <CA+wfc1-b_TaJT-FQmZ3hEYzH+B16CaqcBd4wbgmf84gagegHYw@mail.gmail.com>
 <e9b4c568-2a00-4f25-8324-921ca1926abe@isocpp.org> <CA+wfc1_mDmHcfE8-peKxfL+_kFF1UrOt4daw=mEAuT_-Rvn9Ng@mail.gmail.com>
 <CAL52AasCidZMkCaMG+5YhhC5CR-iz8oKn2S5LckEfj2qTvFQ1A@mail.gmail.com>
 <CA+wfc19ZncdOVDVhPktbKi2aikqt2MEiq66a6=vL4xq=DpZDrA@mail.gmail.com>
 <6a4f863e-faf0-42ac-b85d-0951738350ab@isocpp.org> <CA+wfc193_16+X6_1JeSHFOTfzbRLFXehg=YLZwg6Og=6cEA=EQ@mail.gmail.com>
 <1f818f79-1fe3-4e9f-b5c7-07836547dd74@isocpp.org> <CA+wfc1_UNbTvah7ptWWr8ygteBtAbitiNOk493Gd1y=G8EXw8g@mail.gmail.com>
 <5d4d4143-dcbb-401f-b809-6d1e50840fc4@isocpp.org> <CA+wfc18HBdR62qhOD7776FfPfxRUJre7NnCdyaKajYq8OPVxRQ@mail.gmail.com>
 <a933bd7b-b2c2-4758-b0d0-88fd64a0a5e6@isocpp.org> <CA+wfc19T78+KmyHctvJC0XXefhBRDTbK2Wesah2sWHin088LsA@mail.gmail.com>
 <0167264e-62fa-42bb-85b1-726c48650438@isocpp.org> <b040eee3-9a27-48fb-a158-231df8516bec@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b2e489ab506cf0522c1cc25
X-Trace: ger.gmane.org 1445590652 14783 80.91.229.3 (23 Oct 2015 08:57:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 23 Oct 2015 08:57:32 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCLZHP5J7MHRB4XMU6YQKGQEOWKWYPY@isocpp.org Fri Oct 23 10:57:31 2015
Return-path: <std-proposals+bncBCLZHP5J7MHRB4XMU6YQKGQEOWKWYPY@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+bncBCLZHP5J7MHRB4XMU6YQKGQEOWKWYPY@isocpp.org>)
	id 1ZpYA8-0006OJ-I3
	for gclcip-std-proposals@m.gmane.org; Fri, 23 Oct 2015 10:57:24 +0200
Original-Received: by igcg4 with SMTP id g4sf32174130igc.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 23 Oct 2015 01:57:23 -0700 (PDT)
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:from:date
         :message-id:subject: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=dRqw5HUg0UtujGuw0/IfIdEdUIzrC32VQ0WCmdX4u3I=;
        b=QiqWP9XgtBYEyLqyshzEN3n88M803rEhNkLxTWX0RDNM3/5zm968zlfKCvd5nRun0B
         C9Aw+QI11Tlgo0ZEamkAkITZIVvNojtb22tMFWa3U/gSRhSUENm8wXlXu9D/hAWhJ77F
         HRMSIB/nALUaN0j0WzLI5nHyenFKmYPMKH3gQEb1oDczVsEnACR0LgAdADbg6Sfvrhru
         X8vV63Yok3nQvEyW9p3aPWKw+uzf3TbXoKDMI7g0bQ61+B1Wiq+WSMach69XqIfOYOFv
         sqV/zpxuwk4BofR1ZIiMOIz0E9IMAtwisHj0+KQlKtbR4Lgi22YNd2QuCW3Rg/2FeBWX
         yDtg==
X-Gm-Message-State: ALoCoQl03dkHoe0rNJy1MIedlquGewPTheWwAIzgmy7f32yQVkkvDMIrDtfvECHrxtKKgen06OLa
X-Received: by 10.50.152.102 with SMTP id ux6mr2507988igb.3.1445590643195;
        Fri, 23 Oct 2015 01:57:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.28.41 with SMTP id y9ls912574obg.67.gmail; Fri, 23 Oct
 2015 01:57:22 -0700 (PDT)
X-Received: by 10.60.42.105 with SMTP id n9mr13766216oel.1.1445590642354;
        Fri, 23 Oct 2015 01:57:22 -0700 (PDT)
Original-Received: from mail-ob0-x22f.google.com (mail-ob0-x22f.google.com. [2607:f8b0:4003:c01::22f])
        by mx.google.com with ESMTPS id q5si11572736oih.5.2015.10.23.01.57.22
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 23 Oct 2015 01:57:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of oliver.kowalke@gmail.com designates 2607:f8b0:4003:c01::22f as permitted sender) client-ip=2607:f8b0:4003:c01::22f;
Original-Received: by obcqt19 with SMTP id qt19so88238361obc.3
        for <std-proposals@isocpp.org>; Fri, 23 Oct 2015 01:57:22 -0700 (PDT)
X-Received: by 10.182.96.168 with SMTP id dt8mr13818993obb.36.1445590641991;
 Fri, 23 Oct 2015 01:57:21 -0700 (PDT)
Original-Received: by 10.76.71.233 with HTTP; Fri, 23 Oct 2015 01:57:02 -0700 (PDT)
In-Reply-To: <b040eee3-9a27-48fb-a158-231df8516bec@isocpp.org>
X-Original-Sender: oliver.kowalke@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of oliver.kowalke@gmail.com designates 2607:f8b0:4003:c01::22f as
 permitted sender) smtp.mailfrom=oliver.kowalke@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: <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:21962
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21962>

--047d7b2e489ab506cf0522c1cc25
Content-Type: text/plain; charset=UTF-8

>
> Actually, to match the semantics I proposed earlier:
>
>      R * operator()(T * p) {
>            struct payload { void * p; context_t current;  } payload = {p};
>            auto other = (payload*)jump_fcontext(&
>                     payload.current,
>                     std::exchange(to, 0),
>                     &payload);
>            to = &other->current;
>            return (R*)other->p;
>     }
>

I'm feeling a little bit uncomfortable because context<> forces a special
signature of the context-fn, e.g.

void foo( context *, void *);

while exception_context doesn't

void foo();

-- 

--- 
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/.

--047d7b2e489ab506cf0522c1cc25
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><span class=3D""></span><div>Actually, to match =
the semantics I proposed earlier:<span class=3D""><br><br>=C2=A0=C2=A0=C2=
=A0=C2=A0 R * operator()(T * p) {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 struct payload { void * p; context_t current;=C2=
=A0 } payload =3D {p};<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 auto other =3D (payload*)jump_fcontext(&amp;</span><div>=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 payload.current, <br>=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 std::exchange(to, 0), <br><span class=3D"">=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &amp;payload);<br>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 to =3D &amp;other-&gt;current;<br>=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return (R*)other-=
&gt;p;<br>=C2=A0=C2=A0=C2=A0 }</span></div></div></blockquote><div><br></di=
v><div>I&#39;m feeling a little bit uncomfortable because context&lt;&gt; f=
orces a special signature of the context-fn, e.g.<br><br></div><div>void fo=
o( context *, void *);<br><br></div><div>while exception_context doesn&#39;=
t<br><br></div><div>void foo();<br></div></div></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 />

--047d7b2e489ab506cf0522c1cc25--

.
