Formatting and check not assigning to self in operator=
parent
f21109960d
commit
6824a51d70
|
@ -111,11 +111,15 @@ bool Julian::operator<=(const Julian &date) const {
|
|||
* assignment
|
||||
*/
|
||||
Julian& Julian::operator=(const Julian& b) {
|
||||
|
||||
if (this != &b) {
|
||||
date_ = b.date_;
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
Julian& Julian::operator=(const double b) {
|
||||
|
||||
date_ = b;
|
||||
return (*this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue