From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11256 invoked by alias); 21 May 2012 18:36:35 -0000 Received: (qmail 11159 invoked by uid 22791); 21 May 2012 18:36:34 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 May 2012 18:36:08 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4LIa0ux014340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 May 2012 14:36:08 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4LGqqQ1000401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 21 May 2012 12:52:55 -0400 Date: Mon, 21 May 2012 18:36:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Tom Tromey , gdb@sourceware.org Subject: Re: Will therefore GDB utilize C++ or not? Message-ID: <20120521165252.GA6784@host2.jankratochvil.net> References: <20120330161403.GA17891@host2.jankratochvil.net> <87aa2rjkb8.fsf@fleche.redhat.com> <4F832D5B.9030308@redhat.com> <20120409190519.GA524@host2.jankratochvil.net> <4F833D29.4050102@redhat.com> <8762cwpz3u.fsf@fleche.redhat.com> <4FBA6D04.7060804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FBA6D04.7060804@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00109.txt.bz2 On Mon, 21 May 2012 18:27:48 +0200, Pedro Alves wrote: > and then: > > old_chain = make_cleanup (foo_cleanup, &whatever_arg); > > if (whatnot) > { > discard_cleanups (old_chain); > return SUCESS; > } > do_cleanup (old_chain); > > But yes, as I've said before elsewhere, give me destructors, > everything else I can live without. :-) > > Basically, whoever understands RAII should understand cleanups. > Not counting the auto-destruction issue, I'm saying that writing > raii classes vs writing cleanup function is mostly syntax sugar. With RAII you do not have to write many times in that function that do_cleanup statement (for multiple cleanup markers), which makes one of the differences. Jan