Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/serialization/test/test_not_serializable.cpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.1 KB
Line 
1/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2// test_non_serializable.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// test implementation level "not_serializable"
10// should fail compilation
11
12#include <fstream>
13
14#include "test_tools.hpp"
15#include <boost/preprocessor/stringize.hpp>
16#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST)
17#include <boost/serialization/level.hpp>
18#include <boost/serialization/nvp.hpp>
19
20class A
21{
22};
23
24BOOST_CLASS_IMPLEMENTATION(A, boost::serialization::not_serializable)
25
26void out(A & a)
27{
28    test_ostream os("testfile", TEST_STREAM_FLAGS);
29    test_oarchive oa(os);
30    oa << BOOST_SERIALIZATION_NVP(a);
31}
32
33void in(A & a)
34{
35    test_istream is("testfile", TEST_STREAM_FLAGS);
36    test_iarchive ia(is);
37    ia >> BOOST_SERIALIZATION_NVP(a);
38}
39
40int
41test_main( int /* argc */, char* /* argv */[] )
42{
43    A a;
44    out(a);
45    in(a);
46    return EXIT_SUCCESS;
47}
48
49// EOF
Note: See TracBrowser for help on using the repository browser.