public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5623] libstdc++: Add [[nodiscard]] to std::byteswap
@ 2021-11-30 12:33 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-11-30 12:33 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
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
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-30 12:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 12:33 [gcc r12-5623] libstdc++: Add [[nodiscard]] to std::byteswap Jakub Jelinek
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).