/usr/include/c++/4.4/bits/stl_algo.h: In function ‘_Funct std::for_each(_IIter, _IIter, _Funct)
[with _IIter = __gnu_cxx::__normal_iterator<model_listener**,
std::vector<model_listener*,
std::allocator<model_listener*> > >, _Funct = void (model::*)(model_listener*)]’:
src/model.cpp:15: instantiated from here
/usr/include/c++/4.4/bits/stl_algo.h:4200: error:
must use ‘.*’ or ‘->*’ to call pointer-to-member function in ‘__f (...)’, e.g. ‘(... ->* __f) (...)’
I don't understand what the compiler is trying to say.
The for_each function has to make a call to the model::notify - which
unfortunately is a protected member function to which the for_each function will have no access and also the model::notify would need an object of type model to operate on.
As it looks like the model::notify function does not need access to any members of the model class anyway - just make it a public static member function.