Answer the question
In order to leave comments, you need to log in
Is it possible to serialize class objects that do not have a serialize method?
Hello! I used the serialization of the boost library and when trying to serialize an object of the class "boost::asio::ip::tcp::endpoint" I got an error: "The class ... does not have a serialize method". I had a question, is it possible to serialize an object that does not contain this method through boost, if not, what good libraries for serialization / de-serialization exist.
Answer the question
In order to leave comments, you need to log in
Well, a simple example:
typedef struct {
char* name;
} MyStruct;
void serialize(ostream& os, const MyStruct& obj)
{
char* p = (char*) obj;
for (int n = 0; n != sizeof(MyStruct); ++n)
os << *p;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question