1
0

removed copy constructor

This commit is contained in:
Holger Boerchers 2018-11-20 22:15:02 +01:00
parent 0040965d2f
commit 3e51c41636

View File

@ -17,18 +17,18 @@ using namespace std;
// 'ü' 81 201
// 'ß' E1 341
class Date
class date
{
private:
short day_;
short month_;
unsigned int year_;
public:
Date() : day_(1), month_(1), year_(1900)
date() : day_(1), month_(1), year_(1900)
{
}
Date(short day, short month, unsigned int year) : day_(day), month_(month), year_(year)
date(short day, short month, unsigned int year) : day_(day), month_(month), year_(year)
{
}
@ -47,8 +47,8 @@ public:
return std::to_string(day_) + "." + to_string(month_) + "." + to_string(year_);
}
bool operator ==(const Date& d) const { return day_ == d.day_ && month_ == d.month_ && year_ == d.year_; }
bool operator !=(const Date& d) const { return !operator==(d); }
bool operator ==(const date& d) const { return day_ == d.day_ && month_ == d.month_ && year_ == d.year_; }
bool operator !=(const date& d) const { return !operator==(d); }
};
class employee
@ -59,17 +59,11 @@ public:
{
}
employee(const employee& rhs) : name(rhs.name), first_name(rhs.first_name), day_of_birth(rhs.day_of_birth),
holidays(rhs.holidays), taken_holidays(rhs
.taken_holidays)
{
}
employee(string name, string first_name, short day, short month, unsigned int year) : name(move(name)),
first_name(move(first_name)),
taken_holidays(0)
{
day_of_birth = Date(day, month, year);
day_of_birth = date(day, month, year);
const auto age = day_of_birth.get_age();
holidays = age > 50 ? 32 : 30;
}
@ -93,7 +87,7 @@ public:
string name;
string first_name;
Date day_of_birth;
date day_of_birth;
int holidays;
int taken_holidays;
};