Explorar o código

doc: compressed_pair, std::tuple_size and std::tuple_element specializations

Michele Caini %!s(int64=4) %!d(string=hai) anos
pai
achega
fcfa994152
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      src/entt/core/compressed_pair.hpp

+ 11 - 0
src/entt/core/compressed_pair.hpp

@@ -255,9 +255,20 @@ inline void swap(compressed_pair<First, Second> &lhs, compressed_pair<First, Sec
 #if !defined __clang_major__ || __clang_major__ > 6
 #if !defined __clang_major__ || __clang_major__ > 6
 namespace std {
 namespace std {
 
 
+/**
+ * @brief `std::tuple_size` specialization for `entt::compressed_pair`.
+ * @tparam First The type of the first element that the pair stores.
+ * @tparam Second The type of the second element that the pair stores.
+ */
 template<typename First, typename Second>
 template<typename First, typename Second>
 struct tuple_size<entt::compressed_pair<First, Second>>: integral_constant<size_t, 2u> {};
 struct tuple_size<entt::compressed_pair<First, Second>>: integral_constant<size_t, 2u> {};
 
 
+/**
+ * @brief `std::tuple_element` specialization for `entt::compressed_pair`.
+ * @tparam Index The index of the type to return.
+ * @tparam First The type of the first element that the pair stores.
+ * @tparam Second The type of the second element that the pair stores.
+ */
 template<size_t Index, typename First, typename Second>
 template<size_t Index, typename First, typename Second>
 struct tuple_element<Index, entt::compressed_pair<First, Second>>: conditional<Index == 0u, First, Second> {
 struct tuple_element<Index, entt::compressed_pair<First, Second>>: conditional<Index == 0u, First, Second> {
     static_assert(Index < 2u, "Index out of bounds");
     static_assert(Index < 2u, "Index out of bounds");