]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/serialization/test/test_polymorphic_A.cpp
1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // test_polymorphic_A.cpp
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)
9 #include "test_polymorphic_A.hpp"
10 #include <boost/serialization/nvp.hpp>
22 bool data::operator==(const data
& rhs
) const {
23 return * (a
) == *(rhs
.a
);
26 #if 0 // this method fails with msvc 6.0 and borland
27 // now we can define the serialization for class A
28 template<class Archive
>
29 void data::serialize(Archive
& ar
, const unsigned int /* file_version */){
30 ar
& BOOST_SERIALIZATION_NVP(a
);
33 // without the explicit instantiations below, the program will
34 // fail to link for lack of instantiantiation of the above function
35 // note: the following failed to fix link errors for vc 7.0 !
36 #include <boost/archive/polymorphic_oarchive.hpp>
38 template void data::serialize
<boost::archive::polymorphic_oarchive
>(
39 boost::archive::polymorphic_oarchive
& ar
,
40 const unsigned int file_version
43 #include <boost/archive/polymorphic_iarchive.hpp>
45 template void data::serialize
<boost::archive::polymorphic_iarchive
>(
46 boost::archive::polymorphic_iarchive
& ar
,
47 const unsigned int file_version
52 void data::serialize(boost::archive::polymorphic_oarchive
& ar
, const unsigned int /* file_version */){
53 ar
& BOOST_SERIALIZATION_NVP(a
);
56 void data::serialize(boost::archive::polymorphic_iarchive
& ar
, const unsigned int /* file_version */){
57 ar
& BOOST_SERIALIZATION_NVP(a
);