220 13869 <5745b39f-5a8b-4b5d-a4fb-f221771ad863@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 01:23:40 -0700 (PDT)
Lines: 105
Approved: news@gmane.org
Message-ID: <5745b39f-5a8b-4b5d-a4fb-f221771ad863@isocpp.org>
References: <e8ee92d8-0018-45a2-b87a-2d87f13047b4@isocpp.org>
 <67af811f-e063-4b3e-85d6-5b9e54b00b8f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_5235_252979900.1413361420406"
X-Trace: ger.gmane.org 1413361430 15935 80.91.229.3 (15 Oct 2014 08:23:50 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 15 Oct 2014 08:23:50 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDO2X46R4AKRBDO67CQQKGQELFK5AMA@isocpp.org Wed Oct 15 10:23:43 2014
Return-path: <std-proposals+bncBDO2X46R4AKRBDO67CQQKGQELFK5AMA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f200.google.com ([209.85.214.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDO2X46R4AKRBDO67CQQKGQELFK5AMA@isocpp.org>)
	id 1XeJrz-0006y4-2R
	for gclcip-std-proposals@m.gmane.org; Wed, 15 Oct 2014 10:23:43 +0200
Original-Received: by mail-ob0-f200.google.com with SMTP id wn1sf3528587obc.3
        for <gclcip-std-proposals@m.gmane.org>; Wed, 15 Oct 2014 01:23:41 -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=yUYzmJ1Rrhud//axGDJl/jkK88N9+PJpONiIgreA/4M=;
        b=eDY2YSJ4/tMbwBIcSIOSniudGhHRpjF4AqZBAPO987Pctk7cZiPHy2E/wLL5j9Nmz0
         U2A5H7NkIzeRC8+Bkw5hfwr6XugfKj/VI7m8+HyIIMJKo7clJKMrzCmHueO1pHjjMtCx
         REdmwDMQ9vWS/qQLvEORpnzaaGa/17/5c4avKJOFiERqq5XCp/w2ZyKMnDWEwcld1Tgd
         7WshqrYg1G3lOJHSQ9KAFRh68j3kcL0bQi7TRxD0/bHJM4OylAeiWnOzL23r/0TOMOMC
         G9U+wnloyWYdXA7ktPL6o0+2wOQEEkBSd1+CZsyJMfSbmRMhHDw3F3uKB+JSuBzkL9Hp
         mCdQ==
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=yUYzmJ1Rrhud//axGDJl/jkK88N9+PJpONiIgreA/4M=;
        b=mRLeSaOrwn2OQjLoohjXGv3BdfJnbg8vBRSgfW0bjVBZtQWbGmaPpmVs8Y4x88vA7m
         Q6/Sk+o7KSRUMMf4gNxwOVVH1ZZEBqgYrvrR+9KxOdOw6BurO9ayvrQKZ+ZLsMy0yb5N
         0IPHvU2K5zo0zGQIH6br4nUjJVg50LH8KexME3ZQr2txLoUXc8X6g+J0nZ650fcVrcmE
         KnC9TT4cFE/+bmACo7Eys9WdAicNL5qDsjLKMFRdEbnzkgTL1eWvdxts30JgTfCcdmzS
         eM2B+62UhCqUjxtkwv8FjKi5/s9sYgBQ2cS2q+8vptoQRSI5zrAdz410injEYzOrKeGw
         F7zA==
X-Gm-Message-State: ALoCoQnAnbvTpEdUyhcnlZhgfVzbA8JQFXPFc1A4FUFFpXAv3I7h0G0BUw1h38V41x0Ir6KmsR07
X-Received: by 10.43.35.205 with SMTP id sx13mr7165920icb.1.1413361421482;
        Wed, 15 Oct 2014 01:23:41 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.23.72 with SMTP id 66ls139976qgo.54.gmail; Wed, 15 Oct
 2014 01:23:40 -0700 (PDT)
X-Received: by 10.140.101.227 with SMTP id u90mr3372qge.18.1413361420978;
        Wed, 15 Oct 2014 01:23:40 -0700 (PDT)
In-Reply-To: <67af811f-e063-4b3e-85d6-5b9e54b00b8f@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:13869
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13869>

------=_Part_5235_252979900.1413361420406
Content-Type: text/plain; charset=UTF-8



On Wednesday, October 15, 2014 9:33:02 AM UTC+2, Markus Grech wrote:
>
> Why not just limit the scope by adding an additional pair of {}? Is there 
> any advantage to using "delete local"?
>

With {} you lose the use of auto and your code becomes a bit more verbose. 
Later modifications become a nightmare. And you need the additional state 
'constructed but not yet initialized'.

I hope I got it right:

{
    some_typename_we_never_wanted_to_type_again1 reply;

    {
some_typename_we_never_wanted_to_type_again2 conn;

{
    some_typename_we_never_wanted_to_type_again3 blob;

    {
auto file = file_open_rlock("data_snippet");
blob = file.fetch_all();
    }

    conn = connect_to_peer("192.128.0.1");
    conn.send(blob);
}
reply = conn.fetch_reply();
    }

    {
auto file = file_create("output");
file.write(reply);
    }
}

-- 

--- 
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_5235_252979900.1413361420406
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, October 15, 2014 9:33:02 AM UTC+2, M=
arkus Grech 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">Why not just limit the scope by adding an additional pair of {}? Is th=
ere any advantage to using "delete local"?</div></blockquote><div><br></div=
><div>With {} you lose the use of auto and your code becomes a bit more ver=
bose. Later modifications become a nightmare. And you need the additional s=
tate 'constructed but not yet initialized'.</div><div><br></div><div>I hope=
 I got it right:</div><div><br></div><div><div>{</div><div>&nbsp; &nbsp; so=
me_typename_we_never_wanted_to_type_again1 reply;</div><div><br></div><div>=
&nbsp; &nbsp; {</div><div><span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span>some_typename_we_never_wanted_to_type_again2 conn;</div><di=
v><br></div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>{</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>	</span> &nbsp; &nbsp;some_typename_we_never_wanted_to_type_again3 blob;</=
div><div><br></div><div><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> &nbsp; &nbsp;{</div><div><span class=3D"Apple-tab-span" styl=
e=3D"white-space:pre">		</span>auto file =3D file_open_rlock("data_snippet"=
);</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">		</s=
pan>blob =3D file.fetch_all();</div><div><span class=3D"Apple-tab-span" sty=
le=3D"white-space:pre">	</span> &nbsp; &nbsp;}</div><div><br></div><div><sp=
an class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> &nbsp; &nbsp=
;conn =3D connect_to_peer("192.128.0.1");</div><div><span class=3D"Apple-ta=
b-span" style=3D"white-space:pre">	</span> &nbsp; &nbsp;conn.send(blob);</d=
iv><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>}<=
/div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>=
reply =3D conn.fetch_reply();</div><div>&nbsp; &nbsp; }</div><div><br></div=
><div>&nbsp; &nbsp; {</div><div><span class=3D"Apple-tab-span" style=3D"whi=
te-space:pre">	</span>auto file =3D file_create("output");</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>file.write(reply=
);</div><div>&nbsp; &nbsp; }</div><div>}</div></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_5235_252979900.1413361420406--

.
