From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id A4E443857C6A for ; Thu, 4 Nov 2021 19:51:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4E443857C6A Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 0F6AD3A3D2A; Thu, 4 Nov 2021 15:51:23 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9vrHvy0NyJlr; Thu, 4 Nov 2021 15:51:22 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 545B03A39E3; Thu, 4 Nov 2021 15:51:22 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 545B03A39E3 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qeFKY4xV2tgE; Thu, 4 Nov 2021 15:51:22 -0400 (EDT) Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by mail.efficios.com (Postfix) with ESMTPSA id 386083A3C71; Thu, 4 Nov 2021 15:51:22 -0400 (EDT) Message-ID: <4eb56708-4f59-61d3-07d8-6918614eab3c@efficios.com> Date: Thu, 4 Nov 2021 15:51:21 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH 1/5] gdb: pass/return setting setter/getter scalar values by value Content-Language: en-US To: Simon Marchi , Tom Tromey , Simon Marchi via Gdb-patches References: <20211101155009.457224-1-simon.marchi@efficios.com> <20211101155009.457224-2-simon.marchi@efficios.com> <87pmrfkc85.fsf@tromey.com> <4eaa272c-0dde-e59b-a1fb-3719b26e50aa@polymtl.ca> From: Simon Marchi In-Reply-To: <4eaa272c-0dde-e59b-a1fb-3719b26e50aa@polymtl.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 19:51:24 -0000 On 2021-11-04 14:59, Simon Marchi wrote: > On 2021-11-04 14:27, Tom Tromey wrote: >>>>>>> "Simon" == Simon Marchi via Gdb-patches writes: >> >> Simon> The getter and setter in struct setting always receive and return values >> Simon> by const reference. This is not necessary for scalar values (like bool >> Simon> and int), but more importantly it makes it a bit annoying to write a >> Simon> getter, you have to use a scratch static variable or something similar >> Simon> that you can refer to: >> >> Seems reasonable to me. >> >> Simon> - setting_setter_ftype set_func, >> Simon> - setting_getter_ftype get_func, >> Simon> + typename the_types::set set_func, >> Simon> + typename the_types::get get_func, >> >> Is "typename" really needed in spots like this? > > Hmm no, actually. Everywhere where the type doesn't depend on a > template type, I could remove it. Fixed locally. > > Also, that made me realize that I didn't change the names "the_types" > and "the_types2", which were work-in-progress names. I changed them > locally to setting_func_types and setting_func_types_1, respectively. > > Simon > Pushed with these fixes. Simon