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>
Cc: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbsupport: mark array_view::slice with [[nodiscard]]
Date: Fri, 3 Nov 2023 14:59:03 -0400	[thread overview]
Message-ID: <14263d5d-68c3-4da1-8a3f-d1437188f4f1@efficios.com> (raw)
In-Reply-To: <87lebeit5o.fsf@tromey.com>

On 11/3/23 14:33, Tom Tromey wrote:
>>> Unfortunately std::span::subspan doesn't seem to have this annotation.
>>> I wonder if it could be added.
> 
> Simon> Is it something that would be mandated by the standard, or just the
> Simon> choice of each implementation?
> 
> I asked Jonathan Wakely on irc and he said he'll add it to libstdc++.

Wow, thanks a lot for doing that.

> The standard does sometimes specify [[nodiscard]], but he said that he
> has been campaigning against that, because implementations are already
> free to add it anywhere (they can emit any warnings they like) and they
> are also free to ignore any annotation.  So specifying it is pointless.

I think that makes sense to not specify them, they don't have an impact
on how the program behave.

Simon

      reply	other threads:[~2023-11-03 18:59 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
2023-11-03 18:33     ` Tom Tromey
2023-11-03 18:59       ` Simon Marchi [this message]

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=14263d5d-68c3-4da1-8a3f-d1437188f4f1@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