Inserting objects into hash table (C++)
问题 This is my first time making a hash table. I'm trying to associate strings (the keys) with pointers to objects (the data) of class Strain. // Simulation.h #include <ext/hash_map> using namespace __gnu_cxx; struct eqstr { bool operator()(const char * s1, const char * s2) const { return strcmp(s1, s2) == 0; } }; ... hash_map< const char *, Strain *, hash< const char * >, struct eqstr > liveStrainTable; In the Simulation.cpp file, I attempt to initialize the table: string MRCA; for ( int b = 0;