#define _CRT_SECURE_NO_DEPRECATE
#define _SCL_SECURE_NO_DEPRECATE
#include <boost/config.hpp>
#include <string>
#include <iostream>
#include <map>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/unconstrained_set_of.hpp>
#include <boost/bimap/support/lambda.hpp>
using namespace boost::bimaps;
int main()
{
{
typedef bimap< std::string, unconstrained_set_of<int> > bm_type;
typedef bm_type::left_map map_type;
bm_type bm;
map_type & m = bm.left;
m["one"] = 1;
assert( m.find("one") != m.end() );
for( map_type::iterator i = m.begin(), iend = m.end(); i != iend; ++i )
{
++(i->second);
}
m.erase("one");
m["one"] = 1;
m["two"] = 2;
typedef map_type::const_iterator const_iterator;
typedef std::pair<const_iterator,const_iterator> const_range;
const_range r = m.range( "one" <= _key, _key <= "two" );
for( const_iterator i = r.first; i != r.second; ++i )
{
std::cout << i->first << "-->" << i->second << std::endl;
}
m.modify_key( m.begin(), _key = "1" );
}
{
typedef std::map< std::string, int > map_type;
map_type m;
}
return 0;
}