--- a/boost/function/function_template.hpp +++ b/boost/function/function_template.hpp @@ -895,7 +895,7 @@ namespace boost { if (!f.empty()) { this->vtable = f.vtable; if (this->has_trivial_copy_and_destroy()) - this->functor = f.functor; + std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer)); else get_vtable()->base.manager(f.functor, this->functor, boost::detail::function::clone_functor_tag); @@ -983,7 +983,7 @@ namespace boost { if (!f.empty()) { this->vtable = f.vtable; if (this->has_trivial_copy_and_destroy()) - this->functor = f.functor; + std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer)); else get_vtable()->base.manager(f.functor, this->functor, boost::detail::function::move_functor_tag);