Formatting and check not assigning to self in operator=

feature/19
Daniel Warner 2011-04-09 19:57:58 +01:00
parent f21109960d
commit 6824a51d70
2 changed files with 9 additions and 5 deletions

View File

@ -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);
}