Boost.Bimap is a bidirectional maps library for C++.
Questions tagged [boost-bimap]
38 questions
1
vote
1 answer
Boost bimap find with multiset_of
I have question with Boost::bimap and could not find answer from boost document.
using AToBBimap = boost::bimap< boost::bimaps::unordered_set_of, boost::bimaps::multiset_of >; //hashed bimap
using AToBBimapValueT = AToBBimap…

Bing Lan
- 1,121
- 1
- 13
- 26
1
vote
2 answers
Is it possible to override "find" and "erase" methods of boost::bimaps::bimap.left? How to do it?
I have following:
struct foo_and_number_helper {
std::string foo;
uint64_t number;
};
struct foo_and_number {};
struct bar {};
using my_bimap = boost::bimaps::bimap<
…

Lukas Salich
- 959
- 2
- 12
- 30
1
vote
2 answers
Finding an element in boost::bimaps::bimap by different type than bimap key type
I have the following code:
#include
#include
#include
using namespace boost::bimaps;
using namespace boost;
struct Example
{
uint64_t id;
};
struct ExampleHash
{
…

AndyB
- 490
- 1
- 4
- 7
1
vote
1 answer
Insert into an unordered boost bimap using TBB
I am very much confused with respect to TBB. I am trying to insert pair in an unordered bimap, where the key is of type uint64_t and value is of type string. I made an attempt to create the loop object, which is in TBB.h file, and looks…

AwaitedOne
- 992
- 3
- 19
- 42
1
vote
1 answer
Create, access, store and load boost::bimap in an efficient way
In continuation with my earlier question to serialize bitsets to avoid creating bimap repeatedly on the same data, so save the bimap and load when needed.
I have chosen boost::bimap to store data (in bitsets) in pair due to the reason…

AwaitedOne
- 992
- 3
- 19
- 42
1
vote
0 answers
What can be the maximum number of entries in boost bimap
I am trying to create a boost bimap of total 177 million entries.I created a boost bimap
namespace bimaps = boost::bimaps;
typedef boost::bimap,
bimaps::unordered_multiset_of

AwaitedOne
- 992
- 3
- 19
- 42
1
vote
1 answer
Add values to a multiset in a boost::bimap
I wanted to use a multimap version of a boost::bimap and I am following this,
Boost::Bimap equivalent of bidirectional multimap
This shows how to add and retrieve values in the structure. I am trying to look up based on a value on the right that…

s_s
- 101
- 9
1
vote
1 answer
How to make two or more elements in bimap as key
I would like to know if it is possible to insert two or more elements in bimap as key. I have a minimal example of bimap with one element key
#include
#include
#include
#include…

AwaitedOne
- 992
- 3
- 19
- 42
1
vote
0 answers
Is there something of type Multidimensional Bidirectional Multimap
Everything was going fine till I had one dimensional data, where I used Bidirectional Multimap like
typedef boost::bimap, bimaps::set_of> bimap_one_d;
typedef bimap_one_d::value_type value_type;
bimap_one_d bimap;
My…

Agaz Wani
- 5,514
- 8
- 42
- 62
1
vote
0 answers
boost bimap with second type as a list, flattening right map view
I recently saw that boost has a bidirectional map implementation named bimap.
My initial STL map was using the following 2 types:
int as the key type
std::weak_ptr as the value type (let's call it X)
Scenario 1
To create a bimap with these…

danimihalca
- 43
- 5
1
vote
1 answer
Intersection between various values from boost::bimap
I am trying to use boost::bimap for one of my requirements. Below is sample code
typedef bimap<
multiset_of< string >,
multiset_of< string >,
set_of_relation<>
> bm_type;
bm_type bm;
assign::insert( bm )
(…

Blackhole
- 273
- 2
- 12
1
vote
0 answers
Retrieve key from a value using boost::associative property map defined over boost::bimap
Sorry for asking another question here, I should have been more clearer about my intentions for using boost::bimaps.
My key, value pairs are both unique here. so i want to fill bimap using a key, value. and retrieve a key using a value.
With…

Pogo
- 475
- 3
- 19
1
vote
1 answer
Error using unordered_set_of with Boost.Bimap
I'm attempting to follow this example from the documentation (see typedef for word_counter).
#include
#include
#include
typedef boost::bimap
<
boost::bimap::unordered_set_of<…

onezeno
- 764
- 1
- 10
- 21
0
votes
0 answers
Can't compile using boost::bimap
I am having trouble turning this into a boost::bimap. It won't compile:
I change:
using MapStudentItemDesc = std::map;
to
using MapStudentItemDesc = boost::bimap;
And then I declared the map like…

Andrew Truckle
- 17,769
- 16
- 66
- 164
0
votes
1 answer
Is there a way to force every element of a (multiset_of,multiset_of) boost::bimap to be unique?
I have a multi set Bimap that looks like:
6 <--> 71
6 <--> 71
6 <--> 71
8 <--> 71
8 <--> 71
10 <--> 71
10 <--> 74
element = left key + right key, or a row in the above block
I would like to remove the elements where the lines are equivalent to…

Jordan Palmer
- 1
- 1