#define _CRT_SECURE_NO_DEPRECATE
#define _SCL_SECURE_NO_DEPRECATE
#include <boost/config.hpp>
#include <sstream>
#include <algorithm>
#include <set>
#include <boost/assign/list_of.hpp>
#include <boost/assign/list_inserter.hpp>
#include <boost/bimap/list_of.hpp>
#include <boost/bimap/unordered_multiset_of.hpp>
#include <boost/bimap/vector_of.hpp>
#include <boost/bimap/bimap.hpp>
namespace ba = boost::assign;
void test_bimap_assign()
{
using namespace boost::bimaps;
{
typedef bimap< list_of<int>, double > bm_type;
bm_type bm = ba::list_of< bm_type::relation >(1,0.1)(2,0.2)(3,0.3);
ba::push_back( bm )(4,0.4)(5,0.5);
ba::insert( bm.right )(0.5,5)(0.6,6);
ba::push_back( bm.left )(6,0.6)(7,0.7);
}
{
typedef bimap< unordered_multiset_of<int>, vector_of<double>,
list_of_relation > bm_type;
bm_type bm = ba::list_of< bm_type::relation >(1,0.1)(2,0.2)(3,0.3);
ba::push_front( bm )(4,0.4)(5,0.5);
ba::push_back( bm.right )(0.6,6)(0.7,7);
ba::insert( bm.left )(8,0.8)(9,0.9);
}
{
typedef bimap< int, vector_of<double>, right_based > bm_type;
bm_type bm = ba::list_of< bm_type::relation >(1,0.1)(2,0.2)(3,0.3);
ba::push_back( bm )(4,0.4)(5,0.5);
ba::push_back( bm.right )(0.6,6)(0.7,7);
ba::insert( bm.left )(8,0.8)(9,0.9);
}
{
typedef bimap< int, vector_of<double>, set_of_relation<> > bm_type;
bm_type bm = ba::list_of< bm_type::relation >(1,0.1)(2,0.2)(3,0.3);
ba::insert( bm )(4,0.4)(5,0.5);
ba::push_back( bm.right )(0.6,6)(0.7,7);
ba::insert( bm.left )(8,0.8)(9,0.9);
}
}
int main()
{
test_bimap_assign();
return 0;
}