22 Aug
2010
22 Aug
'10
3:21 p.m.
Hello. I'm using boost.asio and trying to serialize a boost.variant, which is serializable because each of the fields I used in the variant have a serialize method required by boost.serialization library. I want to send my variant as binary data. This is not easy although I have a serialize method because this does not work: async_write(mysocket, boost::asio::buffer(myserializablevariant), when_done); I think all serializable types should be automatically usable as boost::asio::buffer, like std::vector, in this call. I think this shouldn't be too hard to implement, but I don't know how to serialize my data in binary format in a straight-forward way. Any ideas? Thanks in advance.