ここで助けを求めています。
私のクラス
LevelEditor
次のような機能があります。
bool SetSingleMast(Game*, GameArea*, GameArea*, vector<IShip*>*);
bool SetDoubleMast(Game*, GameArea*, GameArea*, vector<IShip*>*);
...
main.cpp では、LevelEditor オブジェクトの関数へのポインターの配列を作成したいと考えています。私はこのようなことをしています:
bool (*CreateShips[2])(Game*, GameArea*, GameArea*, vector<IShip*>*) =
{LevelEdit->SetSingleMast, LevelEdit->SetDoubleMast, ...};
しかし、それは私にエラーを与えます:
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
私はそれが何を意味するのかさえ知りません。誰か助けてくれませんか?