fix(ex00): make some functions more const
This commit is contained in:
parent
b54faafe1d
commit
baadd5bddc
2 changed files with 4 additions and 4 deletions
|
|
@ -8,12 +8,12 @@ Fixed::Fixed() {
|
||||||
value = 0;
|
value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fixed::Fixed(Fixed &other) {
|
Fixed::Fixed(const Fixed &other) {
|
||||||
std::cout << "Copy constructor called" << std::endl;
|
std::cout << "Copy constructor called" << std::endl;
|
||||||
this->value = other.value;
|
this->value = other.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fixed &Fixed::operator=(Fixed &other) {
|
Fixed &Fixed::operator=(const Fixed &other) {
|
||||||
std::cout << "Copy assignment operator called" << std::endl;
|
std::cout << "Copy assignment operator called" << std::endl;
|
||||||
this->setRawBits(other.getRawBits());
|
this->setRawBits(other.getRawBits());
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
class Fixed {
|
class Fixed {
|
||||||
public:
|
public:
|
||||||
Fixed();
|
Fixed();
|
||||||
Fixed(Fixed &other);
|
Fixed(const Fixed &other);
|
||||||
Fixed &operator=(Fixed &other);
|
Fixed &operator=(const Fixed &other);
|
||||||
~Fixed();
|
~Fixed();
|
||||||
|
|
||||||
int getRawBits(void) const;
|
int getRawBits(void) const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue