File indexing completed on 2025-01-18 09:28:28
0001
0002
0003
0004 #ifndef BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP
0005 # define BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP
0006
0007 namespace boost { namespace archive { namespace detail {
0008
0009
0010
0011
0012
0013
0014
0015 struct adl_tag {};
0016
0017 template <class Archive, class Serializable>
0018 struct ptr_serialization_support;
0019
0020
0021
0022
0023
0024 template <class Archive, class Serializable>
0025 struct _ptr_serialization_support
0026 : ptr_serialization_support<Archive,Serializable>
0027 {
0028 typedef int type;
0029 };
0030
0031 #if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5130)
0032
0033 template<int N>
0034 struct counter : counter<N-1> {};
0035 template<>
0036 struct counter<0> {};
0037
0038 template<class Serializable>
0039 void instantiate_ptr_serialization(Serializable* s, int, adl_tag) {
0040 instantiate_ptr_serialization(s, counter<20>());
0041 }
0042
0043 template<class Archive>
0044 struct get_counter {
0045 static const int value = sizeof(adjust_counter(counter<20>()));
0046 typedef counter<value> type;
0047 typedef counter<value - 1> prior;
0048 typedef char (&next)[value+1];
0049 };
0050
0051 char adjust_counter(counter<0>);
0052 template<class Serializable>
0053 void instantiate_ptr_serialization(Serializable*, counter<0>) {}
0054
0055 #define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \
0056 namespace boost { namespace archive { namespace detail { \
0057 get_counter<Archive >::next adjust_counter(get_counter<Archive >::type);\
0058 template<class Serializable> \
0059 void instantiate_ptr_serialization(Serializable* s, \
0060 get_counter<Archive >::type) { \
0061 ptr_serialization_support<Archive, Serializable> x; \
0062 instantiate_ptr_serialization(s, get_counter<Archive >::prior()); \
0063 }\
0064 }}}
0065
0066
0067 #else
0068
0069
0070
0071
0072 template <class Serializable>
0073 void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {}
0074
0075
0076
0077
0078
0079
0080 # define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \
0081 namespace boost { namespace archive { namespace detail { \
0082 \
0083 template <class Serializable> \
0084 typename _ptr_serialization_support<Archive, Serializable>::type \
0085 instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \
0086 \
0087 }}}
0088 #endif
0089 }}}
0090
0091 #endif