All pastes #630487 Raw Edit

Someone

public text v1 · immutable
·published 2007-07-23 07:44 UTC
rendered paste body
//creation of the archive

std::stringbuf stream;
std::ostream dataStream(&stream);
boost::archive::binary_oarchive ba(dataStream);
ba << (const ClassToSend)  m_class;

//then i send it over network

//then i try to recreate the class

ClassSomething c(0,0,0);
std::stringbuf stream(ios_base::in | ios_base::out);
std::streamsize ret = stream.sputn((char*) body, size);
std::istream dataStream(&stream);
boost::archive::binary_iarchive ba(dataStream);
ba >> c;