Hashes are pretty good, but the best structure is a trie. You can get a trie from <ext/pb_ds/assoc_container.hpp> in GCC. See the online reference.
#include <ext/pb_ds/assoc_container.hpp>
#include <string>
#include <iostream>
int main() {
pb_ds::trie< std::string, int > dict;
dict.insert( std::make_pair( "hello", 3 ) );
std::cerr << ( dict.find( "hello" ) != dict.end() ) << std::endl;
std::cerr << ( dict.find( "goodbye" ) != dict.end() ) << std::endl;
}
Only map-like functionality, not a pure set, is provided. In the above sample I added a dummy int as data to map to… it shouldn't really hurt much.
What does hurt is that this won't work outside GCC.
On the other hand, a non-standard hash table (not std:: or ext:: anything) would allow you to only find approximate matches, i.e. to search among checksums of words instead of the words themselves. That would be the fastest, most compact solution. Dictionaries based on Bloom filters can contain many thousands of words in a few kilobytes.