1 #ifndef BOOST_SERIALIZATION_TEST_B_HPP
2 #define BOOST_SERIALIZATION_TEST_B_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <cstdlib> // for rand()
21 #include <boost/math/special_functions/next.hpp>
23 #include <boost/config.hpp>
24 #if defined(BOOST_NO_STDC_NAMESPACE)
30 #include <boost/serialization/version.hpp>
31 #include <boost/serialization/split_member.hpp>
32 #include <boost/serialization/base_object.hpp>
36 ///////////////////////////////////////////////////////
41 friend class boost::serialization::access;
42 template<class Archive>
43 void save(Archive &ar, const unsigned int /* file_version */) const
45 // write any base class info to the archive
46 ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(A);
49 ar << BOOST_SERIALIZATION_NVP(s);
50 ar << BOOST_SERIALIZATION_NVP(t);
51 ar << BOOST_SERIALIZATION_NVP(u);
52 ar << BOOST_SERIALIZATION_NVP(v);
53 ar << BOOST_SERIALIZATION_NVP(w);
54 ar << BOOST_SERIALIZATION_NVP(x);
57 template<class Archive>
58 void load(Archive & ar, const unsigned int file_version)
60 // read any base class info to the archive
61 ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(A);
65 ar >> BOOST_SERIALIZATION_NVP(s);
66 ar >> BOOST_SERIALIZATION_NVP(t);
67 ar >> BOOST_SERIALIZATION_NVP(u);
68 ar >> BOOST_SERIALIZATION_NVP(v);
69 ar >> BOOST_SERIALIZATION_NVP(w);
70 ar >> BOOST_SERIALIZATION_NVP(x);
77 BOOST_SERIALIZATION_SPLIT_MEMBER()
87 bool operator==(const B &rhs) const;
91 s(static_cast<signed char>(std::rand())),
92 t(static_cast<unsigned char>(std::rand())),
95 w((float)std::rand() / std::rand()),
96 x((double)std::rand() / std::rand())
100 BOOST_CLASS_VERSION(B, 2)
102 inline bool B::operator==(const B &rhs) const
110 && std::abs( boost::math::float_distance(w, rhs.w)) < 2
111 && std::abs( boost::math::float_distance(x, rhs.x)) < 2
115 #endif // BOOST_SERIALIZATION_TEST_B_HPP