220 27923 <6aa24874-7bae-449f-ac2b-67f0605fbd65@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: nicolas.capens@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Specifier to cause the destructor to be called at
 last use instead of end of scope
Date: Wed, 24 Aug 2016 13:16:30 -0700 (PDT)
Lines: 96
Approved: news@gmane.org
Message-ID: <6aa24874-7bae-449f-ac2b-67f0605fbd65@isocpp.org>
References: <ec2e95cc-3ef0-435b-aaf9-13e982c4583e@isocpp.org>
 <CAFk2RUYr21ijENo+w5ooBhuu-kW2V+N+oqHyzpbO9AM5y-JfPg@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_94_1878317665.1472069790282"
X-Trace: blaine.gmane.org 1472069809 16739 195.159.176.226 (24 Aug 2016 20:16:49 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 24 Aug 2016 20:16:49 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC6MN3XGLYIJ7APYXUCRUBA7P6DOM@isocpp.org Wed Aug 24 22:16:44 2016
Return-path: <std-proposals+bncBC6MN3XGLYIJ7APYXUCRUBA7P6DOM@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f69.google.com ([209.85.214.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC6MN3XGLYIJ7APYXUCRUBA7P6DOM@isocpp.org>)
	id 1bcebM-0003vY-5S
	for gclcip-std-proposals@m.gmane.org; Wed, 24 Aug 2016 22:16:44 +0200
Original-Received: by mail-it0-f69.google.com with SMTP id i64sf2945026ith.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 24 Aug 2016 13:16:45 -0700 (PDT)
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
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=VDfpKrR17xaRP2JRw61IVbKDr5j0W0geR3y3BIe0kqA=;
        b=TX2iyfkZ5hDXqRbC1LXPfPwQLx3F6dJ5Kx/Cf6xRUl73fMKLxZgSzyI1YssWYP4lvQ
         vqywPsMeWDgHnULYErqVuCvZ2eT00KV7gByb9cToIx9rW5rCwj8bEsRutuPXGnxnYiPZ
         uSo6+aHOs05a+o8ZkePrS6Fz8U8bVGTxU9xB4kqVo57yLetE4YrpbVfc5d4EQ5FerZD8
         AUm1BUAa9FvFknAiGUjbgnnRXMKKo7lMQvq6c1ZgKHXDbSWxfrgTXzyM++XDdcijRLFr
         4CB/RbGUXgj0yEV+g6RiE30DXpnIbYo/k9836aLQ7MQpKu501ezCMi+iyl7w228YeTyP
         kbqg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=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=VDfpKrR17xaRP2JRw61IVbKDr5j0W0geR3y3BIe0kqA=;
        b=XgpgsZFe9J2pJHSOiilJH0DDExfasNbqseWYV3N4O/CSF4GAVpxCyCiq9jIjLZVX/f
         LzUsOBdb5+vnsrAfN3WAjTJrBman2IPAkO25qM1TSViaVFPEKmn8FlSljZeZ88XgVrQ+
         Y1ehu1kQ+YxNbNPOZvEDNVuKIAmuqiAYv1GYHu5o9immDxtpyqm15YBIaEQ/Red9OX67
         x9w7OBx9sCKIy7jNCKCmdncy1KUZ8db31pbZcxJhnTjrKQKEExRJg6ylyLJxic23gLHV
         x3mFWQLVpSwRx8QX8wWfxto6KHXgpC1Qw7IwCsAFiPlihNJaBh/kzpaFpx1xT8dqYDzH
         KD7Q==
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: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=VDfpKrR17xaRP2JRw61IVbKDr5j0W0geR3y3BIe0kqA=;
        b=A04lyYMKPPx3sILEh7ArsG15c1r1fpagDhULvjQCy46jIboIwcWTiTbgwBTFymtbk3
         FB4eRxNPv4dyIrwu2T6QPwoQsUuvceYOQJYunNm3V5kqVikfSup3xlOY4i1u6RLDmYts
         xoGWGiFaUMtAfyHXzHEQtPnGaeM1FmhsLDiwrtTRX2YWH0JMjoRHvaIpz1uMEdFopF99
         Y9qhXvjiQn8JzvHoEpZS3g0AcVa6/WXvgBMGL5eZ+tGktr4nHqOggxMCybVZU7Na1AOR
         XHEwHhvC3agaQl86hvaQdDTeclQofmCLhmJnjCZIx0V0d8ZYANBq9ts+ZODQw8y0+xT+
         DC6Q==
X-Gm-Message-State: AEkoouvoMTq1GZipZaWaji+y98wS0PXuaepl6cZ6bBK/8wyIIKTBZ36rhHfxuyPeeTOBdA==
X-Received: by 10.157.11.215 with SMTP id 81mr3413562oth.42.1472069793165;
        Wed, 24 Aug 2016 13:16:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.133.30 with SMTP id h30ls5889061iod.20.gmail; Wed, 24 Aug
 2016 13:16:31 -0700 (PDT)
X-Received: by 10.36.227.207 with SMTP id d198mr74145ith.4.1472069791235;
        Wed, 24 Aug 2016 13:16:31 -0700 (PDT)
In-Reply-To: <CAFk2RUYr21ijENo+w5ooBhuu-kW2V+N+oqHyzpbO9AM5y-JfPg@mail.gmail.com>
X-Original-Sender: Nicolas.Capens@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:27923
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27923>

------=_Part_94_1878317665.1472069790282
Content-Type: multipart/alternative; 
	boundary="----=_Part_95_802756773.1472069790282"

------=_Part_95_802756773.1472069790282
Content-Type: text/plain; charset=UTF-8

On Wednesday, August 24, 2016 at 3:01:34 PM UTC-4, Ville Voutilainen wrote:
>
> On 24 August 2016 at 21:51,  <nicolas...@gmail.com <javascript:>> wrote: 
> > Hi all, 
> > 
> > I'd like to propose a new kind of destructor that gets called after a 
> local 
> > object's last use, instead of at the end of its scope. 
>
> Define "last use". 
>

The last use according to liveness analysis.
 

> > Limiting the scope with extra braces or by putting the operations in a 
> > subroutine also often isn't a desirable workaround. Note that compilers 
> have 
>
> ..because..? 
>

The code would become littered with braces if you want to limit the scope 
of each object to its miminal range, and it would be annoying to maintain 
when refactoring the code. Just imagine having to do it for scalar 
variables to avoid register spilling. Fortunately we don't, because today's 
compilers do liveness analysis to optimize register allocation. I'd like to 
see that extended to the resources managed by objects.

-- 
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/6aa24874-7bae-449f-ac2b-67f0605fbd65%40isocpp.org.

------=_Part_95_802756773.1472069790282
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, August 24, 2016 at 3:01:34 PM UTC-4, Ville V=
outilainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 24 August =
2016 at 21:51, =C2=A0&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfu=
scated-mailto=3D"J6h1r_vKDQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D=
&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:=
&#39;;return true;">nicolas...@gmail.com</a>&gt; wrote:
<br>&gt; Hi all,
<br>&gt;
<br>&gt; I&#39;d like to propose a new kind of destructor that gets called =
after a local
<br>&gt; object&#39;s last use, instead of at the end of its scope.
<br>
<br>Define &quot;last use&quot;.
<br></blockquote><div><br></div><div>The last use according to liveness ana=
lysis.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">&=
gt; Limiting the scope with extra braces or by putting the operations in a
<br>&gt; subroutine also often isn&#39;t a desirable workaround. Note that =
compilers have
<br>
<br>..because..?
<br></blockquote><div><br></div><div>The code would become littered with br=
aces if you want to limit the scope of each object to its miminal range, an=
d it would be annoying to maintain when refactoring the code. Just imagine =
having to do it for scalar variables to avoid register spilling. Fortunatel=
y we don&#39;t, because today&#39;s compilers do liveness analysis to optim=
ize register allocation. I&#39;d like to see that extended to the resources=
 managed by objects.</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/6aa24874-7bae-449f-ac2b-67f0605fbd65%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6aa24874-7bae-449f-ac2b-67f0605fbd65=
%40isocpp.org</a>.<br />

------=_Part_95_802756773.1472069790282--

------=_Part_94_1878317665.1472069790282--

.
