Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Tom Tromey <tom@tromey.com>, Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbsupport: mark array_view::slice with [[nodiscard]]
Date: Fri, 3 Nov 2023 14:28:25 -0400	[thread overview]
Message-ID: <bef27b96-e58e-4ea8-a29a-0e135662fab4@efficios.com> (raw)
In-Reply-To: <87y1feiu3n.fsf@tromey.com>

On 11/3/23 14:12, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> The first one does nothing, it creates a new array_view but without
> Simon> using it, it's useless.  Mark the slice methods with [[nodiscard]]
> Simon> (which is standard C++17) so that error would generate a warning.
> 
> Looks good to me.
> 
> Unfortunately std::span::subspan doesn't seem to have this annotation.
> I wonder if it could be added.

Is it something that would be mandated by the standard, or just the
choice of each implementation?

> 
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, pushed.

Simon

  reply	other threads:[~2023-11-03 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03  3:19 Simon Marchi
2023-11-03 18:12 ` Tom Tromey
2023-11-03 18:28   ` Simon Marchi [this message]
2023-11-03 18:33     ` Tom Tromey
2023-11-03 18:59       ` Simon Marchi

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=bef27b96-e58e-4ea8-a29a-0e135662fab4@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /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