From baadd5bddcc7e5e851e4c447c7e4ef958bc5cbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Wed, 14 May 2025 14:06:26 +0200 Subject: [PATCH] fix(ex00): make some functions more const --- ex00/Fixed.cpp | 4 ++-- ex00/Fixed.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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;