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
0
votes
1 answer
describe boost multi_index iterator type by its index tag
Using boost multi-index, I happen to have the following type for the iterator:
multi_index_set::nth_index<2>::type::iterator
I'd like go get rid of the nth_index<2> part of the type and refer to it via its index…

Gurg Hackpof
- 1,304
- 1
- 13
- 26
0
votes
1 answer
boost::multi_index::composite_key_result, how to get the char* that make up the composite_key?
For below code:
struct MyStruct
{
char* firstName;
char* secondName;
int age;
};
typedef composite_key

Michael
- 673
- 2
- 5
- 23
0
votes
1 answer
boost.multiindex and addres of value as key
I have a struct:
struct user_context {
struct user_id;
struct user_name;
struct user_address;
boost::int64_t user_id() const;
const std::string& user_name() const;
};
I want to use boost.multiindex with three indexes: 1)user_id,…

niXman
- 1,698
- 3
- 16
- 40
0
votes
1 answer
Boost.MultiIndex template substitution failure?
I'm attempting to use boost::multi_index_container and it seems to be choking on the template metaprogramming magic somewhere. I'm getting a massive error dump ending in:
/opt/local/include/boost/multi_index/hashed_index.hpp:743:9: error:
‘class
…

fredbaba
- 1,466
- 1
- 15
- 26
0
votes
1 answer
error: ‘template’ (as a disambiguator) is only allowed within templates
I have following definitions:
typedef boost::multi_index_container<
ModelPtr,
boost::multi_index::indexed_by<
boost::multi_index::sequenced >, // to keep order of inserting
…

user2301299
- 529
- 1
- 5
- 15
0
votes
1 answer
boost multi index container, class with pure virtual functions
I want to create multi_index_container with type A storing objects of type C, which is derived from B which is derived from A. Problem is that in A I have pure virtual function. When I try to compile it, I got errors which are described at the very…

jaor
- 831
- 7
- 18
0
votes
1 answer
Trouble defining multi_index_container ordered_non_unique
I'm playing around with some boost containers, but I recently came a blockade as I can't seem to define multi_index_container correctly. I'm following an example i grabbed offline but it still gives me and error message:
struct…

Syntactic Fructose
- 18,936
- 23
- 91
- 177
0
votes
1 answer
boost multi_index hashed_unique vs unordered_map lookup performance
Are the look-up performances for boost::unordered_map's and boost::multi_index containers (with a hashed unique index) the same. I imagine that in boost::multi_index containers you have to do two look-ups: firstly, in a table that represents the…

user809409
- 491
- 7
- 10
0
votes
1 answer
C++ Index ordering issue with Boost MultiIndex as an LRU cache
I have the following LRU implementation made using Boost.MultiIndex bashed on this example.
The problem is when I change the ordering of the index_by section (and update the enum index_idx accordingly) I get an error on the line that…

Soda Coader
- 101
- 12
0
votes
2 answers
Erase element per key from multi_index_container with composite_key
I have a multi_index_container with an index that is a composite_key.
But I can not find a way to erase an element by its key.
Please see below:
#include
#include
#include…

Jörg Richter
- 21
- 5
0
votes
1 answer
boost multi index insertion errors with boost::tuple of references as the key for a ordered_unique index
I have boiled this down to the simplest example code I could think of.
I have a boost multi indexed by a member:
typedef const boost::tuple key_type;
Doing this seems make the multi-index think every item is equal…

user442585
- 571
- 1
- 9
- 17
0
votes
1 answer
Why boost-multi-index gives back a wrong iterator?
Boost documents said that iterator_to gives back a valid iterator but the code below shows that something other happens.
All indices of Boost.MultiIndex provide a member function called
iterator_to which returns an iterator to a given element of…

Industrial-antidepressant
- 2,266
- 17
- 29
0
votes
2 answers
How to create a tree using boost multi index container
I'm trying to create a tree. My very first requirement is that the objects within a tree level are ordered by its insertion order.
As a first attempt I used stl vector class:
#include
#include
#include
class…

Patxitron
- 435
- 4
- 8
0
votes
1 answer
boost multi index for a fixed sized multi-indexed polymorphic container
Still digging into C++/boost so any comments/feedback are welcome.
I was playing with boost::unordered_maps and created a polymorphic example using shapes, about the time I had my head
wrapped around that (mostly) I stumbled across the mru example…

user442585
- 571
- 1
- 9
- 17
0
votes
2 answers
const confusion in C++ when returning a boost multi_index interface
I have a problem in const manipulation of my variables. I have simplified the problem into the following program:
#include
#include
#include
#include
#include…

rahman
- 4,820
- 16
- 52
- 86