From 0071b1e944cbce91ff6ff8e235280c3955ce1d5b Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 12 Dec 2020 12:33:39 +0100 Subject: Fixing cpp05 small errors --- cpp05/ex01/Bureaucrat.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cpp05/ex01/Bureaucrat.cpp') diff --git a/cpp05/ex01/Bureaucrat.cpp b/cpp05/ex01/Bureaucrat.cpp index 1024d54..2c1dd46 100644 --- a/cpp05/ex01/Bureaucrat.cpp +++ b/cpp05/ex01/Bureaucrat.cpp @@ -6,17 +6,18 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/14 18:08:13 by charles #+# #+# */ -/* Updated: 2020/11/17 12:08:02 by cacharle ### ########.fr */ +/* Updated: 2020/12/12 11:58:39 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include "Bureaucrat.hpp" -Bureaucrat::Bureaucrat(Bureaucrat const& other) { *this = other; } +Bureaucrat::Bureaucrat(Bureaucrat const& other) + : m_name(other.m_name) { *this = other; } Bureaucrat& Bureaucrat::operator=(Bureaucrat const& other) { - m_name = other.m_name; + // m_name = other.m_name; m_grade = other.m_grade; return *this; } @@ -44,7 +45,7 @@ void Bureaucrat::decrementGrade() checkGrade(); } -void Bureaucrat::signForm(Form& form) +void Bureaucrat::signForm(Form& form) const { try { @@ -53,7 +54,7 @@ void Bureaucrat::signForm(Form& form) } catch (std::exception &e) { - std::cout << m_name << " cannot sign " << form.getName() << " " << e.what() << std::endl; + std::cout << m_name << " cannot sign " << form.getName() << " because " << e.what() << std::endl; } } -- cgit