220 40950 <CAKgx6BKzEVMDdp4NqV+jOXn05pMEUjHxfXRDVQr0UtKYtuBbzg@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Domen Vrankar <domen.vrankar@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Is C++ must need the finalizer? do you think?
Date: Sun, 11 Nov 2018 11:15:21 +0100
Lines: 104
Approved: news@gmane.org
Message-ID: <CAKgx6BKzEVMDdp4NqV+jOXn05pMEUjHxfXRDVQr0UtKYtuBbzg@mail.gmail.com>
References: <b4adbcd6-b84f-498b-87b4-305543009d82@isocpp.org>
 <01da2507-f069-48bb-9980-024ca148e1c3@isocpp.org> <CAD_7Vbksh_erks-_G9x=i17YPy4fFmWpPKvhP9Jj_sBZk3S6-A@mail.gmail.com>
 <59cd5315-4bc3-4d9f-a317-7fe278468f2d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="0000000000001c2d60057a60df75"
X-Trace: blaine.gmane.org 1541931238 26634 195.159.176.226 (11 Nov 2018 10:13:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 11 Nov 2018 10:13:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCHJ3Z4NUUFBBY4CUDPQKGQEORKCB6Y@isocpp.org Sun Nov 11 11:13:54 2018
Return-path: <std-proposals+bncBCHJ3Z4NUUFBBY4CUDPQKGQEORKCB6Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ed1-f72.google.com ([209.85.208.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCHJ3Z4NUUFBBY4CUDPQKGQEORKCB6Y@isocpp.org>)
	id 1gLmkb-0006pD-Mz
	for gclcip-std-proposals@m.gmane.org; Sun, 11 Nov 2018 11:13:53 +0100
Original-Received: by mail-ed1-f72.google.com with SMTP id f3-v6sf3314420edt.11
        for <gclcip-std-proposals@m.gmane.org>; Sun, 11 Nov 2018 02:16:04 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1541931364; cv=pass;
        d=google.com; s=arc-20160816;
        b=IhXnpeay27F92T+PdW17lsTsiXk3/DzQcvk4o1WIN7kXGbzEN74CGJ80bZSH/j3LtD
         vDrYjsNbi2r8lrUTabYWeb03f0y2e47ct8zCORMuMJPqKKR4k4gfYdC2Qa7ckti97nsZ
         s/QEwoo1t/uSUm5dGloTYIjga7m17ytqxqIbgMZNIcEw3m17P8TDpOLIzzQ1KwgVoncz
         y0fZ8VoCSnvwFUcC/CdKzK9WCkenm5Sx9U1yAL42YcwGGkCYM2i6Nb5rVSmUfK58I5Hw
         KOsPhmT77pW0tixEZROCfTMyU5/rwOis2VCuMUMq1IvqDZNHHbFYere3pnx+jSMlEV3d
         Ugmw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:dkim-signature;
        bh=WtifU2Bn+On0+7gymTYHZ0axJfMPwSo7UJv33MHiyeE=;
        b=oKVluwwjm5mOiY21tAEdC2LAWGffYqG8VKS9zMJDS1dTaJG67v5YvwkFtqffg4q3hp
         3I2RecnQMTmUN48jgHJ0XZqOV9Vv75X6oWfdnlIztmjPrVEIaGq0XcfLk13NOGVVu5So
         ltqgZpIGAKNDfCSgMVOR5lk2eSQwKZGaz2syOg5MGl7w5LWgE724jV/azTp/PItaL6bD
         W5OKUAPlaMsr88trAEbisJeuZ294NF+HTZ8aTXwWUi93OvOKc1cexYjFqL1jtRnTaCDZ
         v4utTpffXPhj8gOFSCucnCf5unATLeiFqNgVMDZch18z8W66LMsDy7HsF2nDUk0zEIq8
         AefQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=D1lYelfK;
       spf=pass (google.com: domain of domen.vrankar@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=domen.vrankar@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=WtifU2Bn+On0+7gymTYHZ0axJfMPwSo7UJv33MHiyeE=;
        b=jBf+xBjPE9oV9cd4hp6ZwLsQff756eNb8qBA9Ku2q+fS/sMPV3hdf3AwSuVqudKxt+
         ExnDZkc5RUNVjdeJu6CaM0Vh/NJI9H5B3cdiQnQfU0jDZlBRzKZKKW5ii4arcR8/N2V8
         7V3xf8VwFlQk415qcPpQClktfQ/3lRhprf+i9m2TZ2XEK5znfNod0LIA+GBNJNjXbJLn
         Ap+RZmUi2T9x1lk9fnt9XEgJ2piR87xkQXfU+rlaefj0TMiG1Y9SBWDlhsZpfH0gIKpb
         T5Fbs93GcupKf58qq0o+6Bp7ndLcVOGKINBAORNM12FmmYduLtIG3dwJkV1hFnTFq4J8
         cfsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to: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=WtifU2Bn+On0+7gymTYHZ0axJfMPwSo7UJv33MHiyeE=;
        b=fxuVns4wivURyqTm8d5oNRXQwzXD6fwvIkPLmDu+c/ctECA4bLd39uxC1h/4q0XQ92
         DiPx/dMLjl8jEojA5Zo5N8BfrzeTWEP0nM5+OjGJ+zQOXU9ZfiLdp/AotHT9xKDp+iH7
         WXErsMq7+7KWGe+G2gN8tEN2zWaeYVNiuJ59pNyKFRNY1NBkTHX7uDph5Zg6XmjeMbNG
         ECSIfW0WmR75fNoBC6qVyORDdbu7SkeRlMB1XXm9nIjAMt6v1Gb60At+Xw0ypN9bDSPx
         qvdlEXITOI6nOO0PepPtm8KCSibV4h2CltPklGwYNCmvMUkRDjnQoq/i6u4aFGpchoR1
         A7cg==
X-Gm-Message-State: AGRZ1gLn07+KCyykkE4VGaNwdxcfAH8xIcYtSbyTgSfgRbGQJsE5SnFL
	t7j+f0DxT5IxaXdUmq433lJMYQ==
X-Google-Smtp-Source: AJdET5dQjgRF0vLNbsgNzT3gVTBspm/Xw8FcZqMehZSy7RdEA97tApU1oqCEsfWHgcDNNJgVk5W0dQ==
X-Received: by 2002:aa7:d68b:: with SMTP id d11-v6mr1622717edr.8.1541931364128;
        Sun, 11 Nov 2018 02:16:04 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a50:aea2:: with SMTP id e31-v6ls1381250edd.2.gmail; Sun, 11
 Nov 2018 02:16:02 -0800 (PST)
X-Received: by 2002:a05:6402:1249:: with SMTP id l9mr8533438edw.198.1541931362770;
        Sun, 11 Nov 2018 02:16:02 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1541931362; cv=none;
        d=google.com; s=arc-20160816;
        b=0tD3mkANqwxrCzW34CKelf7faUXxW6DGI5DYk5GXZHP8OZA+McgCpiV8loZua+/C+B
         GGWfdWDrF7Q4KDoM6vvWz/KCBsgzHDpHsHHEXH7lKaCSf+vKrUJFrY2uCUWyNG2v16XQ
         3YNJNY32qn07OfEIZwz0psZHBlShXJDTiT6sKT2It+BWXqJB7klcYpoQHWDF3vnppxeo
         0F/l0rGUH+VDtdCR3h9dEUOC3HvLSoe28EH8q/2b+OJNRMjCGOcxcnxO8E1p1KMDHupU
         xVKLc3C+cNtwrMxtLThPmWx0/WDjzgXbT4zDNqHcPUgSaIJTRf1EYdgOaPPzkHZQc2my
         0cZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=Dh3boFcH+C6W7VciBZaNr0kfOo5PbJoDO9+9u2FvSow=;
        b=EhEY2AJCTE+vkfwkFDGCktneVpwpOzCZx1nWpg8wIiBbH7UeYTsodqIEScAMgkU+Uh
         Hbqm9+TqTBbIx1B7sxuTX1WOrLEeRVzPqzDPeTfraANYBPYPlqO7Q5dVld3yI45lxAlq
         QceM0M3BrTKKWJKbBADfPox+Gt1yiXy0KW/op4aGojQDiJbeYvc81c8PFvhWrn+W0hXX
         TU41EeXfCx7u0LgmBLhFotZIAxMiXx36Ux8wjdVlOXfckgEX+LP2MpfHS2yxS+4YDZhd
         aHd69/kWRrJGuYwvwdN/P2NZov3tx+RzF837+nWkIB76wg0Z3WyNHqvOrS0aaMHrViGm
         gEGg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=D1lYelfK;
       spf=pass (google.com: domain of domen.vrankar@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=domen.vrankar@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id o2-v6sor569426eja.51.2018.11.11.02.16.02
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sun, 11 Nov 2018 02:16:02 -0800 (PST)
Received-SPF: pass (google.com: domain of domen.vrankar@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a17:906:4b19:: with SMTP id y25-v6mr6509359eju.89.1541931362166;
 Sun, 11 Nov 2018 02:16:02 -0800 (PST)
In-Reply-To: <59cd5315-4bc3-4d9f-a317-7fe278468f2d@isocpp.org>
X-Original-Sender: Domen.Vrankar@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=D1lYelfK;       spf=pass
 (google.com: domain of domen.vrankar@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=domen.vrankar@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE 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: <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:40950
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40950>

--0000000000001c2d60057a60df75
Content-Type: text/plain; charset="UTF-8"

V V ned., 11. nov. 2018 ob 09:54 je oseba <yakitori1010@gmail.com> napisala:

> thank you for your opinion.
>
> i have one more question.
>
> static object is always static and binding in that?
> will that have to free timing?
> where is this?
>
> i think non free static object is out way the lifecycle theory.
> lifecycle is halting promise.
> if you can not break the old garbege.so you hate it.
> halting  promise is clear the that problem.yes!
>
> and the finalizer is solve it.so i think.
>

Static objects are no different from dynamic objects in this regard. If you
need to call a static method you can create a scoped object and call it
inside of the destructor like you would do inside a finally segment.
The advantage of not having a finally is that you don't need to indent with
a try block just for the sake of it:

try
{
   // code
}
finally
{
   // all the indentations here are useless noise needed because we want a
finally block
}

Here's an old thread on this topic:
https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/AApn0B6MsHg

There is also a proposal to standardize such scope guards:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0052r9.pdf

Regards,
Domen

-- 
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/CAKgx6BKzEVMDdp4NqV%2BjOXn05pMEUjHxfXRDVQr0UtKYtuBbzg%40mail.gmail.com.

--0000000000001c2d60057a60df75
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">V V ned., 11. nov. 2018 =
ob 09:54 je oseba &lt;<a href=3D"mailto:yakitori1010@gmail.com">yakitori101=
0@gmail.com</a>&gt; napisala:<br><div class=3D"gmail_quote"><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>thank you for your=
 opinion.</div><div><br></div><div>i have one more question.</div><div><br>=
</div><div>static object is always static and binding in that?</div><div>wi=
ll that have to free timing?</div><div>where is this?</div><div><br></div><=
div>i think non free static object is out way the lifecycle theory.</div><d=
iv>lifecycle is halting promise.</div><div>if you can not break the old gar=
bege.so you hate it.</div><div>halting=C2=A0 promise is clear the that prob=
lem.yes!</div><div><br></div><div>and the finalizer is solve it.so i think.=
 <br></div></div></blockquote><div><br></div><div>Static objects are no dif=
ferent from dynamic objects in this regard. If you need to call a static me=
thod you can create a scoped object and call it inside of the destructor li=
ke you would do inside a finally segment.</div><div>The advantage of not ha=
ving a finally is that you don&#39;t need to indent with a try block just f=
or the sake of it:</div><div><br></div><div>try</div><div>{</div><div>=C2=
=A0=C2=A0 // code<br></div><div>}</div><div>finally</div><div>{</div><div>=
=C2=A0=C2=A0 // all the indentations here are useless noise needed because =
we want a finally block<br></div><div>}<br></div><div><br></div><div>Here&#=
39;s an old thread on this topic: <a href=3D"https://groups.google.com/a/is=
ocpp.org/forum/#!topic/std-discussion/AApn0B6MsHg">https://groups.google.co=
m/a/isocpp.org/forum/#!topic/std-discussion/AApn0B6MsHg</a></div><div><br><=
/div><div>There is also a proposal to standardize such scope guards: <a hre=
f=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0052r9.pdf">h=
ttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0052r9.pdf</a></div=
><div><br></div><div>Regards,</div><div>Domen<br></div><div><br></div><div>=
 <br></div></div></div></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/CAKgx6BKzEVMDdp4NqV%2BjOXn05pMEUjHxfX=
RDVQr0UtKYtuBbzg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAKgx6BKzEVMDdp=
4NqV%2BjOXn05pMEUjHxfXRDVQr0UtKYtuBbzg%40mail.gmail.com</a>.<br />

--0000000000001c2d60057a60df75--

.
