id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13518,"Default constructor is explicit, no reason to be.",anonymous,Joaquín M López Muñoz,"See the follwing code {{{#!c++ #include #include #include using namespace std; struct aggregate { boost::multi_index_container a; }; int main() { using boost::multi_index_container; multi_index_container a; // default init // multi_index_container b(); // NOT A THING, not object init multi_index_container c = multi_index_container(); //value init + (elided) copy auto d = multi_index_container(); // value init + (elided) copy multi_index_container e{}; // direct-list-init, chooses value init auto f = multi_index_container{}; // direct-list-init, chooses value init // followed by elided copy multi_index_container g = {}; // ERROR // copy-list-init, should choose value init // but fails becase default constructor is explicit aggregate agg1{}; // ERROR for the same reason above aggregate agg2 = {}; // ERROR for the same reason above // Does aggregate init which does copy-list-init on members that // were not specified in the list. auto agg3 = aggregate(); //OK, value init multi_index_container h{1, 2, 3, 4}; // direct-list-init, chooses initializer list multi_index_container i = {1, 2, 3, 4}; // copy-list-init, chooses initializer list return 0; } }}} The problematic ctor is in line 175 of multi_index_container.hpp {{{#!c++ explicit multi_index_container( #if BOOST_WORKAROUND(__IBMCPP__,<=600) /* VisualAge seems to have an ETI issue with the default values * for arguments args_list and al. */ const ctor_args_list& args_list= typename mpl::identity::type:: ctor_args_list(), const allocator_type& al= typename mpl::identity::type:: allocator_type()): #else const ctor_args_list& args_list=ctor_args_list(), const allocator_type& al=allocator_type()): #endif bfm_allocator(al), super(args_list,bfm_allocator::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; } }}} Probably, it was made explicit for the case when it is called with non-default parameters.",Bugs,closed,To Be Determined,multi_index,Boost 1.66.0,Problem,fixed,,