220 21747 <561DE488.3040103@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Evgeny Panasyuk <evgeny.panasyuk@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: Wed, 14 Oct 2015 08:13:44 +0300
Lines: 42
Approved: news@gmane.org
Message-ID: <561DE488.3040103@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>
 <510ce172-976a-4e3a-ae68-31fdb40af4d7@isocpp.org>
 <9dd3f28c-4ffb-4e08-9955-242c46e14527@isocpp.org>
 <31d5f64f-8db9-4ba3-aca7-872114b9776d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1444799643 14911 80.91.229.3 (14 Oct 2015 05:14:03 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 14 Oct 2015 05:14:03 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC54TLGKR4LBBDWJ66YAKGQEFWWGB5I@isocpp.org Wed Oct 14 07:13:53 2015
Return-path: <std-proposals+bncBC54TLGKR4LBBDWJ66YAKGQEFWWGB5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f197.google.com ([209.85.217.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC54TLGKR4LBBDWJ66YAKGQEFWWGB5I@isocpp.org>)
	id 1ZmENs-0004DR-HV
	for gclcip-std-proposals@m.gmane.org; Wed, 14 Oct 2015 07:13:52 +0200
Original-Received: by lbwr8 with SMTP id r8sf19654838lbw.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 13 Oct 2015 22:13:51 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:subject:to:references:message-id:date
         :user-agent:mime-version:in-reply-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=SOxbE/Y1Cwy8ABmhhWzFZZq6r36/j/kvuDXpR9/KSyk=;
        b=FCu1CiQ1rXpVeXNfYE7wQN5Iv++yi0wiXa7zwhpugtyPb+t5CkJc+bpXcFVb164d3G
         /n+OnYeCFLkpIeSSAJRc4hKG18Jb1C8upozbOKpvAQIw9dv48N0jcKUIfXFTeauadeka
         itChvSEe9Cb8FVd5QQhtf4iycoMU7Nt8KC/69hAn4/TcvnPtqumFYQ3/FmrgHwR2/ks5
         bNqLsmyvRGgWjQZ3cixGhe+KHtTUTcnmX1a/cBAQ3Of2ETyA+MeLeeIeBopshVRzRh5V
         FYku/NarRlohg4vI03YhM5dDafcoi4JWOI/u//sF8vOuloNF2SgjTHTWb73Jz1dhXPnq
         xDDg= 
X-Gm-Message-State: ALoCoQkCfxbG1+oEdE+RIOg4VuQ6hbw7lOF4UVK85N9fJW/LFdVMBpJ4ny+NEvvRWdV6ha/lsFk9
X-Received: by 10.112.181.10 with SMTP id ds10mr246087lbc.3.1444799631762;
        Tue, 13 Oct 2015 22:13:51 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.25.218.208 with SMTP id r199ls740736lfg.2.gmail; Tue, 13 Oct
 2015 22:13:50 -0700 (PDT)
X-Received: by 10.25.89.141 with SMTP id n135mr316286lfb.87.1444799630330;
        Tue, 13 Oct 2015 22:13:50 -0700 (PDT)
Original-Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com. [2a00:1450:4010:c04::22e])
        by mx.google.com with ESMTPS id z128si4426143lfd.36.2015.10.13.22.13.50
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 13 Oct 2015 22:13:50 -0700 (PDT)
Received-SPF: pass (google.com: domain of evgeny.panasyuk@gmail.com designates 2a00:1450:4010:c04::22e as permitted sender) client-ip=2a00:1450:4010:c04::22e;
Original-Received: by lbwr8 with SMTP id r8so37951630lbw.2
        for <std-proposals@isocpp.org>; Tue, 13 Oct 2015 22:13:50 -0700 (PDT)
X-Received: by 10.112.200.229 with SMTP id jv5mr487380lbc.123.1444799630019;
        Tue, 13 Oct 2015 22:13:50 -0700 (PDT)
Original-Received: from [192.168.0.186] (81.13.117.87.donpac.ru. [87.117.13.81])
        by smtp.googlemail.com with ESMTPSA id e142sm1043481lfe.27.2015.10.13.22.13.48
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 13 Oct 2015 22:13:49 -0700 (PDT)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
In-Reply-To: <31d5f64f-8db9-4ba3-aca7-872114b9776d@isocpp.org>
X-Original-Sender: Evgeny.Panasyuk@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of evgeny.panasyuk@gmail.com designates 2a00:1450:4010:c04::22e as
 permitted sender) smtp.mailfrom=evgeny.panasyuk@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:21747
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21747>

14.10.2015 7:51, Nicol Bolas:

>     If you need only async I/O - yes, I could imagine that extra
>     allocation is tolerable in such context. But P0057 describes not
>     only async I/O - but also for instance generators. And for
>     generators (like transform iterators) an extra allocation is huge price.
>
>
> A price you will never pay because it will be elided.
>
> Please stop repeating statements that have been disproven; it's not
> helping your case. You have yet to post an example of a generator that
> would not be elided.

I already described it several times, just put generator into some 
structure/array or return somewhere.
In similar situation:
http://coliru.stacked-crooked.com/a/0c09744abd5e57ae
- allocation of P0057 generator will not be elided, there will be N 
allocations, i.e. for each coroutine.

You can read what Gor said previously in this topic:


"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:"


There is "if" condition. Even if we assume that optimizers always do 
elision when condition is true, there is still no elision for cases with 
false condition.

-- 

--- 
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/.

.
