diff --git a/ex00/Fixed/Fixed.cpp b/ex00/Fixed/Fixed.cpp index eae29aa..a5fb9e2 100644 --- a/ex00/Fixed/Fixed.cpp +++ b/ex00/Fixed/Fixed.cpp @@ -6,20 +6,49 @@ /* By: aortigos value = other.value; +} // Copy assignment operator overload +Fixed& Fixed::operator=(Fixed const &other) +{ + std::cout << "Copy assignment operator called" << std::endl; + if (this != &other) + this->value = other.getRawBits(); + return (*this); +} // Destructor +Fixed::~Fixed() +{ + std::cout << "Destructor called" << std::endl; +} -// int getRawBits( void ) const; +// getRawBits() +int Fixed::getRawBits( void ) const +{ + std::cout << "getRawBits member function called" << std::endl; + return (this->value); +} -// void setRawBits( int const raw ); \ No newline at end of file +// setRawBits() +void Fixed::setRawBits( int const raw ) +{ + this->value = raw; +} \ No newline at end of file diff --git a/ex00/Fixed/Fixed.hpp b/ex00/Fixed/Fixed.hpp index 6cc0df4..7056108 100644 --- a/ex00/Fixed/Fixed.hpp +++ b/ex00/Fixed/Fixed.hpp @@ -6,7 +6,7 @@ /* By: aortigos