Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 972617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:09:09+00:00 2026-05-16T03:09:09+00:00

First off, I would like to make a few points I believe to be

  • 0

First off, I would like to make a few points I believe to be true. Please can these be verified?

  • A hash map stores strings by
    converting them into an integer
    somehow.
  • std::map is not a hash map, and if I’m using strings, I should consider using a hash map for memory issues?
  • String compares are not good to rely on.

If std::map is not a hash map and I should not be relying on string compares (basically, I have a map with strings as keys…I was told to look up using hash maps instead?), is there a hash map in the C++ STL? If not, how about Boost?

Secondly, Is a hash map worth it for [originally] an std::map< std::string, non-POD GameState >?

I think my point is getting across…I plan to have a store of different game states I can look up and register into a factory.
If any more info is needed, please ask.

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:09:09+00:00Added an answer on May 16, 2026 at 3:09 am

    I don’t believe most of your points are correct.

    • there is no hash map in the current standard. C++0x introduces unordered_map, who’s implementation will be a hash table and your compiler probably already supports it.

    • std::map is implemented as a balanced tree, not a hash table. There are no “memory issues” when using either map type with strings, either as keys or data.

    • strings are not stored as numbers in either case – an unordered_map will use a hashing function to derive a numeric key from the string, but this is not stored.

    • my experience is that unordered_map is about twice the speed of map – they have basically the same interface, so you can try both with your own data – whenever you are interested in performance you should always perform tests your self with your own real data, rather than depending on the experience of others. Both map types will be somewhat sensitive to the length of the string key.

    Assuming you have some class A, that you want to access via a string key, the maps would be declared as:

    map <string, A> amap;
    unordered_map <string, A> umap;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off: Everything works , but I would like to fine tune this a
First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS
First off I'm running Ubuntu 9.10 I've edited the /etc/environment file to look like
First off, I am using Windows XP. I have multiple hard drives and it
First off, I understand the reasons why an interface or abstract class (in the
First off if you're unaware, samba or smb == Windows file sharing, \\computer\share etc.
First off, there's a bit of background to this issue available on my blog:
First off: I'm using a rather obscure implementation of javascript embedded as a scripting
First off, I'm working on an app that's written such that some of your
First off, let me start off that I am not a .net developer. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.