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
2 answers

boost multi_index reverse iterator erase trouble

I have the following (simplified) code: #include #include namespace bmi = boost::multi_index; #include #include #include using Container =…
Bulletmagnet
  • 5,665
  • 2
  • 26
  • 56
0
votes
1 answer

Container ordering requirements (in an effort to understand boost::multi_index)

Given a collection of something that is modeled as: struct Foo { int id; std::string name; }; where id is unique and name is non-unique/non-{null|empty}. How do I use a datastructure like boost::multi_index that will allow me to do the equivalent…
ForeverLearning
  • 6,352
  • 3
  • 27
  • 33
0
votes
1 answer

Alternatives for boost::multi_index

I would like to use something which can create a dictionary like, Multi-Keys Key1 which will map to SomeObject Key2 Key3 Key4 etc I would like to look up based on any key. I have weird issues with boost::multi_index…
codeworks
  • 149
  • 1
  • 15
0
votes
1 answer

C++ boost::multi_index: order of iterator_to member function

Reading the boost::multi_index reference, I discovered that the iterator_to method has constant order. How is that possible? I mean, if an iterator is a different object than the value_type it represents, how is possible the container finds their…
ABu
  • 10,423
  • 6
  • 52
  • 103
0
votes
2 answers

Measure the execution time of a function call in C++

How can I measure the execution time of a line of code in C++in Windows. I am inserting about 1,00,000 records boost::multi_index_container as follows: while(...) //read a single record from a csv file until EOF { ... while(...) // split the…
Jackzz
  • 1,417
  • 4
  • 24
  • 53
0
votes
1 answer

Boost Container vs Boost multi_index_container

What are the advantages of the boost::container class compared to boost::multi_index_container one? They can both store their data in shared memory and work with Boost.Interprocess (crucial for me), and multi_index_container seems to provide more…
Pietro
  • 12,086
  • 26
  • 100
  • 193
0
votes
3 answers

Searching bit-field data in Boost multi index container

I'm looking for the optimal solution for retrieving bit-field based objects from multi-index container. For simplicity, the data is: enum Bit { b0 = 1, b1 = 2, b2 = 4 }; struct Item { int field; // contains Bit values int…
Flaviu
  • 931
  • 11
  • 16
0
votes
1 answer

How to get the second to last element from a multi_index_container

I have a boost::multi_index_container indexed by hashed_unique and sequenced. How can I get the second from the last element from this container? struct MyContainer : public mi::multi_index_container< MyStruct, mi::indexed_by< …
Sonu Mishra
  • 1,659
  • 4
  • 26
  • 45
0
votes
1 answer

boost::multi_index_container: How to use composite_key (x,y) to support rectangular search?

typedef boost::multi_index_container < Record, indexed_by < ordered_non_unique < tag, composite_key < Record, const_mem_fun, const_mem_fun
Kirill Golikov
  • 1,354
  • 1
  • 13
  • 27
0
votes
1 answer

working with boost::multi_index reverse_iterators

I am having some trouble generating and comparing reverse_iterators on a multi_index set. namespace mi = boost::multi_index; typedef mi::multi_index_container< size_t, mi::indexed_by< mi::ordered_non_unique,…
0
votes
0 answers

Boost multi index composite keys with static comparator function

I would like to have a composite key for a multi index container of boost and would like to have a static comparator function passed to it (something like the code below). I also would like to avoid the solution given here to avoid the overhead of…
mkmostafa
  • 3,071
  • 2
  • 18
  • 47
0
votes
1 answer

Accessing data in hashed_unique in boost::multi_index

I'm trying for the first time to work with boost's multi-index and I can't seem to be able to wrap my head around all the code I see on the web. First of all: My aim is to have a container with an enum as the key for direct access as well as to be…
ginge
  • 1,962
  • 16
  • 23
0
votes
1 answer

searching a boost multi_index container the fastest possible way

The Problem My task is to analyze two 1-dimensional matrices. The first one is the data matrix, holding around 500 million floats. The second one is the query matrix, holding around 4000 floats. The goal at the end is to find (sub-)sequences in data…
user1587451
  • 978
  • 3
  • 15
  • 30
0
votes
1 answer

using boost multi_index within a templated structure

I am getting error: expected unqualified-id before 'typename' in line 59 when I try to compile this: #include #include #include #include…
user2525536
  • 366
  • 1
  • 4
  • 14
0
votes
1 answer

error: ‘boost::Q_FOREACH’ has not been declared

I'm using boost 1.54 and Qt version 5.2.1. I'm getting the following error when I try to build the package /usr/include/boost/multi_index/sequenced_index.hpp:927:10: error: 'boost::Q_FOREACH’ has not been declared boost::foreach::tag …