removed copy constructor
This commit is contained in:
parent
0040965d2f
commit
3e51c41636
@ -17,18 +17,18 @@ using namespace std;
|
|||||||
// 'ü' 81 201
|
// 'ü' 81 201
|
||||||
// 'ß' E1 341
|
// 'ß' E1 341
|
||||||
|
|
||||||
class Date
|
class date
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
short day_;
|
short day_;
|
||||||
short month_;
|
short month_;
|
||||||
unsigned int year_;
|
unsigned int year_;
|
||||||
public:
|
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_);
|
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 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 !operator==(d); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class employee
|
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)),
|
employee(string name, string first_name, short day, short month, unsigned int year) : name(move(name)),
|
||||||
first_name(move(first_name)),
|
first_name(move(first_name)),
|
||||||
taken_holidays(0)
|
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();
|
const auto age = day_of_birth.get_age();
|
||||||
holidays = age > 50 ? 32 : 30;
|
holidays = age > 50 ? 32 : 30;
|
||||||
}
|
}
|
||||||
@ -93,7 +87,7 @@ public:
|
|||||||
|
|
||||||
string name;
|
string name;
|
||||||
string first_name;
|
string first_name;
|
||||||
Date day_of_birth;
|
date day_of_birth;
|
||||||
int holidays;
|
int holidays;
|
||||||
int taken_holidays;
|
int taken_holidays;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user