Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
multi bitmap
//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::multiset_of<int> > bimap_t; typedef bimap_t::value_type value_type; bimap_t bimap; bimap.insert(value_type(10, 2)); bimap.insert(value_type(1, 3)); bimap.insert(value_type(10, 1)); bimap.insert(value_type(1, 6)); bimap.insert(value_type(9, 20)); bimap.insert(value_type(1, 20)); bimap.insert(value_type(1, 30)); std::pair<bimap_t::left_const_iterator,bimap_t::left_const_iterator> il = bimap.left.equal_range(1); std::cout << "LEFT" << std::endl; for(bimap_t::left_const_iterator it = il.first; it != il.second; ++it) { std::cout << "Key = " << it->first << " Value = " << it->second << std::endl; } std::pair<bimap_t::right_const_iterator,bimap_t::right_const_iterator> ir = bimap.right.equal_range(20); std::cout << "RIGHT" << std::endl; for(bimap_t::right_const_iterator itr = ir.first; itr != ir.second; ++itr) { std::cout << "Key = " << itr->first << " Value = " << itr->second << std::endl; } }
run
|
edit
|
history
|
help
0
Test 4(2020)
Elevator 3
Ternary operator - warnings about unsued values
HelloWorldExample
ADP_campus
MyString
MY NEW
Hash(Prototipo)
TwoMax
Zahra_matrix