I need to use casting in my program. I have in my code heading, in my base class
scSupervisor* msSupervisor; ///< My Supervisor
and I want to create an accessor function in the same header, in the derived class
Supervisor* Supervisor_Get(void){ return (Supervisor*)msSupervisor;}
//dynamic_cast<Supervisor*>(msSupervisor);}
As shown, the static casting compiles and runs fine. However, if I change to the dynamic cast version (shown commented) I am presented with the error message:
cannot dynamic_cast '((Core*)this)->Core::<anonymous>.scCore::msSupervisor' (of type 'class scSupervisor*') to type 'class Supervisor*' (target is not pointer or reference to complete type)
dynamic_cast<Supervisor*>(msSupervisor);}
^
In my eyes, it is a pointer. Do I do something illegal?