From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E6B793858C53 for ; Tue, 7 Mar 2023 22:00:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6B793858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678226402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=F5OQaL5Ctbtvd12IN5pwnAtQD34bFnmZQ/yKj25Gksc=; b=O+VBu875mcz85xj8MYF1q506qgAW6Oz0iTuwZOpGeUzISsGl8HWOOx6PLObY8SBvGU+qK9 5t+3lFTqJGHMY7TOPCoehe5xlCOF+q/OtCC99YiUARJib/QnkpHjKWSrJdZd8OpiUEK3bh Nvmn+oN0QRCfN3wXD6roKiJXGy4tS70= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-38-k2WaZkuCOFWt8XXcv29rgA-1; Tue, 07 Mar 2023 17:00:01 -0500 X-MC-Unique: k2WaZkuCOFWt8XXcv29rgA-1 Received: by mail-qk1-f199.google.com with SMTP id x5-20020a05620a01e500b007428997e800so8259441qkn.10 for ; Tue, 07 Mar 2023 14:00:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678226400; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F5OQaL5Ctbtvd12IN5pwnAtQD34bFnmZQ/yKj25Gksc=; b=u5nJ1rtOAF3QIpFjjvX5D1dw9sUmhDG/8Vt0emXemPrta+POoSF82NYAB3b3w17hkN 9LS6mhWPYuouzn7QUVL5ipjF4xVtmKACRxKZczfVl7q1y1UYkcvdq0gDFjat7Apf5cLY VmiWL7fy/WIcRTw5PnMQKPptePgaWJbd9dItwx+C41eTaXJAEfo0S5H6bhEo16a561Xg YDX3bKlX7iUW6odMwMNfnuud/tDh1q4E78aa6/x/EJGrLL1d7O+cwVQmXTenS3qArN7u huU52T0agIbj6+cCMintBN8Sbua3hBUNhSJZDW1aI21atn+YYTX1H8iuFkKpc7KuRDWL 0CtQ== X-Gm-Message-State: AO0yUKUcDm5eYMI6pvcaJkqsqH/XYAq6Kc98wdUaW9EfJSbeaskdBkb1 H4I8BUF6bBlouc51V6gr4PztFz/kp4qztoXzVpUR697tL7RBdFacYvoOyzG5Nxdb+3UtHdL8eAM YnTVFWCkmVHuo5VKXjg== X-Received: by 2002:ac8:5848:0:b0:3bf:d4c3:3659 with SMTP id h8-20020ac85848000000b003bfd4c33659mr26017705qth.66.1678226400562; Tue, 07 Mar 2023 14:00:00 -0800 (PST) X-Google-Smtp-Source: AK7set+90gfmalBPMPW8/bohPPwVKArtRXfBKSb2vUg0bJk/EYnMnK0dto0YueGa90OoyMs1saZgsA== X-Received: by 2002:ac8:5848:0:b0:3bf:d4c3:3659 with SMTP id h8-20020ac85848000000b003bfd4c33659mr26017680qth.66.1678226400316; Tue, 07 Mar 2023 14:00:00 -0800 (PST) Received: from redhat.com (2603-7000-9500-34a5-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:34a5::1db4]) by smtp.gmail.com with ESMTPSA id i23-20020a05620a145700b00739e7e10b71sm10066608qkl.114.2023.03.07.13.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 13:59:59 -0800 (PST) Date: Tue, 7 Mar 2023 16:59:58 -0500 From: Marek Polacek To: Jonathan Wakely Cc: Alexander Monakov , Richard Biener , gcc-patches@gcc.gnu.org, Jakub Jelinek Subject: Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz Message-ID: References: <20230306101121.3CFDA13A66@imap2.suse-dmz.suse.de> <758f3df6-7d0c-0712-fd79-b6e391cb402d@ispras.ru> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.9 (2022-11-12) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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, Mar 07, 2023 at 09:54:08PM +0000, Jonathan Wakely via Gcc-patches wrote: > On Tue, 7 Mar 2023 at 21:52, Alexander Monakov wrote: > > > > > > 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. > > But easily caught by review. > > > The idiom is also slightly easier to read. > > That's a matter of opinion, I prefer the idiomatic C++ code to a SHOUTY MACRO. FWIW, I'd also prefer to see the explicit =deletes rather than having to go look up what exactly the macro does. Marek