c++ - Compiling problems dealing map.find and initialization -


I named a class named C ++ as 'sync'. After this, I have a map that maintains sync objects Created, the sync ID is related to the number, as follows:

  map & lt; Int, sync * & gt; _syncList;   

In one of my methods, I am searching for an existing sync object, according to a given syncID number, as follows:

  sync * CurrS = * (_ syncList.find (sync_id)) - & gt; second;   

I thought it would be clean, but then the compiler complained about it:

  Error: Can not convert ??? ? Line Sync * one ???? Initially   

What can I do to fix this?

Two things:

  1. Get rid of the asterisks: Sync * currS = _syncList.find (sync_id) - & gt; second;
  2. Make sure that search () is actually an element (or otherwise) for find < Code> map & lt; ... & gt; :: end ).

Comments