template <class T> inline void deserialize (const std::vector<char>& buffer, T& rhs) { try { namespace bio = boost::iostreams; rcontainer < std::vector<char>> device (buffer); bio::stream_buffer< std::vector<char>> stream(device); std::istream istream (&stream); boost::archive::binary_iarchive archive (istream); archive >> BOOST_SERIALIZATION_NVP(rhs); } catch (std::exception& ex) { std::cerr << ex.what() << std::endl; }
bio::stream_buffer< std::vector<char>> stream(device);