Advertisement
Guest User

Boost.Serialization sample code

a guest
Dec 4th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <boost/serialization/serialization.hpp>
  2. #include <boost/archive/xml_oarchive.hpp>
  3.  
  4. #include <sstream>
  5.  
  6. class my_archive
  7.     : public boost::archive::xml_oarchive_impl<my_archive>
  8. {
  9. public:
  10.  
  11.     typedef boost::archive::xml_oarchive_impl<my_archive> base_type;
  12.  
  13.     my_archive( std::ostream &first )
  14.         : base_type(first, 0)
  15.     { }
  16. };
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20.     {
  21.         std::stringstream first_str;
  22.         std::stringstream second_str;
  23.         my_archive w(first_str);
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement