File indexing completed on 2025-01-18 09:50:38
0001
0002
0003
0004
0005 #ifndef MSVC_TYPEINFO_DWA200222_HPP
0006 # define MSVC_TYPEINFO_DWA200222_HPP
0007
0008 #include <typeinfo>
0009 #include <boost/type.hpp>
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 # if defined(BOOST_INTEL_CXX_VERSION) && BOOST_INTEL_CXX_VERSION <= 700
0022
0023 namespace boost { namespace python { namespace detail {
0024
0025 typedef std::type_info const& typeinfo;
0026
0027 template <class T>
0028 static typeinfo typeid_nonref(T const volatile*) { return typeid(T); }
0029
0030 template <class T>
0031 inline typeinfo typeid_ref_1(T&(*)())
0032 {
0033 return detail::typeid_nonref((T*)0);
0034 }
0035
0036
0037 template <class T>
0038 inline typeinfo typeid_ref(type<T>*, T&(*)(type<T>))
0039 {
0040 return detail::typeid_nonref((T*)0);
0041 }
0042
0043
0044 template <class T>
0045 inline typeinfo typeid_ref(type<T>*, ...)
0046 {
0047 return detail::typeid_ref_1((T(*)())0);
0048 }
0049
0050 #if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
0051 # define BOOST_PYTT_DECL __cdecl
0052 #else
0053 # define BOOST_PYTT_DECL
0054 #endif
0055
0056 template< typename T > T&(* is_ref_tester1(type<T>) )(type<T>) { return 0; }
0057 inline char BOOST_PYTT_DECL is_ref_tester1(...) { return 0; }
0058
0059 template <class T>
0060 inline typeinfo msvc_typeid(boost::type<T>*)
0061 {
0062 return detail::typeid_ref(
0063 (boost::type<T>*)0, detail::is_ref_tester1(type<T>())
0064 );
0065 }
0066
0067 template <>
0068 inline typeinfo msvc_typeid<void>(boost::type<void>*)
0069 {
0070 return typeid(void);
0071 }
0072
0073 # ifndef NDEBUG
0074 inline typeinfo assert_array_typeid_compiles()
0075 {
0076 return msvc_typeid((boost::type<char const[3]>*)0)
0077 , msvc_typeid((boost::type<char[3]>*)0);
0078 }
0079 # endif
0080
0081 }}}
0082
0083 # endif
0084 #endif