Re: STL & hash_set problem
Perhaps you should post your errors? This will tell you how to use code tags.
Re: STL & hash_set problem
What STL are you exactly talking about?
Most of the STL has become part of the C++ standard, thus any C++ compiler will contain STL. However, hash set was one of the few components that did not make it into the standard.
If you've downloaded some STL source code somewhere (SGI?) and extracted it into your include directory, you will probably have created a mess, due to the mixture of STL files that came with the compiler and extracted ones.
I suggest you use boost (www.boost.org) for a hash set implementation. Boost builds upon the current C++ standard and thus does not overlap with your compiler implementation of STL.
Re: STL & hash_set problem
Yes, it was SGI. I will delete all files of SGI STL from the dir since none have collided with original files and check out Boost. Thanks a bunch, Will report soon.
Edit: Boost seem really nice will try it in the future, but a friend of mine got it working, i was putting some files in the wrong dirs so i ended up using SGI STL . Thanks very much anyways for the fast response from all!
Re: STL & hash_set problem
Have another question: I'm not understanding very well the implemented concept of hash_set, so i would like to know how do i define the hash_set type. i want like a hashtable with with elements of type string but a key of int type.
hash_set <int> defines only teh type of the key right? what about the elements?
Regards
Re: STL & hash_set problem
I think you probably want a hash_map instead.
Re: STL & hash_set problem
or just a std::map if the key is int.