--- multi_index_container.hpp Sat Jul 24 05:20:30 2010 +++ multi_index_container_patch.hpp Thu Nov 4 12:53:36 2010 @@ -62,6 +62,10 @@ #define BOOST_MULTI_INDEX_CHECK_INVARIANT #endif +#if !defined(BOOST_NO_INITIALIZER_LISTS) +#include +#endif + namespace boost{ namespace multi_index{ @@ -125,6 +129,24 @@ typedef typename super::index_type_list super_index_type_list; #endif + template + void iterator_initialize(InputIterator first,InputIterator last) + { + BOOST_MULTI_INDEX_CHECK_INVARIANT; + BOOST_TRY{ + iterator hint=super::end(); + for(;first!=last;++first){ + hint=super::make_iterator(insert_(*first,hint.get_node()).first); + } + } + BOOST_CATCH(...){ + clear_(); + BOOST_RETHROW; + } + BOOST_CATCH_END + } + + public: /* All types are inherited from super, a few are explicitly * brought forward here to save us some typename's. @@ -228,19 +250,25 @@ super(args_list,bfm_allocator::member), node_count(0) { - BOOST_MULTI_INDEX_CHECK_INVARIANT; - BOOST_TRY{ - iterator hint=super::end(); - for(;first!=last;++first){ - hint=super::make_iterator(insert_(*first,hint.get_node()).first); - } - } - BOOST_CATCH(...){ - clear_(); - BOOST_RETHROW; - } - BOOST_CATCH_END + iterator_initialize(first, last); + } + +#if !defined(BOOST_NO_INITIALIZER_LISTS) + template + multi_index_container(std::initializer_list init): +#if BOOST_WORKAROUND(__IBMCPP__,<=600) + bfm_allocator(typename mpl::identity::type::allocator_type()), + super(typename mpl::identity::type::ctor_args_list(), + bfm_allocator::member), +#else + bfm_allocator(allocator_type()), + super(ctor_args_list(),bfm_allocator::member), +#endif + node_count(0) + { + iterator_initialize(init.begin(), init.end()); } +#endif multi_index_container( const multi_index_container& x):