From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Lancelot SIX <lsix@lancelotsix.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis
Date: Fri, 15 Jan 2021 15:09:44 -0500 [thread overview]
Message-ID: <9f6bbdc6-efe8-3fb6-4d1c-bcbd381de778@polymtl.ca> (raw)
In-Reply-To: <20210115194950.16882-1-lsix@lancelotsix.com>
On 2021-01-15 2:49 p.m., Lancelot SIX via Gdb-patches wrote:
> In switch_thru_all_uis, a pre-c++11 way of removing copy constructor
> and assignment operator is used.
>
> This patch uses the DISABLE_COPY_AND_ASSIGN macro which does the right
> thing for pre and post c++11.
>
> gdb/Changelog:
>
> * top.h (switch_thru_all_uis): Use DISABLE_COPY_AND_ASSIGN.
> ---
> gdb/top.h | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/gdb/top.h b/gdb/top.h
> index a31b19ae954..d912ea97190 100644
> --- a/gdb/top.h
> +++ b/gdb/top.h
> @@ -190,10 +190,7 @@ class switch_thru_all_uis
>
> private:
>
> - /* No need for these. They are intentionally not defined
> - anywhere. */
> - switch_thru_all_uis &operator= (const switch_thru_all_uis &);
> - switch_thru_all_uis (const switch_thru_all_uis &);
> + DISABLE_COPY_AND_ASSIGN (switch_thru_all_uis);
>
> /* Used to iterate through the UIs. */
> struct ui *m_iter;
>
Thanks, this LGTM. Maybe just move the DISABLE_COPY_AND_ASSIGN so it's
right below the constructor (it no longer needs to be in the private
section, given we know we are using C++ >= 11).
Simon
next prev parent reply other threads:[~2021-01-15 20:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 19:49 Lancelot SIX via Gdb-patches
2021-01-15 20:09 ` Simon Marchi via Gdb-patches [this message]
2021-01-15 21:28 ` [PATCH v2] " Lancelot SIX via Gdb-patches
2021-01-15 21:38 ` Simon Marchi via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f6bbdc6-efe8-3fb6-4d1c-bcbd381de778@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox