From 510b8680e870a8fc2ac5f9e7eeb1f08704f33d87 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 28 Oct 2023 02:35:22 +0200 Subject: [PATCH] const! --- includes/Projet.hpp | 2 +- includes/RunProjet.hpp | 2 +- src/Projet.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/Projet.hpp b/includes/Projet.hpp index 0f81563..0b01deb 100644 --- a/includes/Projet.hpp +++ b/includes/Projet.hpp @@ -46,7 +46,7 @@ protected: Tache *contains(const std::string name) const; // Donne une version du vecteur de tâches non modifiable - const std::vector consult_tasks() const; + const std::vector consult_tasks() const; // Corrige les éventuelles anomalies du vector de tâches void topologicalSort(); diff --git a/includes/RunProjet.hpp b/includes/RunProjet.hpp index 9560d5b..4c8f8d9 100644 --- a/includes/RunProjet.hpp +++ b/includes/RunProjet.hpp @@ -7,7 +7,7 @@ class RunProjet final : public ProtoProjet { friend std::ostream &operator<<(std::ostream &, const RunProjet &); public: - RunProjet() = delete; // constructor + RunProjet() = delete; // remove default constructor RunProjet(ProtoProjet &); // constructor virtual ~RunProjet(); // destructor diff --git a/src/Projet.cpp b/src/Projet.cpp index 7d344ef..1b2ae97 100644 --- a/src/Projet.cpp +++ b/src/Projet.cpp @@ -86,7 +86,9 @@ Tache *Projet::contains(const std::string name) const { return nullptr; } -const std::vector Projet::consult_tasks() const { return taches; } +const std::vector Projet::consult_tasks() const { + return std::vector(taches.begin(), taches.end()); +} void Projet::topologicalSort() { // Construction de la pile