From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 3FD1B3858C2C for ; Tue, 7 Mar 2023 21:52:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3FD1B3858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 949A64076B42; Tue, 7 Mar 2023 21:51:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 949A64076B42 Date: Wed, 8 Mar 2023 00:51:59 +0300 (MSK) From: Alexander Monakov To: Jonathan Wakely cc: Richard Biener , gcc-patches@gcc.gnu.org, Jakub Jelinek Subject: Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz In-Reply-To: Message-ID: References: <20230306101121.3CFDA13A66@imap2.suse-dmz.suse.de> <758f3df6-7d0c-0712-fd79-b6e391cb402d@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 7 Mar 2023, Jonathan Wakely wrote: > > Shouldn't this use the idiom suggested in ansidecl.h, i.e. > > > > private: > > DISABLE_COPY_AND_ASSIGN (auto_mpfr); > > > Why? A macro like that (or a base class like boost::noncopyable) has > some value in a code base that wants to work for both C++03 and C++11 > (or later). But in GCC we know we have C++11 now, so we can just > delete members. I don't see what the macro adds. Evidently it's possible to forget to delete one of the members, as showcased in this very thread. The idiom is also slightly easier to read. Alexander