Q:

get value from std::map in c++ which has custom type

I have initialized a map as:
typedef void*   ProxyClientHandler;
std::map<string,ProxyClientHandler> connectedClient;

And I am inserting values into this map as 
ProxyClientHandler client;
string device;
connectedClient.insert ( std::pair<string,ProxyClientHandler>(device,client) );

no error returns upto this.
But when i am going to access the value of given relevant key as
string deviceId; 
ProxyClientHandler client = connectedClient.find(deviceId);

it gives me an error:

error: cannot convert ‘std::map, void*>::iterator {aka std::_Rb_tree_iterator, void*> >}’ to ‘ProxyClientHandler {aka void*}’ for argument ‘1’ to ‘int DHProxyClientDelPort(ProxyClientHandler, int)’

how can i fix this issue???

A:

std::map::find() returns iterator, usualy you can use it as this:
auto it = map.find( key );
if( it == map.end() ) {
   // key not found
}
ProxyClientHandler client = it->second;

