1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

initialize variables in constructors

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel 2023-01-09 11:33:30 +01:00
parent d5ff9a1b53
commit a91158eb6c

View file

@ -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<std::size_t> edges;
};