1 #ifndef BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP
2 #define BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_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
10 // type_info_implementation.hpp: interface for portable version of type_info
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.
20 #include <boost/config.hpp>
21 #include <boost/detail/workaround.hpp>
23 #include <boost/static_assert.hpp>
24 #include <boost/mpl/eval_if.hpp>
25 #include <boost/mpl/identity.hpp>
26 #include <boost/type_traits/is_base_and_derived.hpp>
27 #include <boost/serialization/traits.hpp>
30 namespace serialization
{
32 // note that T and const T are folded into const T so that
33 // there is only one table entry per type
35 struct type_info_implementation
{
37 struct traits_class_typeinfo_implementation
{
38 typedef BOOST_DEDUCED_TYPENAME
U::type_info_implementation::type type
;
40 // note: at least one compiler complained w/o the full qualification
41 // on basic traits below
43 BOOST_DEDUCED_TYPENAME
mpl::eval_if
<
44 is_base_and_derived
<boost::serialization::basic_traits
, T
>,
45 traits_class_typeinfo_implementation
<T
>,
48 BOOST_DEDUCED_TYPENAME extended_type_info_impl
<T
>::type
53 } // namespace serialization
56 // define a macro to assign a particular derivation of extended_type_info
57 // to a specified a class.
58 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
59 #define BOOST_CLASS_TYPE_INFO(T, ETI) \
61 namespace serialization { \
63 struct type_info_implementation< T > { \
64 typedef const ETI type; \
70 #define BOOST_CLASS_TYPE_INFO(T, ETI) \
72 namespace serialization { \
74 struct type_info_implementation< T > { \
78 struct type_info_implementation< const T > { \
86 #endif /// BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP