Hello
Can I call .find() safely on map object if there's possibility that the map is empty? Or should I check for .is_empty() first?
Thanks a lot for help
This is a discussion on map .find() simple question within the C++ Programming forums, part of the General Programming Boards category; Hello Can I call .find() safely on map object if there's possibility that the map is empty? Or should I ...
Hello
Can I call .find() safely on map object if there's possibility that the map is empty? Or should I check for .is_empty() first?
Thanks a lot for help
You can safely use the find() member function on an empty map. With an empty map, it will surely return end().
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way