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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:14:11+00:00 2026-05-25T10:14:11+00:00

I need a container of unique elements to be accessed with a triplet of

  • 0

I need a container of unique elements to be accessed with a triplet of int, and each int can be over 1.000.000.000.

(Only few of these elements will be actually filled, and actually these elements are boost::unordered_map themselves).

Is it faster to have a multiindex array like boost::multiindex (or maybe something else I don’t know) or just a boost::unordered_map with a composed string as a key ?

  • 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-25T10:14:12+00:00Added an answer on May 25, 2026 at 10:14 am

    Multi-index isn’t what you want, you seem to want a single index whose type is a triple. (Unless you actually do want three independent indexes; if I misunderstood, leave a comment.)

    Don’t use strings, heavens no. Just use the triple as a key:

    typedef std::tuple<int, int, int> key_type;
    

    If you use an std::map<key_type, T>, you get logarithmic lookup, which may be sufficient, and I think you don’t even have to do any more work (not sure if lexicographic comparison is defined by default for tuples).

    If you want to use an std::unordered_map<key_type, T> (or the boost version), you have to define a hash function. Boost already has one for tuples, I think, but C++11 doesn’t; but it’s very easy to implement yourself based on hash_combine() which you can just crop out off the Boost code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive got this problem: Line 20 (LOOT_FromContainer(container) I need that to use as Invoke
I need to use the vector container in my native application (it's cocos-2dx framework)
I need to simply copy copy images (ul>li>img) from one container to other with
I have a container that contains an image that I need to drag from
Ok so basically I need to check,whether in my menu #Container exist any third
I have a container MovieClip that serves as a content area that I need
I have a vector containing n elements. I need to choose a subset of
I need a little advice on nesting HTML elements. I have a general structure
I have a list of about a hundreds unique strings in C++, I need
I have a div container with class embed and unique id. Inside the container

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.