//Purpose: // Demo the conversion using binding // #include #include #include #include #include #include #define BOOST_CHECK_EQUAL(X,Y) BOOST_ASSERT(X==Y) using namespace boost::type_erasure; template struct common : ::boost::mpl::vector< copy_constructible, typeid_ > {}; template < unsigned Tag > struct type_uns { void operator++(){} }; template < unsigned Tag > bool operator== ( type_uns const& , type_uns const& ) { return true; } void test() { typedef type_uns<0> src_concrete_t; typedef type_uns<1> dst_concrete_t; typedef ::boost::mpl::vector, incrementable<_a> > src_concept; typedef ::boost::mpl::vector > dst_concept; typedef ::boost::mpl::map > src_mmap; typedef ::boost::mpl::map > dst_mmap; static_binding src_smap=make_binding(); static_binding dst_smap=make_binding(); binding dst_binding(dst_smap); src_concrete_t src_concrete_v; any src_a( src_concrete_v, src_smap); BOOST_CHECK_EQUAL(any_cast(src_a), src_concrete_v); any dst_a( src_a, dst_binding); dst_concrete_t dst_concrete_v; BOOST_CHECK_EQUAL(any_cast(dst_a), dst_concrete_v); } int main() { test(); return 0; }