From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Add more doxygen comments in <bit>
Date: Fri, 25 Mar 2022 20:22:08 +0000 [thread overview]
Message-ID: <20220325202208.1239356-1-jwakely@redhat.com> (raw)
Tested powerpc64le-linux, pushed to trunk.
-- >8 --
libstdc++-v3/ChangeLog:
* include/std/bit (bit_cast, byteswap, endian): Add doxygen
comments.
---
libstdc++-v3/include/std/bit | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit
index a40f1ce99df..ef19d649e32 100644
--- a/libstdc++-v3/include/std/bit
+++ b/libstdc++-v3/include/std/bit
@@ -69,6 +69,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_bit_cast 201806L
/// Create a value of type `To` from the bits of `from`.
+ /**
+ * @tparam _To A trivially-copyable type.
+ * @param __from A trivially-copyable object of the same size as `_To`.
+ * @return An object of type `_To`.
+ * @since C++20
+ */
template<typename _To, typename _From>
[[nodiscard]]
constexpr _To
@@ -86,6 +92,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_byteswap 202110L
/// Reverse order of bytes in the object representation of `value`.
+ /**
+ * @tparam _Tp An integral type.
+ * @param __value An object of integer type.
+ * @return An object of the same type, with the bytes reversed.
+ * @since C++23
+ */
template<typename _Tp>
[[nodiscard]]
constexpr enable_if_t<is_integral<_Tp>::value, _Tp>
@@ -444,7 +456,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_endian 201907L
- /// Byte order
+ /// Byte order constants
+ /**
+ * The platform endianness can be checked by comparing `std::endian::native`
+ * to one of `std::endian::big` or `std::endian::little`.
+ *
+ * @since C++20
+ */
enum class endian
{
little = __ORDER_LITTLE_ENDIAN__,
--
2.34.1
reply other threads:[~2022-03-25 20:22 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=20220325202208.1239356-1-jwakely@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@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: 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).