diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-11-10 09:26:04 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-11-10 09:26:04 +0100 |
| commit | 9dd7a48967f99793b818f7362ac8e95717186774 (patch) | |
| tree | d96d81af7cd6d36de7b5e01cab7688b60446f03a /cpp02/ex01 | |
| parent | 631a8d7b6c214da48f7748e78fc8c308960414fb (diff) | |
| download | piscine_cpp-9dd7a48967f99793b818f7362ac8e95717186774.tar.gz piscine_cpp-9dd7a48967f99793b818f7362ac8e95717186774.tar.bz2 piscine_cpp-9dd7a48967f99793b818f7362ac8e95717186774.zip | |
Added more tests for cpp01/07
Diffstat (limited to 'cpp02/ex01')
| -rw-r--r-- | cpp02/ex01/Fixed.cpp | 5 | ||||
| -rw-r--r-- | cpp02/ex01/Fixed.hpp | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/cpp02/ex01/Fixed.cpp b/cpp02/ex01/Fixed.cpp index a81c1cf..14ba1c6 100644 --- a/cpp02/ex01/Fixed.cpp +++ b/cpp02/ex01/Fixed.cpp @@ -6,7 +6,7 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 11:45:18 by charles #+# #+# */ -/* Updated: 2020/11/08 13:38:40 by charles ### ########.fr */ +/* Updated: 2020/11/09 13:11:29 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,10 +28,11 @@ Fixed::~Fixed() std::cout << "Destructor called" << std::endl; } -void Fixed::operator=(Fixed const& other) +Fixed& Fixed::operator=(Fixed const& other) { std::cout << "Assignation operator called" << std::endl; m_value = other.getRawBits(); + return *this; } Fixed::Fixed(const int from) diff --git a/cpp02/ex01/Fixed.hpp b/cpp02/ex01/Fixed.hpp index a262c59..1f768f6 100644 --- a/cpp02/ex01/Fixed.hpp +++ b/cpp02/ex01/Fixed.hpp @@ -6,7 +6,7 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 11:40:49 by charles #+# #+# */ -/* Updated: 2020/11/08 13:38:48 by charles ### ########.fr */ +/* Updated: 2020/11/09 13:11:15 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,7 +22,7 @@ public: Fixed(); Fixed(Fixed const& other); ~Fixed(); - void operator=(Fixed const& other); + Fixed& operator=(Fixed const& other); Fixed(const int from); Fixed(const float from); |
