C ++ puntero de función miembro
Considere la siguiente clase
class Foo
{
typedef bool (*filter_function)(Tree* node, std::list<std::string>& arg);
void filter(int filter, std::list<std::string>& args)
{
...
if (filter & FILTER_BY_EVENTS) {
do_filter(events_filter, args, false, filter & FILTER_NEGATION);
}
...
}
void do_filter(filter_function ff, std::list<std::string>& arg,
bool mark = false, bool negation = false, Tree* root = NULL)
{
...
}
bool events_filter(Tree* node, std::list<std::string>& arg)
{
...
}
};
Puedo pasarevents_filter
como parámetro de lado_filter
sólo cuandoevents_filter
esstatic
miembro. Pero no quiero hacerlostatic
. ¿Hay alguna manera de pasar el puntero a la función miembro a otra función? Puede estar usandoaumenta bibliotecas (como función) más o menos.
Gracias