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/ex00/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/ex00/Bureaucrat.cpp')
| -rw-r--r-- | cpp05/ex00/Bureaucrat.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp05/ex00/Bureaucrat.cpp b/cpp05/ex00/Bureaucrat.cpp index 927d467..3385089 100644 --- a/cpp05/ex00/Bureaucrat.cpp +++ b/cpp05/ex00/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 10:23:23 by cacharle ### ########.fr */ +/* Updated: 2020/12/12 11:35:48 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; + // cannot copy other.m_name since it's constant m_grade = other.m_grade; return *this; } |
