Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Bimap operations
//bimap operations #include <boost/bimap.hpp> #include <boost/bimap/set_of.hpp> #include <boost/bimap/multiset_of.hpp> int main() { typedef boost::bimap<boost::bimaps::multiset_of<int>, boost::bimaps::set_of<int> > bimap_t; typedef bimap_t::value_type value_type; bimap_t bimap; bimap.insert(value_type(1, 1)); bimap.insert(value_type(10, 50)); bimap.insert(value_type(1, 2)); bimap.insert(value_type(9, 15)); std::pair<bimap_t::left_const_iterator,bimap_t::left_const_iterator> ii = bimap.left.equal_range(1); std::cout << "LEFT" << std::endl; for(bimap_t::left_const_iterator it = ii.first; it != ii.second; ++it) { std::cout << "Key = " << it->first << " Value = " << it->second << std::endl; } std::cout << "RIGHT" << std::endl; std::cout << "Key = " << 1 << " Value = " << bimap.right.at(1) << std::endl; }
run
|
edit
|
history
|
help
0
most Frequent word
Test 12(2021)
Dar
floyd alfa 1
Atul
combine c++ string with dynamically allocated c array of chars through overloaded add operator
Preference List
Counting top students
List add v2
Matrix spiral print