Finishing changes

This commit is contained in:
2025-09-10 17:34:11 +02:00
parent b4499a6bf0
commit 1b0cebadb0
3 changed files with 42 additions and 11 deletions

View File

@@ -6,20 +6,49 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/10 00:54:50 by tigos #+# #+# */
/* Updated: 2025/09/10 00:57:12 by aortigos ### ########.fr */
/* Updated: 2025/09/10 17:33:29 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Fixed.hpp"
// Default constructor
Fixed::Fixed()
{
std::cout << "Default constructor called" << std::endl;
}
// Copy constructor
Fixed::Fixed(Fixed &other)
{
std:: cout << "Copy constructor called" << std::endl;
this->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 );
// setRawBits()
void Fixed::setRawBits( int const raw )
{
this->value = raw;
}