std::map has "count" method:
http://www.cplusplus.com/reference/map/map/count/