Просмотр исходного кода

adjacency_matrix: correctly initialize members

Michele Caini 1 год назад
Родитель
Сommit
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;
 
     /*! @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.
      * @param allocator The allocator to use.
      */
     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
@@ -325,8 +324,8 @@ public:
     }
 
 private:
-    container_type matrix;
-    size_type vert;
+    container_type matrix{};
+    size_type vert{};
 };
 
 } // namespace entt