From a91158eb6cc5cf35563be55d5f23d917a3c86ea6 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 9 Jan 2023 11:33:30 +0100 Subject: [PATCH] initialize variables in constructors Signed-off-by: Steffen Vogel --- common/include/villas/graph/vertex.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/include/villas/graph/vertex.hpp b/common/include/villas/graph/vertex.hpp index 54e6a332d..365422ed6 100644 --- a/common/include/villas/graph/vertex.hpp +++ b/common/include/villas/graph/vertex.hpp @@ -18,13 +18,17 @@ class Vertex { public: using Identifier = std::size_t; + Vertex() : + id(0) + { } + const Identifier& getIdentifier() const { return id; } friend - std::ostream& operator<< (std::ostream &stream, const Vertex &vertex) + std::ostream& operator<<(std::ostream &stream, const Vertex &vertex) { return stream << vertex.id; } @@ -35,7 +39,7 @@ public: } private: - Identifier id = 0; + Identifier id; // HACK: how to resolve this circular type dependency? std::list edges; };