220 3698 <183CB42B-6923-44A7-917A-A57638EF62E2@hsr.ch> article
Path: news.gmane.org!not-for-mail
From: Peter Sommerlad <peter.sommerlad@hsr.ch>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Dnnnn - <scope_exit> RAII classes...
Date: Sat, 13 Apr 2013 13:18:48 +0200
Lines: 87
Approved: news@gmane.org
Message-ID: <183CB42B-6923-44A7-917A-A57638EF62E2@hsr.ch>
References: <fbfa1b71-bb4b-4804-90b3-bf423de62b26@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1365851922 14601 80.91.229.3 (13 Apr 2013 11:18:42 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 13 Apr 2013 11:18:42 +0000 (UTC)
To: <std-proposals@isocpp.org>, Andrew Sandoval <sandoval@netwaysglobal.com>
Original-X-From: std-proposals+bncBD3OHQEN4AJBBE76USFQKGQEQZNTMHI@isocpp.org Sat Apr 13 13:18:46 2013
Return-path: <std-proposals+bncBD3OHQEN4AJBBE76USFQKGQEQZNTMHI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f72.google.com ([209.85.215.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD3OHQEN4AJBBE76USFQKGQEQZNTMHI@isocpp.org>)
	id 1UQyTk-0003Mf-Qt
	for gclcip-std-proposals@m.gmane.org; Sat, 13 Apr 2013 13:18:44 +0200
Original-Received: by mail-la0-f72.google.com with SMTP id fr10sf4579470lab.7
        for <gclcip-std-proposals@m.gmane.org>; Sat, 13 Apr 2013 04:18:44 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-received:x-beenthere:x-received:received-spf:mime-version:subject
         :from:in-reply-to:date:message-id:references:to:x-mailer
         :x-originating-ip:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type
         :content-transfer-encoding;
        bh=QwKaVh8IdA7J4ixTrn0z5ei1yMr5caDwv6FHFT6GUgQ=;
        b=bLZfk59cjy4z8qLXps4a85q+ArwLFIjKZXFJ0nhWkOpDV16GF5kVjI0sqPRoI1C06x
         yHkNTa3w+wbQY0RokO2rT1iVamelS3LGFWggQlipf8mgtUmYERielinGbYkzjs8ltgqK
         z/hV4Yo2yQ59iE+99N75nRapfsE/Jnj8gbOOZG4fX/RBujhiKflIppZubhplSZ0+zpaw
         P2Y8G4UJWQVYTud2X88Ahgqr7EBEtctlUyfvGEBJNaA90d2j8zunhE1MjG63Tr/tgSN+
         
X-Received: by 10.180.106.73 with SMTP id gs9mr729476wib.2.1365851923882;
        Sat, 13 Apr 2013 04:18:43 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.90.48 with SMTP id bt16ls167652wib.9.canary; Sat, 13 Apr
 2013 04:18:42 -0700 (PDT)
X-Received: by 10.194.81.71 with SMTP id y7mr22578538wjx.19.1365851922562;
        Sat, 13 Apr 2013 04:18:42 -0700 (PDT)
Original-Received: from mx1.hsr.ch (mx1.hsr.ch. [2001:620:130:a036::50])
        by mx.google.com with ESMTP id f3si17158718eev.17.2013.04.13.04.18.42;
        Sat, 13 Apr 2013 04:18:42 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of psommerl@hsr.ch designates 2001:620:130:a036::50 as permitted sender) client-ip=2001:620:130:a036::50;
Original-Received: from localhost (localhost [127.0.0.1])
	by mx1.hsr.ch (Postfix) with ESMTP id 05CF09CBC;
	Sat, 13 Apr 2013 13:18:42 +0200 (CEST)
Original-Received: from mx1.hsr.ch ([127.0.0.1])
	by localhost (mx1.hsr.ch [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id LTD1x-5CotX1; Sat, 13 Apr 2013 13:18:41 +0200 (CEST)
Original-Received: from webmail.hsr.ch (sid00200.hsr.ch [152.96.21.200])
	by mx1.hsr.ch (Postfix) with ESMTP id 3363D9B36;
	Sat, 13 Apr 2013 13:18:41 +0200 (CEST)
Original-Received: from [10.110.6.102] (152.96.21.55) by smtp.hsr.ch (152.96.21.200)
 with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 13 Apr 2013 13:18:40
 +0200
In-Reply-To: <fbfa1b71-bb4b-4804-90b3-bf423de62b26@isocpp.org>
X-Mailer: Apple Mail (2.1503)
X-Originating-IP: [152.96.21.55]
X-Original-Sender: peter.sommerlad@hsr.ch
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 best guess record for domain of psommerl@hsr.ch designates
 2001:620:130:a036::50 as permitted sender) smtp.mail=psommerl@hsr.ch
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?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:3698
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/3698>

the loop advancement example is not very convincing because it can easily b=
e dealt with by using for() instead of while() which is much simpler than t=
he alternative you are proposing.

I also wonder if an local struct with a destructor and a corresponding vari=
able wouldn't be simpler than the scoped example or alternatives like uniqu=
e_ptr or shared_ptr or boost::scoped_ptr that already provide much of the f=
unctionality you are proposing.

The example given as Motivation B calls for a dedicated RAII class for Crit=
icalSection IMHO, so again not very convincing.

IMHO it would greatly improve your paper if you would provide additional ex=
amples showing the "uglyness" of using existing alternatives to your propos=
al, i.e., DIY local structs with destructors, or "misusing" unique_ptr/shar=
ed_ptr for that purpose, in contrast to scoped_function and scoped_resource=
..

Also providing the no-delete value is not very convincing. What if all valu=
es less than zero are "no-delete", or 7, 23 and 42? It complicates the clas=
s and API and doesn't serve a general purpose. Usually a predicate is used =
in other cases to provide a hook for bool checks.

Just my CHF0.02 from a quick scan.

Peter.

On 12.04.2013, at 23:54, Andrew Sandoval <sandoval@netwaysglobal.com> wrote=
:

> I've requested a document number on this but haven't received it yet.  In=
 the meantime I wanted to make sure that the latest version of the document=
 was available for review. It is here: http://www.andrewlsandoval.com/scope=
_exit/scope_exit.h
>=20
> Please be kind.  I'm not sure I am even in the ballpark on the "standarde=
se" section, but it was very painful and time consuming (something I never =
have enough of to start with) to put together.
>=20
> Thank you, and thanks to everyone that has contributed feedback thus far =
on this proposal.
>=20
> -Andrew Sandoval
>=20
> --=20
> =20
> ---=20
> 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-propo=
sals/?hl=3Den.
> =20
> =20
> <proposal.html>

--=20
Prof. Peter Sommerlad

Institut f=FCr Software: Bessere Software - Einfach, Schneller!
HSR Hochschule f=FCr Technik Rapperswil
Oberseestr 10, Postfach 1475, CH-8640 Rapperswil

http://ifs.hsr.ch http://cute-test.com http://linticator.com http://includa=
tor.com
tel:+41 55 222 49 84 =3D=3D mobile:+41 79 432 23 32
fax:+41 55 222 46 29 =3D=3D mailto:peter.sommerlad@hsr.ch





--=20

---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.



.
