From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43186 invoked by alias); 2 Oct 2016 17:11: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 43168 invoked by uid 89); 2 Oct 2016 17:11:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:4.86_1, H*Ad:U*tom, Hx-languages-length:1071 X-HELO: gproxy4-pub.mail.unifiedlayer.com Received: from gproxy4-pub.mail.unifiedlayer.com (HELO gproxy4-pub.mail.unifiedlayer.com) (69.89.23.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Sun, 02 Oct 2016 17:11:15 +0000 Received: (qmail 30971 invoked by uid 0); 2 Oct 2016 17:11:13 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy4.mail.unifiedlayer.com with SMTP; 2 Oct 2016 17:11:13 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id qhBA1t0062f2jeq01hBDRb; Sun, 02 Oct 2016 11:11:13 -0600 X-Authority-Analysis: v=2.1 cv=RLogQeS+ c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=20KFwNOVAAAA:8 a=hr_W1MID9VmYA2EP1q8A:9 a=e_O65bzb51kRm2y5VmPK:22 Received: from c-67-176-62-53.hsd1.co.comcast.net ([67.176.62.53]:35034 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1bqkI9-0001Z1-OX; Sun, 02 Oct 2016 11:11:09 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , Trevor Saunders , gdb-patches@sourceware.org Subject: Re: [RFA 02/22] Use RAII to save and restore scalars References: <1474949330-4307-1-git-send-email-tom@tromey.com> <1474949330-4307-3-git-send-email-tom@tromey.com> <20160927085937.com7c7ct4wuchzpg@ball> <87wphtfmcj.fsf@tromey.com> <579b45a0-2393-bda9-a244-cb2f7611635f@redhat.com> <87k2dsg1ul.fsf@tromey.com> <87fuogg0jr.fsf@tromey.com> <01d6497c-7421-d234-e5b3-60a825b43c36@redhat.com> Date: Sun, 02 Oct 2016 17:11:00 -0000 In-Reply-To: <01d6497c-7421-d234-e5b3-60a825b43c36@redhat.com> (Pedro Alves's message of "Sat, 1 Oct 2016 11:33:15 +0100") Message-ID: <8760pafzh0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1bqkI9-0001Z1-OX X-Source-Sender: c-67-176-62-53.hsd1.co.comcast.net (bapiya) [67.176.62.53]:35034 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-10/txt/msg00009.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: >> However, once you need a copy constructor, it doesn't seem possible >> without a move constructor. The issue is that a copy constructor take a >> const reference, so you can't modify the fields of the original. Pedro> You can -- make the fields mutable. Ok, yeah, I had thought of this, but it seemed pretty ugly to me. Instead I removed all the 2 argument forms in favor of a second explicit assignment. This solves the problem as well. I can go back and do the mutable thing if you really prefer it though. Pedro> The gist is that I think that the features supported by compilers that Pedro> people are using in practice to build gdb with is what matters Pedro> in the end, not really C++03 vs C++11. The issue I see is that it's just too easy otherwise for C++11isms to slip in, especially considering that everybody doing development is likely to be using a compiler with all the C++11 features. Maybe buildbot can do C++03 builds to check. Tom