1 #ifndef BOOST_SERIALIZATION_SPLIT_FREE_HPP
2 #define BOOST_SERIALIZATION_SPLIT_FREE_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
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 <boost/config.hpp>
20 #include <boost/mpl/eval_if.hpp>
21 #include <boost/mpl/identity.hpp>
22 #include <boost/serialization/serialization.hpp>
27 template<class Archive
> class interface_oarchive
;
28 template<class Archive
> class interface_iarchive
;
30 } // namespace archive
32 namespace serialization
{
35 template<class Archive
, class T
>
40 const unsigned int file_version
42 // use function overload (version_type) to workaround
43 // two-phase lookup issue
44 const version_type
v(file_version
);
48 template<class Archive
, class T
>
53 const unsigned int file_version
55 // use function overload (version_type) to workaround
56 // two-phase lookup issue
57 const version_type
v(file_version
);
61 //} // namespace detail
63 template<class Archive
, class T
>
64 inline void split_free(
67 const unsigned int file_version
69 typedef BOOST_DEDUCED_TYPENAME
mpl::eval_if
<
70 BOOST_DEDUCED_TYPENAME
Archive::is_saving
,
71 mpl::identity
</* detail:: */ free_saver
<Archive
, T
> >,
72 mpl::identity
</* detail:: */ free_loader
<Archive
, T
> >
74 typex::invoke(ar
, t
, file_version
);
77 } // namespace serialization
80 #define BOOST_SERIALIZATION_SPLIT_FREE(T) \
81 namespace boost { namespace serialization { \
82 template<class Archive> \
83 inline void serialize( \
86 const unsigned int file_version \
88 split_free(ar, t, file_version); \
93 #endif // BOOST_SERIALIZATION_SPLIT_FREE_HPP