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