fix doc example typo
[boost.git] / boost / serialization / wrapper.hpp
blobee3984df5d109a4940d6c0fb8ab55c27a65283c7
1 #ifndef BOOST_SERIALIZATION_WRAPPER_HPP
2 #define BOOST_SERIALIZATION_WRAPPER_HPP
4 // (C) Copyright 2005-2006 Matthias Troyer
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 <boost/serialization/traits.hpp>
10 #include <boost/type_traits/is_base_and_derived.hpp>
11 #include <boost/mpl/eval_if.hpp>
13 namespace boost { namespace serialization {
15 /// the base class for serialization wrappers
16 ///
17 /// wrappers need to be treated differently at various places in the serialization library,
18 /// e.g. saving of non-const wrappers has to be possible. Since partial specialization
19 // is not supported by all compilers, we derive all wrappers from wrapper_traits.
21 template<
22 class T,
23 int Level = object_serializable,
24 int Tracking = track_never,
25 unsigned int Version = 0,
26 class ETII = extended_type_info_impl< T >
28 struct wrapper_traits : public traits<T,Level,Tracking,Version,ETII,mpl::true_>
29 {};
31 /// the is_wrapper type traits class.
33 namespace detail {
34 template <class T>
35 struct is_wrapper_member
37 typedef BOOST_DEDUCED_TYPENAME T::is_wrapper type;
43 template<class T>
44 struct is_wrapper
45 : mpl::eval_if<
46 is_base_and_derived<basic_traits,T>,
47 detail::is_wrapper_member<T>,
48 mpl::false_
49 >::type
50 {};
52 } } // end namespace boost::serialization
54 // A macro to define that a class is a wrapper
55 #define BOOST_CLASS_IS_WRAPPER(T) \
56 namespace boost { \
57 namespace serialization { \
58 template<> \
59 struct is_wrapper< T > : mpl::true_ {}; \
60 }}
63 #endif //BOOST_SERIALIZATION_WRAPPER_HPP