id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11132,Boost.Variant's boost::recursive_wrapper missing noexcept specifier on move constructor,peterhuene@…,Antony Polukhin,"Using a sequence container of recursive variant, like std::vector, results in the variant type not being movable. Example: {{{ #include #include using namespace std; using namespace boost; struct foo { foo() = default; foo(foo&&) noexcept = default; foo(foo const&) = delete; }; int main() { typedef make_recursive_variant< foo, vector >::type variant_type; vector value; value.emplace_back(); variant_type other = std::move(value); } }}} This errors at the move assignment because variant_type is not movable. The reason it is not movable is because boost::recursive_wrapper's move constructor is not marked as noexcept, which is a requirement for vector to enable move semantics. Currently boost::recursive_wrapper's move constructor is not marked noexcept because it allocates a new T when being moved. I propose that boost::recursive_wrapper be changed to store a shared_ptr instead of T* so that, when moved, we move the shared_ptr, which is a noexcept operation. For the overload that constructs by T&&, we can leave as not specifying noexcept and construct with: {{{ _p(new T(detail::variant::move(operand))) }}} The copy semantics of boost::recursive_wrapper can be left as-is.",Bugs,closed,To Be Determined,variant,Boost 1.57.0,Problem,wontfix,,