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

Deduce the Tag from the iterator of boost::multi_index

I would like to deduce the tag from the iterator of boost::multi_index, is it possible? pseudo codes struct digital_base_struct { digital_base_struct(); std::string description_; //....... }; typedef…
user3689849
  • 521
  • 1
  • 3
  • 14
0
votes
3 answers

What multi-map-like data structure can support replacement while maintaining order?

I'm looking to implement a multi-map that maintains insertion order of the entries, and allows in-place insertion/replacement without affecting the order. Guava's LinkedListMultimap is almost perfect, but doesn't allow the type of replacement I'm…
Tavian Barnes
  • 12,477
  • 4
  • 45
  • 118
0
votes
1 answer

about erasing an interator of a boost multiindex

I'd like to delete some element out of a boost multi-index container by erasing iterators while visiting the collection. What I am not sure about is if any iterator invalidation is involved and whether my code below would invalidate firstand last…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
4 answers

boost multi_index_container and slow operator++

It is follow-up question for this MIC question. When adding items to the vector of reference wrappers I spend about 80% of time inside ++ operator whatever iterating approach I choose. The query works as following VersionView getVersionData(int…
kreuzerkrieg
  • 3,009
  • 3
  • 28
  • 59
0
votes
2 answers

boost::multi_index_container erase function rehases?

I have the following problem: I have defined a boost::multi_index_container, here a simplified definition which hashes a TYPE by a member function pointer &TYPE::m_id where m_id is an integral type boost::multi_index::multi_index_container< TYPE…
Gabriel
  • 8,990
  • 6
  • 57
  • 101
0
votes
2 answers

performance of boost multi_index_container

I am interested to know the performance of multi_index_container for the following use case: struct idx_1 {}; struct idx_2 {}; typedef multi_index_container< Object, indexed_by< // Keyed by: idx1 hashed_unique< …
xiaodong
  • 952
  • 1
  • 7
  • 19
0
votes
1 answer

Using a sublevel structure index with Boost multi_index

I am trying to solve an issue using Boost multi_index. If I have 2 structures as follows: struct MyStruct1 { int x; int y; }; struct MyStruct2 { int a; MyStruct1 b; }; How would I define an index using MyStruct2::b.x? Is this…
0
votes
1 answer

multiple unique key in a multi index

I am trying to store objects in a boost multi-index container. These objects are all unique can be retrieved by 2 separate keys (unique as well). namepsace bm = boost::multi_index; class MyObj { string strid_; int32_t numid_; }; //!…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

Crash while inserting entries in boost multiindexmap container

I am using Boost multi index map container to support cache in my application. But during insertion I seeing a application crash. My code looks somewhat like this class MultiIndexMap { public: MultiIndexMap(); ~MultiIndexMap(); string …
Apoorva sahay
  • 1,900
  • 3
  • 28
  • 45
0
votes
1 answer

Does boost's multi index copy key object

Does boost::multi_index create a copy of the key object. This question came into my mind since std::map HAS to store a key object according to it's design. However boost::multi_index does not explicitly asks for the key but instead it is gathered…
Saif Ur Rehman
  • 338
  • 3
  • 14
0
votes
1 answer

Possible to obtain a std::vector::const_iterator from a multi index container index?

I am converting some code in a system that serves the UI with an enumerator. Unfortunately the enumerator has been designed around the std::vector::const_iterator. That is, it takes a begin and end iterator of type…
MM.
  • 4,224
  • 5
  • 37
  • 74
0
votes
0 answers

Finding union of all subset of given input whose combination exactly match any of given rows

I am trying to solve a algorithm problem in efficient way. Below is problem I am going to explain this problem taking character as an example but in reality it could be anything (char, int, string, double, object etc). I doubt that should/would make…
Blackhole
  • 273
  • 2
  • 12
0
votes
1 answer

boost::multi_index_container - equal_range values

I have been trying a few solutions using the boost interprocess library with a map and now a multi_index_container in shared memory. With the multi_index_container, is there any way other than to iterate over the values returned from equal_range. …
Langfo
  • 430
  • 5
  • 17
0
votes
1 answer

boost::multi_index error "template argument 'x' is invalid"

So I made some kind of database with boost_multi_index like this: #include #include #include using namespace boost::multi_index; using namespace…
user2047610
  • 136
  • 1
  • 9
0
votes
1 answer

Again about Boost::multi_index_container, error c3849, what is wrong with binding to an int?

I have below code, but seems something is wrong with 'int age', code is as below: struct MyStruct { char* firstName; char* secondName; int age; }; typedef composite_key
Michael
  • 673
  • 2
  • 5
  • 23