I completely don't know how to approach to the issue. While compiling I gets the error:
C2280 'Employee &Employee::operator =(const Employee &)': attempting to reference a deleted function
.
I've found out that is a common problem but still I can't find any solution. Please take a look at the code:
class Employee
{
public:
std::string name, profession;
std::string current_task = "NONE";
int id, age, warrings;
std::vector<std::string>& tasks;
Employee::Employee(std::vector<std::string>& tasks) : tasks(tasks)
{
warrings = 0;
};
virtual void AssignNewTask(std::string input_string)
{
for (unsigned int i = 0; i < tasks.size(); i++)
{
if (input_string == tasks[i])
{
current_task = input_string;
std::cout << ">> The new task has been assigned" << std::endl;
return;
}
}
std::cout << input_string << " does not below to duties list for " << profession << std::endl;
}
};
class HR : public Employee
{
private:
static std::vector<std::string> tasks;
public:
HR::HR() : Employee(tasks)
{
Employee::profession = "HR Specialist";
}
};
class Helpdesk : public Employee
{
private:
static std::vector<std::string> tasks;
public:
Helpdesk::Helpdesk() : Employee(tasks)
{
Employee::profession = "Helpdesk Technician";
}
};
std::vector<std::string> HR::tasks = { "HR task" };
std::vector<std::string> Helpdesk::tasks = { "Helpdesk task" };
I'd like to ask for some explanation, details about issue. Maybe does someone know any good tutorial about it? I guess it is about operators overloading, default constructor or copy constructor or something like this. I had been reading about it but it isn't easy subject