From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 5DA513858439 for ; Thu, 4 Nov 2021 18:59:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5DA513858439 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1A4IxeRt007376 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Nov 2021 14:59:45 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1A4IxeRt007376 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B9D1B1ECEB; Thu, 4 Nov 2021 14:59:40 -0400 (EDT) Message-ID: <4eaa272c-0dde-e59b-a1fb-3719b26e50aa@polymtl.ca> Date: Thu, 4 Nov 2021 14:59:40 -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: Tom Tromey , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20211101155009.457224-1-simon.marchi@efficios.com> <20211101155009.457224-2-simon.marchi@efficios.com> <87pmrfkc85.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87pmrfkc85.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 4 Nov 2021 18:59:40 +0000 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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 18:59:49 -0000 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