bimap
#include <iostream>
#include <boost/assign.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/bimap.hpp>
using namespace std;
using namespace boost;
int main()
{
bimap<int, string>bm;
bm.left.insert(make_pair(1,"111"));
bm.left.insert(make_pair(2,"222"));
bm.right.insert(make_pair("333",3));
bm.right.insert(make_pair("444",4));
for (BOOST_AUTO(pos, bm.left.begin()); pos != bm.left.end(); ++pos)
{
cout << pos->first << "-" << pos->second << endl;
}
bimap<int, string>bm1;
typedef bimap<int, string>::value_type vt;
bm1.insert(vt(3,"3333"));
for (BOOST_AUTO(pos, bm1.left.begin()); pos != bm1.left.end(); ++pos)
{
cout << pos->first << "-" << pos->second << endl;
}
return 0;
}