It "Works" for me.Code:#include<iostream> #include<map> int main() { int x = 8; std::map<int,int*> m={{1,&x},{5,&x}}; if(m[9]==nullptr) std::cout<<"Works"; return 0; }
Should I rely on this(when the 'second' of the pair is a pointer type) instead of 'find'ing, which appears to be slower ?