From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@efficios.com>
Cc: Tom Tromey <tom@tromey.com>,
Simon Marchi <simon.marchi@polymtl.ca>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbsupport: mark array_view::slice with [[nodiscard]]
Date: Fri, 03 Nov 2023 12:33:07 -0600 [thread overview]
Message-ID: <87lebeit5o.fsf@tromey.com> (raw)
In-Reply-To: <bef27b96-e58e-4ea8-a29a-0e135662fab4@efficios.com> (Simon Marchi's message of "Fri, 3 Nov 2023 14:28:25 -0400")
>> 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++.
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.
Tom
next prev parent reply other threads:[~2023-11-03 18:33 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 [this message]
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=87lebeit5o.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.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