ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
This is not really a ROS related question... This is about regular programming...
So, if you receive ERROR
you want to check if there is already an error stored in the map, and if not, add it?
You can use the Standard std::map
functions:
count
to check if this element is already in the map http://www.cplusplus.com/reference/map/map/count/find
to find it http://www.cplusplus.com/reference/map/map/find/insert
to add a new one http://www.cplusplus.com/reference/map/map/insert/