The problem is that boost::mpl::clear<>
not implemented for joint_view
... so a huge compiler dump is completed with:
/usr/local/include/boost/mpl/clear.hpp:29:7: error: implicit instantiation of undefined template 'boost::mpl::clear_impl<boost::mpl::aux::joint_view_tag>::apply<boost::mpl::joint_view<boost::mpl::list<InternalType1, InternalType2, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::mpl::list<LocalType1, LocalType2, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na> > >'
(I do not know how to format it correctly)
It may simply be an oversight in the library, or it is simply not clear which empty sequence type should be returned in this case. If you want to use joint_view
, you will need to specify the clear_impl
specialization somewhere:
namespace boost { namespace mpl { template <> struct clear_impl<aux::joint_view_tag> { template <typename JV> struct apply { typedef list<> type;
At the same time, your code compiles for me for both gcc and clang.
Alternatively, if adding stuff to namespace boost::mpl
hits you like a little shady, but you still want to stick to list
s, you can simply use insert_range
:
typename boost::make_variant_over< typename boost::mpl::insert_range< Types, typename boost::mpl::end<Types>::type, LocalTypes >::type >::type container_;