Witam wszystkich serdecznie dawno mnie tu nie było ;).
Mam problem ponieważ, chcę utworzyć w klasie A konstruktor który przyjmuje jako parametr wskaźnik do metody.
Niestety gdy w klasie B tworze obiekt wyrzuca mi błąd. Proszę o poradę.
Pozdrawiam
typedef void(*fun)();
class A
{
public:
A( fun) {};
A() {};
};
class B
{
public:
void d() {};
void c()
{
A a = A(d);
}
};
error: dla A a = A(d);
E0289 no instance of constructor "A::A" matches the argument. argument types are: (void())