P
puzzlecracker
I have a std::set<A *> and assume that operator () is implemented to
establish relative order and for equality
What does standard or popular implementation dictate of the following
example:
#include<set>
#include "A.h"
using std::set
int main(int argc, char **argv)
{
std::set<A *> aSet;
A *nullA=0;
A *a=new A("NOT HERE")
set.insert(new A("something"))
//here is the list of operations I am
aSet.erase(nullA);
aSet.erase(a);
//clean up and return
return 0;
}
How do standard containers (instantiated with some pointer to user-
defined type) behave in the presence of null pointer?
Thanks
establish relative order and for equality
What does standard or popular implementation dictate of the following
example:
#include<set>
#include "A.h"
using std::set
int main(int argc, char **argv)
{
std::set<A *> aSet;
A *nullA=0;
A *a=new A("NOT HERE")
set.insert(new A("something"))
//here is the list of operations I am
aSet.erase(nullA);
aSet.erase(a);
//clean up and return
return 0;
}
How do standard containers (instantiated with some pointer to user-
defined type) behave in the presence of null pointer?
Thanks