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

How to improve readability of multi_index_container for programmers not used to it?

I created a multi-index container with 3 non-unique, non-ordered keys looking like following: namespace bmi = boost::multi_index; class SurveyRepository { // some other code using SurveyCodeContainer = boost::multi_index_container< …
Lukas Salich
  • 959
  • 2
  • 12
  • 30
0
votes
1 answer

In a boost multi_index container, is a "default index" defined?

Here is a container of ints with a sequence index and a hashed index: #include #include #include #include #include…
John H.
  • 1,551
  • 1
  • 12
  • 18
0
votes
1 answer

How to implement Boost::Serialize for Boost::Nested_Container

(Followup of another question.) Boost::Serialize often delivers an exception on oarchive, complaining that re-creating a particular object would result in duplicate objects. Some archives save and re-load successfully, but many result in the error…
0
votes
2 answers

how to use reset with const shared pointer to non const object?

I am trying to reset shared pointer which is member of struct coming from iterator of container with constant structs"elements". the code does not compile, with error: cannot convert 'this' pointer from 'const…
ahmed allam
  • 377
  • 2
  • 15
0
votes
2 answers

how to make modifier for a multiindex of struct having shared pointer to boost logger backend to reset this back end?

I am trying to modify multiindex of structs ,struct has member which is shared pointer to boost logger shared pointer of backend ,frontend and logger. By nature of multiindex each struct is considered const when making iterator . So when i take…
ahmed allam
  • 377
  • 2
  • 15
0
votes
1 answer

Why does Boost multi_index perform a comparison on the second index when only modifying the key of the first?

The following code using Boost 1.72.0: #include #include #include #include #include struct Foo { int intProp_; …
D. Jurcau
  • 190
  • 6
0
votes
1 answer

how to get unique values of certain index field of ordered non unique boost multi index set

i made boost multi index set of several indices most of them are ordered non unique. now i need to make for loop over the set using iterator for ordered non unique index but i need to skip the structs with same non unique value. in other words i…
ahmed allam
  • 377
  • 2
  • 15
0
votes
1 answer

boost::multi_index using custom key extractor syntax question?

I am applying example 6 of boost multi_index examples. https://www.boost.org/doc/libs/1_71_0/libs/multi_index/doc/examples.html#example6 I am still learning the syntax of key extraction.i find that member key extractor require for its third…
ahmed allam
  • 377
  • 2
  • 15
0
votes
1 answer

Boost::Multi-index for nested lists

How to implement Boost::Multi-index on a list of lists I have a hierarchical tree as follows: typedef std::list objList // the object list typedef std::list topLevelList // the list of top-level object lists struct obj { int…
0
votes
1 answer

Boost::Multi_Index running totals

Firstly, sorry about the poor formatting, I am new and know I did not make it pretty. I am implementing a system to keep track of orders which I am storing as blocks, and I haven't gained the experience with templates to fully understand the…
0
votes
1 answer

How to insert value into c++ boost::multiindex collection at specific index like in std::list

In boost::multi_index I try to insert value at specific location, how ever I did not find any example how to accomplish this task in boost documentation https://www.boost.org/doc/libs/1_59_0/libs/multi_index/doc/tutorial/indices.html or…
Fataho
  • 99
  • 3
  • 15
0
votes
1 answer

Unable to remove element from boost multi_index_container++

Building on CentOS 7, g++ 4.8.5-28. Language standard: C++03 Working sample: https://godbolt.org/z/ijSFrK In the method RemoveMapping, the call to mapDb.erase(clientIter); is failing (see sample code in link for the actual code and the compile…
Jon
  • 1,675
  • 26
  • 57
0
votes
1 answer

boost multi_index_container not compiling

Trying to follow the boost docs on the usage of this, but am running into a snag. Building on CentOS 7, g++ 4.8.5-28. Language standard: C++03 Working sample: https://godbolt.org/z/KPvjS_ My Code: #include #include…
Jon
  • 1,675
  • 26
  • 57
0
votes
1 answer

Can't understand multi_index

class ObjectStorage { private: std::string objName; int zIndex; // Reference for the Object interface boost::shared_ptr mCppObject; // Reference for the Python interface …
Max Frai
  • 61,946
  • 78
  • 197
  • 306
0
votes
1 answer

Getting values not equals x in boost's multi_index_container

I'm trying to get a iterator to all values that are not equal a certain value in boost::multi_index_container. The index I want to access is a hashed_non_unique integer. Using equal_range(0) on my container which serves as a mapping database, I'm…
Niklas
  • 102
  • 10