views:

170

answers:

2
+4  A: 

My first approach would be to identify why map's performance is poor. Maps are actually pretty good all round performers - they may wel outperform hash tables in some circumstances. Changing containers without knowing the problem is not a good idea.

Then I would junk DevC++. This antique is extremely buggy and is no longer under active development - I'd be especially dubious about using any libraries that came with it. I'd switch to a nightly build of Code::Blocks, the Twilight Dragon build of GCC, and (if I still wanted a hash) to either the TR1 or the Boost hashtable implementations.

anon
I second the Code::Blocks recommendation!
drspod
A: 

To explain the first error I would need to see how you typedef'd hash_map. (You did typedef it didn't you?).

The reason you are getting the second error is because your declarations of AbcHash and AbcCmp should declare their operator() functions as const:

size_t operator() (const Abc &a) const

bool operator() (const Abc &a1, const Abc &a2) const

However, I have to agree with Neil that using an actively developed library would be much wiser.

drspod