Questions tagged [boost-multi-index]

A C++ library which enables the construction of containers maintaining one or more indices with different sorting and access semantics.

248 questions
0
votes
1 answer

where can I find example of boost::multi_index range deletion

I'm looking for example code for the deletion of elements in a multi_index container, using an ordered_non_unique range. I've found a single example on the boost site, which I can't duplicate with my code. I'm hoping for examples not written by the…
ecarew
  • 83
  • 6
0
votes
1 answer

How do I practice with multi_index of boost library

Do you have any document or project which I can practice with boost:multi_index?
Jena
  • 1
  • 2
0
votes
1 answer

Iterator becomes invalid after inserting in a boost::multi_index?

According to the documentation, hashed index iterators remains valid when new elements are inserted into a multi_index. However when I attempted the following approach auto& myIndex = myMultiIndex.get<0>(); auto range = myIndex.equal_range(x); for…
Niko
  • 257
  • 1
  • 8
0
votes
1 answer

boost::multi_index_container compile error due to incomplete type on index typedef'ing

I am using the boost::multi_index_container (as follows) and I am running into a compile error when trying to typedef the index: struct del_t { string del_id; string dev_version; }; struct count_container_t { uint32_t count_1; uint32_t…
decimus phostle
  • 1,040
  • 2
  • 13
  • 28
0
votes
1 answer

C++ Multi index table - eos persistance API

The code snippet for this question is from the Persistance API section of the WIKI documentation for EOS. The link to this page is here... https://github.com/EOSIO/eos/wiki/Persistence-API In the following code snippet, it looks like the class…
kamiss
  • 45
  • 1
  • 5
0
votes
1 answer

boost multi index - loop through key value of specific entry

I have a multi index with 2 indexes(in real code, they are of different type). class CrUsersKeys{ int IMSI; int TIMESTAMP; } After i find an entry in the multi index, I have the iterator of the entry. auto it =…
yaron
  • 439
  • 6
  • 16
0
votes
1 answer

Multi index copy in shared memory

I have a multi index in shared memory. I need to dump the content of multi index to csv. So each action on the multi index is protected by a mutex lock. So the way i did the dump, is lock the mutex, loop through a specific list index and write…
yaron
  • 439
  • 6
  • 16
0
votes
1 answer

Iterate over a vector to update a word_counter

I have a vector of Result structures, each of which contains a contract string that is a "word" struct Result { string contract; int score; }; I want to find the frequency of occurrence of the distinct words in the…
DLyons
  • 188
  • 2
  • 13
0
votes
1 answer

Min & Max Value from Projected boost MultiIndex iterator

I am facing a sorting issue based on a Projected value from an iterator in the MultiIndex container. Below is the complete code. What I have removed here is the call of SellOrderRecord because the function called is same GenerateData but the…
0
votes
1 answer

Best container for struct with several keys c++

Given the following struct: struct{ // Keys int key1; double key2; type key3; ... // Variables to increment double varibleToIncrement; ... } What would be the best container to store these records given that I will need to increment the variables…
Batmax
  • 253
  • 8
  • 17
0
votes
0 answers

Boost multiindex container does not compile with generic type

I was trying to utilize a boost-multiindex container for fast and positional access. Providing something like a std::vector and an std::map at the same time. I had no problem to construct a simple boost-multiindex class. It worked really neat. The…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
0
votes
1 answer

Append index to a multi-index container

i am a newbie to boost multi_index, and currently trying to create a multi index container for which i will be able to define indices after the container is declared. In particular i want to load a number of different mysql dbs and thus need a…
0
votes
1 answer

Return an iterator to boost multiintex container as a std::set<>::iterator

The documentation for Boost multiindex containers seem to indicate that I can use it as a set after declaring an index to iterate over. So I was wondering if it is possible to hide the boost implementation and return an iterator masqueraded as an…
xcorat
  • 1,434
  • 2
  • 17
  • 34
0
votes
1 answer

Cannot find after insertion in boost multi_index

I created a boost multi_index in which I am inserting objects. My multi_index looks as follows, typedef boost::multi_index_container< Container*, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< …
codeworks
  • 149
  • 1
  • 15
0
votes
1 answer

Index with boost multi_index

How can I index a boost::multi_index container using a member function of class(that is being stored in the multi_index) that returns a constant reference of another class? The error I get is : error C2440: 'specialization' : cannot convert from…
codeworks
  • 149
  • 1
  • 15