Hi,
I have defined a recursive variant type like this:
---
typedef boost::make_recursive_variant,
std::map,
TGrey8Image,
TRgbImage,
TRgbaImage>::type TVType;
---
and two containers which can store this type:
---
typedef std::vector<TVType> TVector;
typedef std::map TMap;
---
I wrote a set of unit-tests testing all types of plain and recursive
containers and they work as expected.
I also tested (de-)serialization to a binary archive and there's also no
problem.
Then I implemented a Message class which contains such a TVType + some other
stuff. Serializing and deserializing also works in the tests.
Finally I implemented a client and server with ASIO like the
ASIO "serialization" example. First sending the size of the archive and
then the data itself. The sending works but when I want to deserialize my
message I get the following assertion:
---
testSerialization: /usr/include/boost/variant/detail/visitation_impl.hpp:203:
typename Visitor::result_type boost::detail::variant::visitation_impl(int,
int, Visitor&, VPCV, mpl_::true_, NBF, W*, S*) [with W = mpl_::int_<20>, S
=
boost::detail::variant::visitation_impl_stepboost::mpl::l_end,
boost::mpl::l_iterboost::mpl::l_end >, Visitor =
boost::detail::variant::invoke_visitor, VPCV = void*, NBF =
boost::variant,
std::vectorboost::recursive_variant_ >,
std::map, boost::recursive_variant_,
std::less >, std::allocator,
boost::recursive_variant_> > >, CIS::Image2d<unsigned char>,
CIS::Image2dCIS::RGB, CIS::Image2dCIS::RGBA,
boost::detail::variant::void_, boost::detail::variant::void_,
boost::detail::variant::void_, boost::detail::variant::void_,
boost::detail::variant::void_, boost::detail::variant::void_,
boost::detail::variant::void_, boost::detail::variant::void_,
boost::detail::variant::void_, boost::detail::variant::void_,
boost::detail::variant::void_>::has_fallback_type_]: Assertion `false'
failed.
---
I absolutely don't know what't wrong here the backtrace iss huge but the
point in my code where it happens is the line when deserializing the
message. When I comment out the TVType payload of the message, it works.
I would really appreciate any clue.
Greetings,
Falco