/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Fixed.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 11:45:18 by charles #+# #+# */ /* Updated: 2020/11/10 09:50:15 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include "Fixed.hpp" Fixed::Fixed() : m_value(0) { std::cout << "Default constructor called" << std::endl; } Fixed::Fixed(Fixed const& other) { std::cout << "Copy constructor called" << std::endl; *this = other; } Fixed::~Fixed() { std::cout << "Destructor called" << std::endl; } Fixed& Fixed::operator=(Fixed const& other) { std::cout << "Assignation operator called" << std::endl; m_value = other.getRawBits(); return *this; } int Fixed::getRawBits() const { std::cout << "getRawBits member function called" << std::endl; return m_value; } void Fixed::setRawBits(int const raw) { std::cout << "setRawBits member function called" << std::endl; m_value = raw; }