I'm looking for help here.
my class
LevelEditor
has functions like this:
bool SetSingleMast(Game*, GameArea*, GameArea*, vector<IShip*>*);
bool SetDoubleMast(Game*, GameArea*, GameArea*, vector<IShip*>*);
...
In main.cpp I would like to make an array of pointers to LevelEditor object's functions. I'm doing something like this:
bool (*CreateShips[2])(Game*, GameArea*, GameArea*, vector<IShip*>*) =
{LevelEdit->SetSingleMast, LevelEdit->SetDoubleMast, ...};
But it gives me an error:
error C2440: 'initializing' : cannot convert from 'overloaded-function' to
'bool (__cdecl *)(Game *,GameArea *,GameArea *,std::vector<_Ty> *)'
with
[
_Ty=IShip *
]
None of the functions with this name in scope match the target type
I don't even know what does it mean. Can somebody help me?
std::functionandstd::bindLevelEditor::SetSingleMast.