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