1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 2 // test_pimpl.cpp 3 4 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 5 // Use, modification and distribution is subject to the Boost Software 6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 9 // should pass compilation and execution 10 11 #include <boost/compatibility/cpp_c_headers/cstdio> // for tmpnam 12 13 #include <fstream> 14 #include <boost/serialization/nvp.hpp> 15 16 #include "test_tools.hpp" 17 18 class B; 19 20 class A { 21 friend boost::serialization::access; 22 B *pimpl; 23 template<class Archive> 24 void serialize(Archive & ar, const unsigned int file_version); 25 }; 26 test_main(int argc,char * argv[])27int test_main( int argc, char* argv[] ) 28 { 29 char testfile[TMP_MAX]; 30 std::tmpnam(testfile); 31 // BOOST_REQUIRE(NULL != testfile); 32 33 A a, a1; 34 { 35 test_ostream os(testfile, TEST_STREAM_FLAGS); 36 test_oarchive oa(os); 37 oa << BOOST_SERIALIZATION_NVP(a); 38 } 39 { 40 test_istream is(testfile, TEST_STREAM_FLAGS); 41 test_iarchive ia(is); 42 BOOST_SERIALIZATION_NVP(a1); 43 } 44 // BOOST_CHECK(a != a1); 45 return 0; 46 } 47 48 // EOF 49