diff --git a/include/aoc/Vertex.hpp b/include/aoc/Vertex.hpp index 35f1b20..f696a03 100644 --- a/include/aoc/Vertex.hpp +++ b/include/aoc/Vertex.hpp @@ -23,10 +23,10 @@ class Vertex { public: Vertex(const std::string id); - std::string getId() const; + const std::string getId() const; const std::vector>& getNeighbors() const; void addNeighbor(const std::shared_ptr& neighbor); private: - std::string id_; + const std::string id_; std::vector> neighbors_; }; diff --git a/src/Vertex.cpp b/src/Vertex.cpp index c6f31b7..5b52df0 100644 --- a/src/Vertex.cpp +++ b/src/Vertex.cpp @@ -22,7 +22,7 @@ Vertex::Vertex(const std::string id) { } -std::string Vertex::getId() const +const std::string Vertex::getId() const { return id_; }