The typical way to check for existence in many STL containers such as std::map
, std::set
, … is:
const bool is_in = container.find(element) != container.end();
The typical way to check for existence in many STL containers such as std::map
, std::set
, … is:
const bool is_in = container.find(element) != container.end();