I ve written a class in c++ named Sync . Then, i ve created a map holding Sync objects, associated with syncID num, as follows:
map<int, Sync*> _syncList;
在我的一种方法中,我试图在我的地图上找到一个现有的合成物体,具体如下:
Sync* currS = *(_syncList.find(sync_id))->second;
我认为这是错误的,但汇编者对此表示不满:
error: cannot convert ‘Sync’ to ‘Sync*’ in initialization
为了适当解决这一问题,可以做些什么?