E as Classes estão aqui
// Manager.hpp
#pragma once
#include "Employee.hpp"
#include "Authentication.hpp"
class Manager final : public Employee, Authentication
{
private:
/* data */
public:
Manager(Cpf cpf, std::string name, float salary, std::string password);
~Manager();
float bonus() const;
};
// manager.cpp
#include "Manager.hpp"
Manager::Manager(Cpf cpf, std::string name, float salary, std::string password)
: Employee(cpf, name, salary),
Authentication(password)
{
}
Manager::~Manager()
{
}
float Manager::bonus() const
{
return this->get_salary() * 0.5;
}
// Authentication.hpp
#pragma once
#include <string>
class Authentication
{
private:
std::string password;
public:
Authentication(std::string password);
bool authentication(std::string password) const;
};
// Authentication.cpp
#include "Authentication.hpp"
Authentication::Authentication(std::string password) : password(password)
{
}
bool Authentication::authentication(std::string password) const
{
return password == this->password;
}
tento compilar com g++ Bank/src/*.cpp -o bank.out e surge este erro:
Bank/src/main.cpp: In function ‘int main()’:
Bank/src/main.cpp:55:10: error: ‘Authentication’ is an inaccessible base of ‘Manager’
55 | login(manager_1, "senha_errada");