File indexing completed on 2025-01-18 09:38:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_INTERPROCESS_DETAIL_POINTER_TYPE_HPP
0015 #define BOOST_INTERPROCESS_DETAIL_POINTER_TYPE_HPP
0016
0017 #ifndef BOOST_CONFIG_HPP
0018 # include <boost/config.hpp>
0019 #endif
0020 #
0021 #if defined(BOOST_HAS_PRAGMA_ONCE)
0022 # pragma once
0023 #endif
0024
0025 #include <boost/interprocess/detail/config_begin.hpp>
0026 #include <boost/interprocess/detail/workaround.hpp>
0027 #include <boost/interprocess/detail/type_traits.hpp>
0028
0029 namespace boost {
0030 namespace interprocess {
0031 namespace ipcdetail {
0032
0033 struct two {char _[2];};
0034
0035 namespace pointer_type_imp {
0036
0037 template <class U> static two test(...);
0038 template <class U> static char test(typename U::pointer* = 0);
0039
0040 }
0041
0042 template <class T>
0043 struct has_pointer_type
0044 {
0045 static const bool value = sizeof(pointer_type_imp::test<T>(0)) == 1;
0046 };
0047
0048 namespace pointer_type_imp {
0049
0050 template <class T, class D, bool = has_pointer_type<D>::value>
0051 struct pointer_type
0052 {
0053 typedef typename D::pointer type;
0054 };
0055
0056 template <class T, class D>
0057 struct pointer_type<T, D, false>
0058 {
0059 typedef T* type;
0060 };
0061
0062 }
0063
0064 template <class T, class D>
0065 struct pointer_type
0066 {
0067 typedef typename pointer_type_imp::pointer_type<T,
0068 typename remove_reference<D>::type>::type type;
0069 };
0070
0071 }
0072 }
0073 }
0074
0075 #include <boost/interprocess/detail/config_end.hpp>
0076
0077 #endif
0078