Click here to Skip to main content
15,909,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Numega Boundschecker Pin
Shog928-Apr-02 19:08
sitebuilderShog928-Apr-02 19:08 
GeneralRe: Numega Boundschecker Pin
Sameer Maggon28-Apr-02 19:18
Sameer Maggon28-Apr-02 19:18 
GeneralRe: Numega Boundschecker Pin
Nish Nishant28-Apr-02 20:00
sitebuilderNish Nishant28-Apr-02 20:00 
GeneralRe: Numega Boundschecker Pin
Christian Graus28-Apr-02 20:37
protectorChristian Graus28-Apr-02 20:37 
GeneralGlolbal mouse hotkey Pin
28-Apr-02 17:53
suss28-Apr-02 17:53 
GeneralRe: Glolbal mouse hotkey Pin
Nish Nishant28-Apr-02 19:54
sitebuilderNish Nishant28-Apr-02 19:54 
GeneralRe: Glolbal mouse hotkey Pin
28-Apr-02 20:25
suss28-Apr-02 20:25 
Generalusing strings as key for std::hash_map Pin
28-Apr-02 17:16
suss28-Apr-02 17:16 
So VC7 includes hash_map support, but it doesn't apppear to support strings as keys without you specifying your own hashing function. This means I have to do something like:


typedef std::string sstring;
struct string_hash_compare : public std::hash_compare<sstring, std::less<sstring> >
{
size_t operator( )( const sstring& Key ) const
{
// hash Key and return it
}

bool operator( )(const sstring& _Key1, const sstring& _Key2) const
{
return _Key1 < _Key2;
}
};

std::hash_map<sstring, int, string_hash_compare> MyHashMap;


I suppose this isn't *that* bad, but I am suprised they didn't add a size_t operator overload to std::string that hashed the string so this wouldn't be necessary. They could have at least provided a sensible string hashing function. I believe STLPort does this the right way. <sigh> Someone please tell me I overlooked something!

Chris Hafey
GeneralRe: using strings as key for std::hash_map Pin
Mike Nordell29-Apr-02 13:40
Mike Nordell29-Apr-02 13:40 
GeneralRe: using strings as key for std::hash_map Pin
Chris Hafey29-Apr-02 13:56
Chris Hafey29-Apr-02 13:56 
GeneralRe: using strings as key for std::hash_map Pin
Mike Nordell29-Apr-02 14:44
Mike Nordell29-Apr-02 14:44 
GeneralRe: using strings as key for std::hash_map Pin
29-Apr-02 16:20
suss29-Apr-02 16:20 
GeneralRe: using strings as key for std::hash_map Pin
Mike Nordell1-May-02 10:15
Mike Nordell1-May-02 10:15 
GeneralNeed C++ code running in dos base to turn computer off. Pin
Ronnie28-Apr-02 15:22
Ronnie28-Apr-02 15:22 
GeneralRe: Need C++ code running in dos base to turn computer off. Pin
Nish Nishant28-Apr-02 17:29
sitebuilderNish Nishant28-Apr-02 17:29 
GeneralRe: Need C++ code running in dos base to turn computer off. Pin
Mike Nordell29-Apr-02 13:43
Mike Nordell29-Apr-02 13:43 
QuestionHow to pass data to a C++ program during a dialog when a button is pressed? Pin
Learning28-Apr-02 11:37
Learning28-Apr-02 11:37 
AnswerRe: How to pass data to a C++ program during a dialog when a button is pressed? Pin
Tim Smith28-Apr-02 11:48
Tim Smith28-Apr-02 11:48 
GeneralRe: InterlockedIncrement ... Pin
Joao Vaz28-Apr-02 23:51
Joao Vaz28-Apr-02 23:51 
GeneralRe: InterlockedIncrement ... Pin
Tim Smith29-Apr-02 2:31
Tim Smith29-Apr-02 2:31 
GeneralRe: InterlockedIncrement ... Pin
Joao Vaz29-Apr-02 2:38
Joao Vaz29-Apr-02 2:38 
GeneralRe: InterlockedIncrement ... Pin
Tim Smith29-Apr-02 2:51
Tim Smith29-Apr-02 2:51 
GeneralRe: InterlockedIncrement ... Pin
Joao Vaz29-Apr-02 2:57
Joao Vaz29-Apr-02 2:57 
AnswerRe: How to pass data to a C++ program during a dialog when a button is pressed? Pin
Joaquín M López Muñoz28-Apr-02 11:50
Joaquín M López Muñoz28-Apr-02 11:50 
AnswerRe: How to pass data to a C++ program during a dialog when a button is pressed? Pin
Ravi Bhavnani28-Apr-02 12:15
professionalRavi Bhavnani28-Apr-02 12:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.