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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue