test_traits_fail.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  2. // test_traits_fail.cpp: test implementation level trait
  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. // compile test for traits
  8. #include "test_tools.hpp"
  9. #include <boost/serialization/level.hpp>
  10. #include <boost/serialization/version.hpp>
  11. class A
  12. {
  13. };
  14. BOOST_CLASS_IMPLEMENTATION(A, boost::serialization::not_serializable)
  15. // It can make no sense to assign a version number to a class that
  16. // is not serialized with class information
  17. BOOST_CLASS_VERSION(A, 2) // should fail during compile
  18. // It can make no sense to assign tracking behavior to a class that
  19. // is not serializable. Should fail during compile.
  20. BOOST_CLASS_TRACKING(A, boost::serialization::track_never)
  21. class B
  22. {
  23. };
  24. BOOST_CLASS_IMPLEMENTATION(B, boost::serialization::object_class_info)
  25. BOOST_CLASS_VERSION(B, 2)
  26. BOOST_CLASS_TRACKING(B, boost::serialization::track_always)
  27. int
  28. test_main( int /* argc */, char* /* argv */[] )
  29. {
  30. return EXIT_SUCCESS;
  31. }
  32. // EOF