sp_typeinfo.hpp
Go to the documentation of this file.
00001 #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
00002 #define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
00003 
00004 // MS compatible compilers support #pragma once
00005 
00006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
00007 # pragma once
00008 #endif
00009 
00010 //  detail/sp_typeinfo.hpp
00011 //
00012 //  Copyright 2007 Peter Dimov
00013 //
00014 // Distributed under the Boost Software License, Version 1.0.
00015 // See accompanying file LICENSE_1_0.txt or copy at
00016 // http://www.boost.org/LICENSE_1_0.txt)
00017 
00018 #include <boost/config.hpp>
00019 
00020 #if defined( BOOST_NO_TYPEID )
00021 
00022 namespace boost
00023 {
00024 
00025 namespace detail
00026 {
00027 
00028 typedef void* sp_typeinfo;
00029 
00030 template<class T> struct sp_typeid_
00031 {
00032     static char v_;
00033 };
00034 
00035 template<class T> char sp_typeid_< T >::v_;
00036 
00037 template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
00038 {
00039 };
00040 
00041 template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T >
00042 {
00043 };
00044 
00045 template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
00046 {
00047 };
00048 
00049 } // namespace detail
00050 
00051 } // namespace boost
00052 
00053 #define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_<T>::v_)
00054 
00055 #else
00056 
00057 #include <typeinfo>
00058 
00059 namespace boost
00060 {
00061 
00062 namespace detail
00063 {
00064 
00065 #if defined( BOOST_NO_STD_TYPEINFO )
00066 
00067 typedef ::type_info sp_typeinfo;
00068 
00069 #else
00070 
00071 typedef std::type_info sp_typeinfo;
00072 
00073 #endif
00074 
00075 } // namespace detail
00076 
00077 } // namespace boost
00078 
00079 #define BOOST_SP_TYPEID(T) typeid(T)
00080 
00081 #endif
00082 
00083 #endif  // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:29