diff --git a/ex00/Fixed.cpp b/ex00/Fixed.cpp index a17d2e4..a171db3 100644 --- a/ex00/Fixed.cpp +++ b/ex00/Fixed.cpp @@ -8,12 +8,12 @@ Fixed::Fixed() { value = 0; } -Fixed::Fixed(Fixed &other) { +Fixed::Fixed(const Fixed &other) { std::cout << "Copy constructor called" << std::endl; this->value = other.value; } -Fixed &Fixed::operator=(Fixed &other) { +Fixed &Fixed::operator=(const Fixed &other) { std::cout << "Copy assignment operator called" << std::endl; this->setRawBits(other.getRawBits()); return *this; diff --git a/ex00/Fixed.hpp b/ex00/Fixed.hpp index 6935e36..8d04aae 100644 --- a/ex00/Fixed.hpp +++ b/ex00/Fixed.hpp @@ -4,8 +4,8 @@ class Fixed { public: Fixed(); - Fixed(Fixed &other); - Fixed &operator=(Fixed &other); + Fixed(const Fixed &other); + Fixed &operator=(const Fixed &other); ~Fixed(); int getRawBits(void) const;