I want to transfer a function pointer in the constructor but get some error Messages...
I my parent class I declared:
class Strip{
public:
typedef void(Strip::*LOG)(const std::string&);
with a function log(const string&)
In my child class I forward declare Strip with class Strip and have somthing like that
class Observable{
public:
Observable(const char &signal,Strip::LOG log,const QCustomPlot *plot);
with a parameter
Strip::LOG log;
When I try to compile I get the error's
Strip::LOG has not been declared and LOG in class Strip does not name a type
Any Idea how to fix that?
typedef void(Strip::*LOG)(const std::string&);is not visible in your child class.std::functioninstead of C style function pointers b) when gathering a pointer to member usestd::mem_fnto ensure the call can be made correctly.typedef void(*LOG)(const std::string&);some compilers wouldn't like theStrip::*LOGin the class declaration.