From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42719 invoked by alias); 14 Jan 2019 11:06:09 -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 42538 invoked by uid 89); 14 Jan 2019 11:06:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=cleanups, cancel, interest X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jan 2019 11:06:06 +0000 Received: by mail-wr1-f67.google.com with SMTP id 96so22341743wrb.2 for ; Mon, 14 Jan 2019 03:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4u+DDUUyJoP2XIuwRJk18O2uCgVYD6XfWj2Hzc/rwds=; b=hnS5QIgK2Nng9ta7we9YPh3K35Y5OjzpWbR+B0IJZoIW1T0BepnhHHLSGuI8CRm3Bo czHO5L1hLDQf4v50y6PD7APi0oSKOmv35f0vPsVW6ITGCnBL/cHY1cOHGEgbD/IqUOA6 xdagG2EFvMmB7qh9rRL9OhCbZEHdKEthrZN671Q/9LklleqnqE2B0sXhFRrW0gfTv9B5 CnYNQ2F6sH9EwZIkH6N5gJD7ETUdE379htETdBgu3+qoLUHNLnKBfkYEDVvMlPPnNFFI 2zOLlQ+K1stT3Qbf5fQ9Qpmrq+gJW7fyATue8EMe2vvRwX6/mJbI2mVQ1RokYWBwmAa6 60Rg== Return-Path: Received: from localhost (host86-172-198-47.range86-172.btcentralplus.com. [86.172.198.47]) by smtp.gmail.com with ESMTPSA id j33sm111737432wre.91.2019.01.14.03.06.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 03:06:02 -0800 (PST) Date: Mon, 14 Jan 2019 11:06:00 -0000 From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 00/12] remove some cleanups using a cleanup function Message-ID: <20190114110601.GL3456@embecosm.com> References: <20190109033426.16062-1-tom@tromey.com> <87fttxx45t.fsf@tromey.com> <878szpv6qg.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878szpv6qg.fsf@tromey.com> X-Fortune: The meek will inherit the earth -- if that's OK with you. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00322.txt.bz2 * Tom Tromey [2019-01-12 15:41:43 -0700]: > Andrew> How do you think this compares to your original patches? Any interest > Andrew> in this approach? > > Tom> Yes, let's do this. > > I happened to stumble across the message for commit > 9bcb1f1630b05594fa86bfd017639cfcc966b11c today. It references > > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4189.pdf > > ... which proposes a generic scope guard class along these lines. > So, now I wonder if we should just reuse that paper's contents, but in > the gdb namespace. Interesting, there's a revised version here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0052r5.pdf Which includes details about how the technique can be expanded to effectively give us `cleanup_on_failure` and/or `cleanup_on_success`, which would allow us to completely remove the use of the current `.reset ()` or `.cancel ()` functions. Thanks, Andrew