namespace Borg
{
class BorgQueen
{
public:
BorgQueen();
bool move(Borg::Ship *ship, Destination dest) {return ship->move(dest);}
void fire(Borg::Ship *ship, Federation::Starfleet::Ship *target) {ship->fire(target);}
void destroy(Borg::Ship *ship, Federation::Ship *target) {ship->fire(target);}
void (Borg::BorgQueen::*firePtr)(Borg::Ship *ship, Federation::Starfleet::Ship *target) = &Borg::BorgQueen::fire;
void (Borg::BorgQueen::*destroyPtr)(Borg::Ship *ship, Federation::Ship *target) = &Borg::BorgQueen::destroy;
bool (Borg::BorgQueen::*movePtr)(Borg::Ship *ship, Destination dest) = &Borg::BorgQueen::move;
};
};
I need to have a pointers on mebers of my class : movePtr -> move(); This is what I have mannage to comme whit but i access it (the pointer); how can i call it from the ptr ?
int main()
{
Borg::BorgQueen Q();
[...]
// this does work
Q.movePtr(...);
Q.*movePtr(...);
*(Q.movePtr)(...)
}