Hello,
I am getting very strange behavior on an STL set::insert() .
...
//Rebuild the P_set
P_set.clear();//destroy old P set (shallow only)
assert( P_set.empty() );
for(int i = 0 ; i < N ; i++){
cout<<"addr="<< &(C_array[i])<<endl;
pair<set<C*>::iterator,bool> p = P_set.insert( &(C_array[i]) );
assert( p.second && "FAILED TO INSERT" );
}
assert( P_set.size() == N );
...
Very occasionally I fail the assert( p.second && "FAILED TO INSERT" );
No idea why, I print the addr out and they are all unique.
Any ideas?