diff --git a/includes/Tache.hpp b/includes/Tache.hpp index 563ec3a..83ee72a 100644 --- a/includes/Tache.hpp +++ b/includes/Tache.hpp @@ -4,6 +4,8 @@ #include class Tache { + static int unique_id; + friend std::ostream &operator<<(std::ostream &, const Tache &); public: diff --git a/src/Tache.cpp b/src/Tache.cpp index e4f0d9c..fb2c5fe 100644 --- a/src/Tache.cpp +++ b/src/Tache.cpp @@ -1,10 +1,16 @@ #include "../includes/Tache.hpp" -Tache::Tache() { std::cout << "Hello, tache!\n"; } +int Tache::unique_id = 0; -Tache::~Tache() {} +Tache::Tache() { + ++unique_id; -Tache::Tache(const Tache &) {} + std::cout << "Hello, tache!\n"; +} + +Tache::~Tache() { --unique_id; } + +Tache::Tache(const Tache &) { ++unique_id; } const Tache &Tache::operator=(const Tache &src) { if (this == &src) {