test_polymorphic_A.hpp 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  2. // test_polymorphic_A.hpp
  3. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  4. // Use, modification and distribution is subject to the Boost Software
  5. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // class whose declaration is hidden by a pointer
  8. // #include <boost/serialization/scoped_ptr.hpp>
  9. #include <boost/archive/polymorphic_oarchive.hpp>
  10. #include <boost/archive/polymorphic_iarchive.hpp>
  11. class A;
  12. struct data {
  13. // class a contains a pointer to a "hidden" declaration
  14. // borland scoped_ptr doesn't work !!!
  15. // boost::scoped_ptr<A> a;
  16. A * a;
  17. // template<class Archive>
  18. // void serialize(Archive & ar, const unsigned int file_version);
  19. void serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int file_version);
  20. void serialize(boost::archive::polymorphic_iarchive & ar, const unsigned int file_version);
  21. data();
  22. ~data();
  23. bool operator==(const data & rhs) const;
  24. };