Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Chris Hafey wrote:
Just because there is no one algorithm that meets everyones needs doesn't mean there shouldn't be one selected as the default for strings.

True. But it also doesn't mean any algorithm should be selected. It would in a sense be like providing some "black box" less<T> for any type imaginable. Not a pretty sight, especially since less<t> for a hash-value for a string is with almost certainty not the same as its case-sensitive string comparison strcmp().

Besides, if someone has a need to use a different algorithm, it is just a matter of specifying it at as the third parameter.

A third parameter to ... what?

I'm sure you are aware that predicates are by convention types, and they are given as template arguments at compile time to the class template using them. I've got a "prototype" hash_map implementation from Dinkumware here (the revision before VC7 release I believe). It has got four template parameters. There is also the problem that many implementations (of whatever standard template it might be) are given (or have taken) the freedom to append (default) template parameters to the template parameter list.

I understand the point that for usability there should possibly be a default string-hashing std function, but I also see that this is such a controversial subject that the standard perhaps is better off by not providing a "demo" implementation (remember that many of the std:: techniques are really "demonstrations" of how to do stuff).

Challenging me to proove that 90% of hash tables use strings makes you look like a fool.

It does? Confused | :confused:
You who stated "especially since >90% of hash tables use strings as keys". Are you really surprised that someone challanged that statement and asked you to back it up? Either you have proof and your statement holds, or you don't have proof.

It might be that I'm a fool sometimes, but I leave it up to you to figure out who can and who can't back their statements up in this case...

Can you honestly say that this is not a reasonable estimation?

Yes. I could also say No and it would possibly be equally true. I just don't know, and neither do you - that's my point.
From my experience it's not true. From your experience it apparently is true, but without some figures to back it up I'd still say "south end of north going 'ru".

Finally I urge you to think about how you responded to this thread.

You're right. I was having a bad day and unfortunately that showed up in my post. It was uncalled for and I apologize.
(Thanks for having a cooler head and not creating a flame-fest of it.)
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 
AnswerRe: How to pass data to a C++ program during a dialog when a button is pressed? Pin
Nish Nishant28-Apr-02 14:16
sitebuilderNish Nishant28-Apr-02 14:16 
AnswerRe: How to pass data to a C++ program during a dialog when a button is pressed? Pin
Gaurika Wijeratne28-Apr-02 19:28
Gaurika Wijeratne28-Apr-02 19:28 
GeneralStopping a video when any key is pressed Pin
28-Apr-02 11:06
suss28-Apr-02 11:06 
GeneralRe: Stopping a video when any key is pressed Pin
29-Apr-02 5:29
suss29-Apr-02 5:29 
GeneralRe: Stopping a video when any key is pressed Pin
Mike Nordell29-Apr-02 13:48
Mike Nordell29-Apr-02 13:48 

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.