From cebe9f6ea7d382619851da3986a39b143a2b8ce5 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Mon, 31 Jul 2023 17:50:17 +0200 Subject: [PATCH] ex00: remove useless func and rename announe to announce --- ex01/src/Zombie.cpp | 13 +------------ ex01/src/Zombie.hpp | 5 +---- ex01/src/main.cpp | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/ex01/src/Zombie.cpp b/ex01/src/Zombie.cpp index 79a3d29..812ea74 100644 --- a/ex01/src/Zombie.cpp +++ b/ex01/src/Zombie.cpp @@ -13,23 +13,12 @@ Zombie::Zombie(const std::string& name) this->_name = name; } -Zombie::Zombie(const Zombie& src) -{ - *this = src; -} - Zombie::~Zombie() { std::cout << "~Zombie()" << std::endl; } -Zombie& Zombie::operator=(const Zombie& src) -{ - this->_name = src._name; - return *this; -} - -void Zombie::announe() +void Zombie::announce() { std::cout << this->_name << ": BraiiiiiiinnnzzzZ..." << std::endl; } diff --git a/ex01/src/Zombie.hpp b/ex01/src/Zombie.hpp index 3ca07cb..d7bd03d 100644 --- a/ex01/src/Zombie.hpp +++ b/ex01/src/Zombie.hpp @@ -8,14 +8,11 @@ class Zombie std::string _name; public: - Zombie(const Zombie& src); Zombie(); Zombie(const std::string& name); ~Zombie(); - Zombie& operator=(const Zombie& src); - - void announe(void); + void announce(void); void setName(const std::string& name); }; diff --git a/ex01/src/main.cpp b/ex01/src/main.cpp index 8351150..8e0eba5 100644 --- a/ex01/src/main.cpp +++ b/ex01/src/main.cpp @@ -8,7 +8,7 @@ int main() Zombie* bob = zombieHorde(4, "bob"); for (size_t i = 0; i < 4; i++) - bob[i].announe(); + bob[i].announce(); delete[] bob; Zombie* pierre = zombieHorde(-1, "pierre"); if (pierre == NULL)