Search code examples
c++c++11boosttype-erasure

Boost.type erasure. Move only type


I am trying to use a move-only type in boost.type erasure library:

using any_move_only_object = boost::type_erasure::any<boost::mpl::vector<
   //my interface,
   //How can I say I want move only types here?>>

I cannot figure out how to make move-only types usable with the libraries and I couldn't find any documentation.

Is it even possible?

Regards


Solution

  • This is not possible, as boost/type_erasure/detail/storage.hpp defines storage without any non-const or moving constructors, and there do not seem to be any workarounds in the code.

    I would consider this a bug/misfeature, that should be reported/discussed on the Boost.Dev mailing list