I want to access all the keys of a repeated element in bimap
. I have some example code below
#include <string>
#include <iostream>
#include <utility>
#include <boost/bimap.hpp>
#include <boost/bimap/set_of.hpp>
#include <boost/bimap/multiset_of.hpp>
namespace bimaps = boost::bimaps;
typedef boost::bimap<bimaps::set_of<unsigned long int>,
bimaps::multiset_of<unsigned long int > > bimap_reference;
typedef bimap_reference::value_type position;
bimap_reference numbers;
int main()
{
numbers.insert(position(123456, 100000));
numbers.insert(position(234567, 80000));
numbers.insert(position(345678, 100000));
numbers.insert(position(456789, 80000));
auto it = numbers.right.find(100000);
std::cout<<"numbers:"<<it->first<<"<->"<<it->second<<std::endl;
return 0;
}
In the above code I have repeated elements on right side. The above code give me the first key of the element 100000
, i,e 123456 <--> 100000
. But I have one more entry of the element 100000
, how to access all the keys of the repeated element (the element may be present multiple times with unique key on left side).