I have a map of the form map > :
map >
For Example: I am storing the intensity value at 2-D co-ordinate(x,y) i
You can use std::map::find and check if the element exists before accessing it. You can read the usage/documentation here: http://en.cppreference.com/w/cpp/container/map/find
std::map::find