diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-12-12 12:33:39 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-12-12 12:33:39 +0100 |
| commit | 0071b1e944cbce91ff6ff8e235280c3955ce1d5b (patch) | |
| tree | af908c41fc051002311f50e8f73b889769a5279e /cpp05/ex02/Bureaucrat.cpp | |
| parent | c10aa969c60cedef893146307fa319250901465a (diff) | |
| download | piscine_cpp-0071b1e944cbce91ff6ff8e235280c3955ce1d5b.tar.gz piscine_cpp-0071b1e944cbce91ff6ff8e235280c3955ce1d5b.tar.bz2 piscine_cpp-0071b1e944cbce91ff6ff8e235280c3955ce1d5b.zip | |
Fixing cpp05 small errors
Diffstat (limited to 'cpp05/ex02/Bureaucrat.cpp')
| -rw-r--r-- | cpp05/ex02/Bureaucrat.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cpp05/ex02/Bureaucrat.cpp b/cpp05/ex02/Bureaucrat.cpp index 64bbd25..3b03186 100644 --- a/cpp05/ex02/Bureaucrat.cpp +++ b/cpp05/ex02/Bureaucrat.cpp @@ -6,17 +6,18 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/14 18:08:13 by charles #+# #+# */ -/* Updated: 2020/11/17 13:37:49 by cacharle ### ########.fr */ +/* Updated: 2020/12/12 12:15:30 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,11 +54,11 @@ 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; } } -void Bureaucrat::executeForm(Form& form) +void Bureaucrat::executeForm(Form const& form) const { try { @@ -66,7 +67,7 @@ void Bureaucrat::executeForm(Form& form) } catch (std::exception &e) { - std::cout << m_name << " cannot execute " << form.getName() << " " << e.what() << std::endl; + std::cout << m_name << " cannot execute " << form.getName() << " because " << e.what() << std::endl; } } |
