public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-5623] libstdc++: Add [[nodiscard]] to std::byteswap Date: Tue, 30 Nov 2021 12:33:35 +0000 (GMT) [thread overview] Message-ID: <20211130123335.7EFE93858402@sourceware.org> (raw) https://gcc.gnu.org/g:92084a6dcda8aaee538b4512bbaf161e1155a296 commit r12-5623-g92084a6dcda8aaee538b4512bbaf161e1155a296 Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Nov 30 13:30:27 2021 +0100 libstdc++: Add [[nodiscard]] to std::byteswap This patch adds [[nodiscard]] to std::byteswap, because the function template doesn't do anything useful if the result isn't used. 2021-11-30 Jakub Jelinek <jakub@redhat.com> * include/std/bit (byteswap): Add [[nodiscard]]. Diff: --- libstdc++-v3/include/std/bit | 1 + 1 file changed, 1 insertion(+) diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index 18ce5ca220c..4facb615014 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -83,6 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Reverse order of bytes in the object representation of `value`. template<typename _Tp> + [[nodiscard]] constexpr enable_if_t<is_integral<_Tp>::value, _Tp> byteswap(_Tp __value) noexcept {
reply other threads:[~2021-11-30 12:33 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20211130123335.7EFE93858402@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).