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);
|
||||
}
|
||||
|
|
8
Julian.h
8
Julian.h
|
@ -24,10 +24,10 @@ public:
|
|||
bool operator>=(const Julian &date) const;
|
||||
bool operator<=(const Julian &date) const;
|
||||
|
||||
Julian& operator=(const Julian& b);
|
||||
Julian& operator=(const double b);
|
||||
Julian operator+(const Timespan& b) const;
|
||||
Julian operator-(const Timespan& b) const;
|
||||
Julian & operator=(const Julian& b);
|
||||
Julian & operator=(const double b);
|
||||
Julian operator+(const Timespan& b) const;
|
||||
Julian operator-(const Timespan& b) const;
|
||||
|
||||
~Julian() {
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue