"hashtable" is in the __gnu_cxx namespace. You can use "using namespace __gnu_cxx;" to let the compiler know to look there for "hashtable". Also, there is no default constructor for hashtable<...> so you need to specifiy some arguments to "stuff()" as shown below.
The modified version of your program shown below compiles and links ( at least it did for me but I'm using (gcc 3.3) which is different from the version you are using ( gcc 3.2.2 ).
- Dave
Code:
using namespace __gnu_cxx;
struct person {
int age;
char name[10];
};
struct GetName {
char* operator()(person one) const { return one.name; }
};
struct EqualKey {
bool operator()(char* c1, char* c2) const { return strcmp(c1, c2) == 0; }
};
int main(void)
{
hash<char*> fcn;
EqualKey key;
hashtable<person, char*, hash<char*>, GetName, EqualKey> stuff(0, fcn, key);
}