//Purpose: // Demonstrate the EBCO problem mentioned here: // http://lists.boost.org/boost-users/2008/09/40552.php //Result: // Problem doesn't occur with gcc snapshot: // ftp://gcc.gnu.org/pub/gcc/snapshots/4.4-20090519/gcc-4.4-20090519.tar.bz2 // #include #include #include #include #include #include #include #include namespace boost{namespace mpl{ template < typename T , typename Container , unsigned Count=0 > struct back_insert_repeat /**@brief * back_insert T on Container for Count times. */ { // create a sequence of 5 elements typedef boost::mpl::range_c range; // convert all the elements to T and make the result a Container. typedef typename boost::mpl::transform, boost::mpl::back_inserter >::type type; }; }} int main() { unsigned const count=2; typedef boost::mpl::back_insert_repeat,count>::type float_container_type; float_container_type float_container_valu; std::size_t size_float=sizeof(float); std::cout << typeid(float_container_type).name() << std::endl; std::cout << "count*sizeof(float)="<