I am trying to write a XML serializer and de-serializer for user defined classes. Please refer to the code posted in Coliru
The deserializer i am unable to get the type resolved from the adt_proxy to the value type in question. The error is the read_handle function. Can anyone tell me what I am missing here ?
static inline void read_handle(FusionVisitorConcept& visitor, S& s)
{
visitor.start_member(name_t::call());
VisitorApplication<FusionVisitorConcept, current_t>::read_handle(visitor, boost::fusion::at<N>(s));
visitor.finish_member(name_t::call());
members_impl<FusionVisitorConcept, S, next_t>::read_handle(visitor, s);
}
Indeed the ADT proxies are ruining the party here. It's the Law of Leaky Abstractions.
In particular, you can't deserialize a
boost::lazy_disable_if_c<false, boost::fusion::result_of::at<Bar, mpl_::int_<0> > >::type
. Now, if you replacewith
It works. There's a side-effect though: now
current_t
needs to be default-constructible.Here's the fully working sample
Live On Coliru
Output: