From b8e39b947890e74d82530e25ad9d02668aae1f0c Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 12 Nov 2020 15:46:07 +0100 Subject: Reformating cpp04 classes --- cpp04/ex00/Peon.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'cpp04/ex00/Peon.cpp') diff --git a/cpp04/ex00/Peon.cpp b/cpp04/ex00/Peon.cpp index df55b4f..8388dc9 100644 --- a/cpp04/ex00/Peon.cpp +++ b/cpp04/ex00/Peon.cpp @@ -6,27 +6,24 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 20:53:16 by charles #+# #+# */ -/* Updated: 2020/04/13 21:00:23 by charles ### ########.fr */ +/* Updated: 2020/11/12 13:01:42 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include "Peon.hpp" -Peon::Peon(std::string name): - Victim(name) +Peon::Peon(std::string const& name) : Victim(name) { std::cout << "Zog zog." << std::endl; } -void Peon::operator=(Peon const& other) +Peon& Peon::operator=(Peon const& other) { - m_name = other.m_name; + Victim::operator=(other); + return *this; } -Peon::Peon(Peon const& other) - : Victim(other) -{ -} +Peon::Peon(Peon const& other) : Victim(other) {} Peon::~Peon() { -- cgit