Skip to content
Snippets Groups Projects
Select Git revision
  • cmake
  • type-hash-in-header
  • master default protected
  • 0.3
  • 0.2
  • 0.1
6 results

1_stream_known.cpp

Blame
  • 1_stream_known.cpp 410 B
    
    #include <iostream>
    #include <sstream>
    #include <cassert>
    #include <tscpp.h>
    #include "types.h"
    
    using namespace std;
    using namespace tscpp;
    
    int main()
    {
        //Serialize to buffer
        Point3d p1(1,2,3);
        stringstream ss;
        OutputArchive oa(ss);
        oa<<p1;
        
        //Unserialize from buffer
        Point3d p2;
        InputArchive ia(ss);
        ia>>p2;
        assert(p1==p2);
        
        cout<<"Test passed"<<endl;
    }