My main class Taskhas a private member:
private:
Task();
I add a derivation class Schedulerwith a class expression Task:
class Scheduler : public Task {
friend class Task;`
I create a file Scheduler.ccto implement the class derivation constructor Scheduler:
Scheduler::Scheduler() {
}
I am trying to compile with a constructor Schedulerin an empty field, but I got a compilation error that I do not understand the relationship because my constructor is Schedulerempty:
/tmp/PROJETO/T1/booos-t1/lib/Task.h: In constructor βBOOOS::Scheduler::Scheduler()β:
/tmp/PROJETO/T1/booos-t1/lib/Task.h:41:2: error: βBOOOS::Task::Task()β is private
Scheduler.cc:13:22: error: within this context
make[1]: ** [Scheduler.o] Erro 1
I would like to understand my problem because I am not trying to access the private member of the Task class in my constructor Scheduler.
source
share