A C++ library which enables the construction of containers maintaining one or more indices with different sorting and access semantics.
Questions tagged [boost-multi-index]
248 questions
4
votes
1 answer
How to erase in Boost multi_index composite keys?
I was checking on this
Boost multi_index composite keys using MEM_FUN
Can someone tell me how to implement erase function for this example ?
Now I am doing
Name_set_by_last::iterator mitchells =…

Dev
- 369
- 1
- 5
- 12
4
votes
1 answer
deleting from a Boost MultiIndex
I have a boost multi-index structure that keeps boost::shared_ptr to instances of a class A.
When I use the "find" function of one of the index, I get an iterator "it" from which I can get back the actual pointer through A* a = it->get();. How can I…

sunmat
- 6,976
- 3
- 28
- 44
3
votes
1 answer
Problem using boost::multi_index with composite key member functions
I have the following container:
using KeyValue = mutable_pair;
using MyContainer = boost::multi_index_container<
KeyValue,
boost::multi_index::indexed_by<
boost::multi_index::hashed_unique<
…

Santiago
- 379
- 3
- 14
3
votes
2 answers
How to release boost::interprocess::named_mutex when the process crashes
I used boost::interprocess to create a boost::multi_index data structure in shared memory. There are many client processes that will access this data structure. When accessing, I will lock the data structure. The problem I encountered is Once the…

ben
- 59
- 5
3
votes
1 answer
Getting around Boost Multi-Index container's constant elements
I have some data class which is expensive to copy, but must be mutable, as it is frequently updated according to events. I also need a multi-index container to hold many such classes. I'm trying to set it up using boost::multi_index. For…

bavaza
- 10,319
- 10
- 64
- 103
3
votes
1 answer
Get values from a boost::multi_index
I have created a boost::multi_index successfully and inserted values too. I have two hashed indices to the multi_index. Both are member functions, but one is unique and the other one is non-unique.
I am trying to figure out the way to get the…

codeworks
- 149
- 1
- 15
3
votes
1 answer
Is it possible to make multi_index container use contiguous memory?
Here I have a simple multi_index container and I wonder if there is any way of forcing the multi_index to allocate the elements contiguously in memory. I thought that this would be possible if the main index is random_access.
However this simple…

alfC
- 14,261
- 4
- 67
- 118
3
votes
3 answers
How to use boost::object_pool as a boost::multi_index allocator?
I am trying to implement a boost::multi_index application and performance is very bad: inserting 10,000 objects takes almost 0.1 second and it is not acceptable. So when I look into the documentation and found that boost::multi_index could accept a…

loudking
- 115
- 4
3
votes
2 answers
The difference between modify and modify_key in boost multi_index_container
What is the difference between modify and modify_key in boost multi_index_container. I read their documentation both and I can't seem to find the difference between the usages of both.
Link to the documentation

mkmostafa
- 3,071
- 2
- 18
- 47
3
votes
1 answer
Iterator for boost multi-index when the KEY is boost::optional parameter
#include
using namespace std;
#include
#include
#include
#include
#include
#include…

mahesh gs
- 61
- 2
3
votes
1 answer
Can we use boost::multi_index::multi_index_container as a multiindex map?
I'm using boost::multi_index::multi_index_container<> of boost library.
I want to store the values related to each element present in this container.
Can we modify this container to use a multimap as well as it will be used as multi index container?

BSalunke
- 11,499
- 8
- 34
- 68
3
votes
1 answer
boost::multi_index_container: Take equal_range from arbitrary index, implement loop only once
I have a multi_index_container that looks basically like this:
struct MyStruct {
int a, b, c;
};
struct Tag1;
struct Tag2;
typedef multi_index_container<
MyStruct,
indexed_by<
hashed_non_unique<
tag,
composite_key<
…

phkoester
- 801
- 6
- 7
3
votes
0 answers
Simulating functionality of sql (or other rdbms) using stl/boost algorithms and containers
I've been using stl for a while but i'm just getting to know sql.
Can sql functionality be simulated using stl/boost containers and algorithms? if not, where do the limitations start?
for example, I could create a database by simply using…

kirill_igum
- 3,953
- 5
- 47
- 73
3
votes
1 answer
Boost multi_index_container partial index search based on results of partial_index_search
To illustrate my question, I copied below code from the "Phonebook" example of Boost help doc.
struct phonebook_entry
{
std::string family_name;
std::string given_name;
std::string ssn;
std::string phone_number;
}
And I can do a partial…

Michael
- 673
- 2
- 5
- 23
3
votes
2 answers
Boost multi_index container with composite key, custom comparer and partial index search
I have a class like this (simplified example):
class A {
public:
typedef boost::shared_ptr Ptr;
const std::string& getID() const;
const std::string& getLabel() const;
bool getFlag() const;
float getValue() const;
private:
…

Vladimir
- 117
- 2
- 8