]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add more doxygen comments in <bit>
authorJonathan Wakely <jwakely@redhat.com>
Wed, 23 Mar 2022 12:16:25 +0000 (12:16 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 25 Mar 2022 20:21:48 +0000 (20:21 +0000)
libstdc++-v3/ChangeLog:

* include/std/bit (bit_cast, byteswap, endian): Add doxygen
comments.

libstdc++-v3/include/std/bit

index a40f1ce99df45e5ccbcd6d0f187fd53189b114b7..ef19d649e32ded777c8622dd10e77b12ba208b3b 100644 (file)
@@ -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__,