From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8971 invoked by alias); 26 Feb 2018 19:45:39 -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 8893 invoked by uid 89); 26 Feb 2018 19:45:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=states 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; Mon, 26 Feb 2018 19:45:29 +0000 Received: by simark.ca (Postfix, from userid 112) id A49F11F427; Mon, 26 Feb 2018 14:45:27 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 3A30B1E072; Mon, 26 Feb 2018 14:45:26 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 26 Feb 2018 19:45:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Change target_write_memory_blocks to use std::vector In-Reply-To: <87h8q3pmnf.fsf@tromey.com> References: <20180225173703.6675-1-tom@tromey.com> <05afbce6-b052-9cb4-d4bc-c392f992ab60@simark.ca> <87h8q3pmnf.fsf@tromey.com> Message-ID: X-Sender: simark@simark.ca User-Agent: Roundcube Webmail/1.3.4 X-SW-Source: 2018-02/txt/msg00401.txt.bz2 On 2018-02-26 14:37, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > >>> + load_section_data () >>> + { >>> + } > > Simon> Is this empty constructor needed? > > I only added it for clarity. Is there some standard approach to this? > Or a gdb standard? Of all the C++ patches you did, I can't remember one where you added an empty constructor :). I think the de-facto standard in C++ is to let the compiler generate a default constructor instead. If we wanted to be explicit, we should rather do load_section_data () = default; but I think it's just fine to not declare anything. > Simon> Actually, I think it would be nice to give constructors to the > data > Simon> structures when possible, to make it less likely to have them in > Simon> invalid states. > > Simon> Here's an example, you can integrate it in your patch if you > like it. > > Yeah, this seems better to me. > I will pull it in. Ok, well at least it invalidates the point above :) Simon