220 13897 <7c04a6d6-c6df-4ef2-8cfc-0ca3606db9e6@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Michael Bruck <bruck.michael@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal for a delete expression for local variables
Date: Wed, 15 Oct 2014 07:58:19 -0700 (PDT)
Lines: 100
Approved: news@gmane.org
Message-ID: <7c04a6d6-c6df-4ef2-8cfc-0ca3606db9e6@isocpp.org>
References: <e8ee92d8-0018-45a2-b87a-2d87f13047b4@isocpp.org>
 <CAB+4KH+8bgPbTpxV7pubCNW_1Yiupff+tzuoMmzpZzXxoLwnSg@mail.gmail.com>
 <16366a2f-03b6-4e2a-9007-7819afe28460@isocpp.org>
 <CAB+4KHL-yVhU8X6J0U2d4j=TAgtEDv8LhTb4afT6PzSAgo9NbA@mail.gmail.com>
 <a2265a97-105c-4722-8c00-e8dd2234ed8e@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_527_857056717.1413385099380"
X-Trace: ger.gmane.org 1413385108 4966 80.91.229.3 (15 Oct 2014 14:58:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 15 Oct 2014 14:58:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDO2X46R4AKRBC4X7KQQKGQEX6BNNJQ@isocpp.org Wed Oct 15 16:58:21 2014
Return-path: <std-proposals+bncBDO2X46R4AKRBC4X7KQQKGQEX6BNNJQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f198.google.com ([209.85.213.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDO2X46R4AKRBC4X7KQQKGQEX6BNNJQ@isocpp.org>)
	id 1XeQ1t-0004pa-BV
	for gclcip-std-proposals@m.gmane.org; Wed, 15 Oct 2014 16:58:21 +0200
Original-Received: by mail-ig0-f198.google.com with SMTP id a13sf6338288igq.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 15 Oct 2014 07:58:20 -0700 (PDT)
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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=w6NYrdVc7j7Po0T3xStAraYWN8l0qafceK8m3MKztxY=;
        b=q8ndUFZHnuiSi7eGTLHdCVW3WsR+VZKWalstOeXcOm74L3rf6DoG1bASkKK5jXmpnr
         Zbx+64Vvf+j/ONgBfjS1SDV56DqEbtEy8G18X3PwA5EhYcywu46oeXH0wWNXxAByntzN
         QGKxCPTw2GTdsEJnOk9XLNNv0ekLLJC8Pci3XMAjg9hqSTjBaKfVYdcUl4EOhDACf+pW
         OyaOob5loSIg6beSkOUaozd0f3ZfYg4a5z02KcOUujkthEL3EqfwvBh1UMFL9qLzmJVv
         YZqeca99n5oDpI+dlnWEc4NcplrHg5kQW0Y4g3riwQeslmplxwLwR0aFDiBoFoZ/CjLo
         xJ4Q==
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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=w6NYrdVc7j7Po0T3xStAraYWN8l0qafceK8m3MKztxY=;
        b=UU4Jg4yoJnnJfHThgsnhzQq413m+XO81lGHnylRNuV1/kC+JXC767PEf5gAw0GCl/t
         zICXVnwdPG8kjnslKE1++XeJaOiw81Q3QXmeE54/m9utHSdC6q6cvXUP4S1OBEC/hF26
         Y58/JSkGOOejUAZhkdy1ToQu+MR+GX4aXI2m6YndOoTVzkgHoo1ceKBGDLG146m+sbrC
         cuD66pHlVfExlufLjNx5Kjgsuyu7e03Lhu4IGBrCsALcoE3iD/D70yEt1MYOm3sPwxum
         yXgmJrAkGb/+HgD74a5PPpIIXjJcqVVehw8qoW0fAGSW2ClQUN8GJd496BG2MM7+b05X
         OC/g==
X-Gm-Message-State: ALoCoQnTGpB5h/XuJWr28cctCv0eJd0FwkIl2EDsb7zrV3C/ukkRxO3DPF/p3rMpff6bentCKy3o
X-Received: by 10.182.27.206 with SMTP id v14mr8368916obg.39.1413385100309;
        Wed, 15 Oct 2014 07:58:20 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.49.99 with SMTP id p90ls287788qga.29.gmail; Wed, 15 Oct
 2014 07:58:19 -0700 (PDT)
X-Received: by 10.140.21.49 with SMTP id 46mr12534qgk.30.1413385099759;
        Wed, 15 Oct 2014 07:58:19 -0700 (PDT)
In-Reply-To: <a2265a97-105c-4722-8c00-e8dd2234ed8e@isocpp.org>
X-Original-Sender: bruck.michael@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: <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:13897
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13897>

------=_Part_527_857056717.1413385099380
Content-Type: text/plain; charset=UTF-8



On Wednesday, October 15, 2014 1:55:59 PM UTC+2, David Krauss wrote:
>
>
>
> On Wednesday, October 15, 2014 6:06:53 PM UTC+8, Andrew Tomazos wrote:
>>
>> Sorry, I should have actually read your proposal - specifically I think:
>>
>> {
>>
>> auto file = file_open_rlock("data_snippet");
>>
>> auto blob = file.fetch_all();
>>
>> file.close();
>>
>
> Not only is it more readable, it's more correct. Relying on destructors 
> for side effects demands that they ignore any failures. Explicitly flushing 
> and closing a file or a connection before it goes out of scope gives a 
> confirmation of success that implicit destructor cleanup does not. (At 
> least, that can't safely happen until uncaught_exception gets fixed.)
>
> Likewise, it's cleaner if a destructor can treat an open state as a 
> failure, and avoid flushing or such side effects for the sake of safety 
> over convenience.
>

If I understand it correctly the destructor exception issue could be fixed 
by the time this extension is added?

-- 

--- 
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_527_857056717.1413385099380
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, October 15, 2014 1:55:59 PM UTC+2, D=
avid Krauss wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><br><br>On Wednesday, October 15, 2014 6:06:53 PM UTC+8, Andrew Tomazo=
s wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Sorry, I s=
hould have actually read your proposal - specifically I think:<div><br></di=
v><div><p dir=3D"ltr" style=3D"font-family:arial,sans-serif;font-size:13px;=
line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size=
:15px;font-family:'Courier New';color:rgb(0,0,0);white-space:pre-wrap;backg=
round-color:transparent">{</span></p><p dir=3D"ltr" style=3D"font-family:ar=
ial,sans-serif;font-size:13px;line-height:1.15;margin-top:0pt;margin-bottom=
:0pt;text-indent:36pt"><span style=3D"font-size:15px;font-family:'Courier N=
ew';color:rgb(0,0,0);white-space:pre-wrap;background-color:transparent">aut=
o file =3D file_open_rlock("data_snippet"<wbr>);</span></p><p dir=3D"ltr" s=
tyle=3D"font-family:arial,sans-serif;font-size:13px;line-height:1.15;margin=
-top:0pt;margin-bottom:0pt;text-indent:36pt"><span style=3D"font-size:15px;=
font-family:'Courier New';color:rgb(0,0,0);white-space:pre-wrap;background-=
color:transparent">auto blob =3D file.fetch_all();</span></p><p dir=3D"ltr"=
 style=3D"font-family:arial,sans-serif;font-size:13px;line-height:1.15;marg=
in-top:0pt;margin-bottom:0pt;text-indent:36pt"><span style=3D"font-size:15p=
x;font-family:'Courier New';color:rgb(0,0,0);white-space:pre-wrap;backgroun=
d-color:transparent">file.close();</span></p></div></div></blockquote><div>=
<br>Not only is it more readable, it's more correct. Relying on destructors=
 for side effects demands that they ignore any failures. Explicitly flushin=
g and closing a file or a connection before it goes out of scope gives a co=
nfirmation of success that implicit destructor cleanup does not. (At least,=
 that can't safely happen until uncaught_exception gets fixed.)<br><br>Like=
wise, it's cleaner if a destructor can treat an open state as a failure, an=
d avoid flushing or such side effects for the sake of safety over convenien=
ce.<br></div></div></blockquote><div><br></div><div>If I understand it corr=
ectly the destructor exception issue could be fixed by the time this extens=
ion is added?<br></div><div><br></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_527_857056717.1413385099380--

.
