id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13405,Tree-based containers have troubles with move-only types.,Mikhail Kremniov ,Ion Gaztañaga,"Specifically, move assignment doesn't work. E.g. test.cpp: {{{ #include #include int main() { boost::container::set> set1, set2; set2 = std::move(set1); } }}} Compiling with clang 5: {{{ $ clang++-5.0 ~/tmp/test.cpp -std=c++14 -o test -stdlib=libc++ -isystem ./boost_1_66_0 In file included from /home/brd/tmp/test.cpp:1: In file included from ./boost_1_66_0/boost/container/set.hpp:28: In file included from ./boost_1_66_0/boost/container/detail/tree.hpp:25: ./boost_1_66_0/boost/container/allocator_traits.hpp:415:51: error: call to implicitly-deleted copy constructor of 'std::__1::unique_ptr >' { ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); } ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./boost_1_66_0/boost/container/allocator_traits.hpp:360:28: note: in instantiation of function template specialization 'boost::container::allocator_traits >, void *, boost::container::tree_type_enum::red_black_tree, true> > >::priv_construct >, const std::__1::unique_ptr > &>' requested here allocator_traits::priv_construct(flag, a, p, ::boost::forward(args)...); ^ ./boost_1_66_0/boost/container/detail/node_alloc_holder.hpp:168:36: note: in instantiation of function template specialization 'boost::container::allocator_traits >, void *, boost::container::tree_type_enum::red_black_tree, true> > >::construct >, const std::__1::unique_ptr > &>' requested here allocator_traits::construct ^ ./boost_1_66_0/boost/container/detail/tree.hpp:389:26: note: in instantiation of function template specialization 'boost::container::container_detail::node_alloc_holder > >, boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void> >::create_node > &>' requested here return m_holder.create_node(other.m_data); ^ ./boost_1_66_0/boost/intrusive/detail/node_cloner_disposer.hpp:65:42: note: in instantiation of member function 'boost::container::container_detail::RecyclingCloner > >, boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void> >, true>::operator()' requested here node_ptr n = traits_->to_node_ptr(*base_t::get()(v)); ^ ./boost_1_66_0/boost/intrusive/rbtree_algorithms.hpp:59:20: note: in instantiation of member function 'boost::intrusive::detail::node_cloner > >, boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void> >, true>, boost::intrusive::bhtraits >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, boost::intrusive::algo_types::RbTreeAlgorithms, false>::operator()' requested here node_ptr n = base_t::get()(p); ^ ./boost_1_66_0/boost/intrusive/bstree_algorithms.hpp:1943:55: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) node_ptr insertion_point = target_sub_root = cloner(current); ^ ./boost_1_66_0/boost/intrusive/bstree.hpp:1040:27: note: in instantiation of function template specialization 'boost::intrusive::rbtree_algorithms >::clone > >, boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void> >, true>, boost::intrusive::bhtraits >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, boost::intrusive::algo_types::RbTreeAlgorithms, false>, boost::intrusive::detail::node_disposer >, void *, boost::container::tree_type_enum::red_black_tree, true> > >, boost::intrusive::bhtraits >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, boost::intrusive::algo_types::RbTreeAlgorithms> >' requested here node_algorithms::clone ^ ./boost_1_66_0/boost/intrusive/rbtree.hpp:240:18: note: in instantiation of function template specialization 'boost::intrusive::bstree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, boost::intrusive::algo_types::RbTreeAlgorithms, void>::clone_from > >, boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void> >, true>, boost::container::container_detail::allocator_destroyer >, void *, boost::container::tree_type_enum::red_black_tree, true> > > >' requested here { tree_type::clone_from(BOOST_MOVE_BASE(tree_type, src), cloner, disposer); } ^ ./boost_1_66_0/boost/container/detail/tree.hpp:759:24: note: in instantiation of function template specialization 'boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void>::clone_from > >, boost::intrusive::rbtree_impl >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::rbtree_node_traits, boost::intrusive::link_mode_type::normal_link, boost::intrusive::dft_tag, 3>, void, boost::container::value_to_node_compare >, void *, boost::container::tree_type_enum::red_black_tree, true>, boost::intrusive::tree_value_compare > *, std::__1::less > >, boost::move_detail::identity > >, true> >, unsigned long, true, void> >, true>, boost::container::container_detail::allocator_destroyer >, void *, boost::container::tree_type_enum::red_black_tree, true> > > >' requested here this->icont().clone_from ^ ./boost_1_66_0/boost/container/set.hpp:360:46: note: in instantiation of member function 'boost::container::container_detail::tree >, boost::move_detail::identity > >, std::__1::less > >, boost::container::new_allocator > >, boost::container::tree_opt >::operator=' requested here { return static_cast(this->base_t::operator=(BOOST_MOVE_BASE(base_t, x))); } ^ /home/brd/tmp/test.cpp:7:10: note: in instantiation of member function 'boost::container::set >, std::__1::less > >, boost::container::new_allocator > >, boost::container::tree_opt >::operator=' requested here set2 = std::move(set1); ^ /home/brd/soft/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/../include/c++/v1/memory:2388:3: note: copy constructor is implicitly deleted because 'unique_ptr >' has a user-declared move constructor unique_ptr(unique_ptr&& __u) noexcept ^ 1 error generated. }}}",Bugs,new,To Be Determined,container,Boost 1.66.0,Problem,,,