From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123447 invoked by alias); 29 Sep 2016 17:34:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 123434 invoked by uid 89); 29 Sep 2016 17:34:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=HX-Envelope-From:sk:simon.m, H*r:112 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Sep 2016 17:34:16 +0000 Received: by simark.ca (Postfix, from userid 112) id 474D71E130; Thu, 29 Sep 2016 13:34:14 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id AB3DA1E109; Thu, 29 Sep 2016 13:34:12 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 29 Sep 2016 17:55:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Trevor Saunders , gdb-patches@sourceware.org Subject: Re: [RFA 17/22] Remove make_cleanup_restore_current_uiout In-Reply-To: <87eg42by2q.fsf@tromey.com> References: <1474949330-4307-1-git-send-email-tom@tromey.com> <1474949330-4307-18-git-send-email-tom@tromey.com> <20160929120428.rwtvs6i4zyzxrvmp@ball> <87eg42by2q.fsf@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.0 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00416.txt.bz2 On 2016-09-29 10:05, Tom Tromey wrote: >>>>>> "Trevor" == Trevor Saunders writes: > > Trevor> isn't this just scoped_restore ? why do you need a > separate > Trevor> class? > > In an earlier thread there was a discussion of not having this cleanup > be over-general -- that is, it was intentionally specific to just > current_uiout. In that case, may I suggest naming the class scoped_restore_current_uiout? IIRC, the original comment was that it was not necessary to have a parametrized make_cleanup_restore_uiout, when the only uiout we restore is the current_ui. And I don't think there was a cleanup to restore a generic pointer, so we had to have a specialized cleanup anyway. Here we have the option to have one less class by using your scoped_restore: scoped_restore uiout_restore (¤t_uiout, other_uiout); vs having a specific one: scoped_restore_current_uiout uiout_restore; current_uiout = other_uiout; I am ok with both methods, it's not a big deal. Simon