test_polymorphic2.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  2. // test_polymorphic2.hpp
  3. // (C) Copyright 2009 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. // should pass compilation and execution
  8. namespace boost {
  9. namespace archive {
  10. class polymorphic_oarchive;
  11. class polymorphic_iarchive;
  12. }
  13. }
  14. struct A {
  15. public:
  16. A() {}
  17. virtual ~A() {}
  18. void serialize(
  19. boost::archive::polymorphic_oarchive &ar,
  20. const unsigned int /*version*/
  21. );
  22. void serialize(
  23. boost::archive::polymorphic_iarchive &ar,
  24. const unsigned int /*version*/
  25. );
  26. int i;
  27. };
  28. struct B : A {
  29. void serialize(
  30. boost::archive::polymorphic_oarchive &ar,
  31. const unsigned int /*version*/
  32. );
  33. void serialize(
  34. boost::archive::polymorphic_iarchive &ar,
  35. const unsigned int /*version*/
  36. );
  37. };