fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <map>
  4. using namespace std;
  5.  
  6. struct Foo
  7. {
  8. };
  9.  
  10. void func(std::map<std::string, std::vector<Foo*> >* myMap){
  11. if(myMap == NULL)
  12. std::cout << "My map is Null" << std::endl;
  13. else if(myMap->empty())
  14. std::cout << "My map is empty" << std::endl;
  15. }
  16.  
  17. int main() {
  18. func(nullptr);
  19. std::map<std::string, std::vector<Foo*> > map;
  20. func(&map);
  21. return 0;
  22. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
My map is Null
My map is empty