فهرست منبع

adjacency_matrix: correctly initialize members

Michele Caini 1 سال پیش
والد
کامیت
ac8369d393
1فایلهای تغییر یافته به همراه4 افزوده شده و 5 حذف شده
  1. 4 5
      src/entt/graph/adjacency_matrix.hpp

+ 4 - 5
src/entt/graph/adjacency_matrix.hpp

@@ -114,15 +114,14 @@ public:
     using graph_category = Category;
     using graph_category = Category;
 
 
     /*! @brief Default constructor. */
     /*! @brief Default constructor. */
-    adjacency_matrix() noexcept(noexcept(allocator_type{}))
-        : adjacency_matrix{0u} {}
+    adjacency_matrix() noexcept(noexcept(allocator_type{})) = default;
 
 
     /**
     /**
      * @brief Constructs an empty container with a given allocator.
      * @brief Constructs an empty container with a given allocator.
      * @param allocator The allocator to use.
      * @param allocator The allocator to use.
      */
      */
     explicit adjacency_matrix(const allocator_type &allocator) noexcept
     explicit adjacency_matrix(const allocator_type &allocator) noexcept
-        : adjacency_matrix{0u, allocator} {}
+        : matrix{allocator} {}
 
 
     /**
     /**
      * @brief Constructs an empty container with a given allocator and user
      * @brief Constructs an empty container with a given allocator and user
@@ -325,8 +324,8 @@ public:
     }
     }
 
 
 private:
 private:
-    container_type matrix;
-    size_type vert;
+    container_type matrix{};
+    size_type vert{};
 };
 };
 
 
 } // namespace entt
 } // namespace entt