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 7939387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:05:01+00:00 2026-06-03T23:05:01+00:00

For my next task I need to use a very big hash; since I

  • 0

For my next task I need to use a very big hash; since I have an old compiler I cannot use C++0x std::unordered_map. Ideally I need is a call to reserve to make room in advance for a large number of items. I cannot find this method in boost::unordered_map: is there any place or function that achieves the same?

The 2 associative container are the same; I can see rehash function and the same constructor for controlling the number of buckets, but not a function about a number of elements.

Can you help me with that?

  • 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-06-03T23:05:03+00:00Added an answer on June 3, 2026 at 11:05 pm

    reserve can be emulated by rehash as in Table 103 in N3376.

    a.rehash(n) 
    Post: a.bucket_count() > a.size() / a.max_load_factor() 
          and a.bucket_count() >= n.
    
    a.reserve(n) Same as a.rehash(ceil(n / a.max_load_factor()))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have next task: I need to load the same file into my web
How are you? I have the next task. I have a lot of strings
I have the next query that I run via SQLCMD.EXE use [AxDWH_Central_Reporting] GO EXEC
There is the next task: I need to check if input parameter (object) is
I'm by no means an experienced programmer. This task I have is very likely
I have the next task. Let's assume that we have below tables in a
I faced with next task: I have an host, for example host.com and web-application
What does this mean: Next add reference to: MySql.Data actually I have downloaded mysql
I need to create next and previous link urls here's a sample <a href=/calendar/2009/10/>previous</a>
Still working my way through this program. Next task on my to-do list is

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.