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
3
votes
2 answers
Searching in a set of shared_ptr
I have an object:
class Object {
public:
boost::shared_ptr const& name() const {reutrn _name;}
private:
boost::shared_ptr _name;
};
And a multi_index set
typedef
boost::multi_index_container<
Object,
…

user14416
- 2,922
- 5
- 40
- 67
3
votes
2 answers
clearing a multi_index_container
There is a class in my code (not my code) which uses boost multi_index_container
template
class foo_map {
typedef MapEntry_T MapEntry;
typedef multi_index_container
< MapEntry
, indexed_by
<…

mahmood
- 23,197
- 49
- 147
- 242
3
votes
1 answer
boost multi_index modifying member and retain sequence
I'm working with boost::multi_index container. Basically it consists of some data plus the information if the data set information are complete (when an item is added to the container, information are not completed yet). The container is sequenced…

user1669298
- 31
- 1
3
votes
2 answers
Multiple lookup set
I need a data structure, and I'm unsure of what to choose. Fundamentally, my need is similar to std::set, except I need to look up according to multiple different comparators over the same data at the same time.
Right now I've decided to go for some…

Puppy
- 144,682
- 38
- 256
- 465
2
votes
1 answer
equal_range on one key, lower/upper bound on another in boost multi_index_container composite_key
Suppose I have the following:
struct Person
{
std::string mName;
Birthday mBirthday;
};
using namespace boost::mult_index;
typedef multi_index_container<
Person,
ordered_non_unique<
composite_key<
Person,
…

impulsionaudio
- 219
- 2
- 7
2
votes
1 answer
Analogue of `std::pair` with mutable members?
I am implementing analogue of std::map called expiring_map which is based on boost::multi_index::multi_index_container. Idea is simple: when there is new insert to the expiring_map there will be check up for expired elements and removal if they are…

SherAndrei
- 528
- 3
- 14
2
votes
1 answer
shared_ptr as index for boost::multi_index
Is it possible and how to use std::shared_ptr implicitly as index for boost::multi_index_container?
This code
struct Item
{
std::shared_ptr shared_id;
};
using ItemsIndexed = boost::multi_index_container<
Item,
…

uni
- 539
- 1
- 9
- 21
2
votes
1 answer
accessing boost multi index container context with multiple keys like pair/tuple of arguments
#include
#include
#include
#include
#include
#include…

Raghavendra
- 39
- 4
2
votes
1 answer
How to find all elements with the same key value in a boost::multi_index_container
After building a boost multi_index_container I would like to visit all elements with the same key value. The following code gives the basic idea of what is expected:
#include
#include
#include…

roy.atlas
- 411
- 2
- 8
2
votes
1 answer
How to perform equal_range on one key and lower_bound on the second key of a composite keyed boost multi-index container?
Let say I have a class to hold the sensor measurements, and I created a boost multi-index container with composite key of time and id of each measurement:
namespace {
struct ValueUpdateMsg {
double value;
uint64_t time;
…

motam79
- 3,542
- 5
- 34
- 60
2
votes
1 answer
Boost:Multi-index: How to iterate over all results matching a non-unique ordered index?
I have a Boost multi-index container for storing MyClass members. It has a unique (first_field) and non-unique (second field) indices:
typedef multi_index_container<
MyClass,
indexed_by<
ordered_unique

motam79
- 3,542
- 5
- 34
- 60
2
votes
2 answers
Find boost multi index Tag to index and number of indices
I have a template class(CrMultiIndex) that receive as template parameter a definition of boost multi index(GlobalHash).
I need :
To add statistics to my template class according to Index used.
So i need a way to resize the vector(m_StatsByIndex) at…

yaron
- 439
- 6
- 16
2
votes
1 answer
Boost multi index private members access
I have a struct
struct employee
{
int id;
std::string name;
employee(int id,const std::string& name):id(id),name(name){}
bool operator<(const employee& e)const{return id

Demaunt
- 1,183
- 2
- 16
- 26
2
votes
1 answer
How does boost::multi_index work with member functions?
If I have a boost::multi_index as follows,
typedef multi_index_container<
employee,
indexed_by<
hashed_unique >,
hashed_unique…

codeworks
- 149
- 1
- 15
2
votes
2 answers
Container template parameter std::map or std::vector
In one of my projects I'm using a tree implementation, where I used the container
C=std::map to maintain a list of children for each tree node. Each tree node has a unique name key K being normally a std::string.
template

Aleph0
- 5,816
- 4
- 29
- 80