2

I am primarily asking this question because I am not sure how I can calculate the size difference between the two since I store pointers to my class objects stored based on std::string as keys. I know the extra space is primarily because of house keeping in boost::unordered_map(heard is maintains a long array, I am not sure why, can somebody please explain why this is maintained also). I was thinking that std::map would not need housekeeping(please correct me if I am wrong).

My thought was that std::map is stored as a binary tree or a red-black tree and the boost::unordered_map converts your keys into a decimal numbers and hashed based on that.

Please clear my understanding on both.

TIA -R

Mat
  • 202,337
  • 40
  • 393
  • 406
codeworks
  • 149
  • 1
  • 15
  • The C++-standard allows implementors some freedom, you have to select a specific STL implementation to do a meaningful comparison. – Jojje Nov 04 '16 at 08:09

0 Answers0