]> git.lyx.org Git - lyx.git/blob - boost/boost/detail/sp_typeinfo.hpp
update boost to version 1.36
[lyx.git] / boost / boost / detail / sp_typeinfo.hpp
1 #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
2 #define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
3
4 // MS compatible compilers support #pragma once
5
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
7 # pragma once
8 #endif
9
10 //  detail/sp_typeinfo.hpp
11 //
12 //  Copyright 2007 Peter Dimov
13 //
14 // Distributed under the Boost Software License, Version 1.0.
15 // See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
17
18 #include <boost/config.hpp>
19
20 #if defined( BOOST_NO_TYPEID )
21
22 namespace boost
23 {
24
25 namespace detail
26 {
27
28 typedef void* sp_typeinfo;
29
30 template<class T> struct sp_typeid_
31 {
32     static char v_;
33 };
34
35 template<class T> char sp_typeid_< T >::v_;
36
37 template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
38 {
39 };
40
41 template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T >
42 {
43 };
44
45 template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
46 {
47 };
48
49 } // namespace detail
50
51 } // namespace boost
52
53 #define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_<T>::v_)
54
55 #else
56
57 #include <typeinfo>
58
59 namespace boost
60 {
61
62 namespace detail
63 {
64
65 #if defined( BOOST_NO_STD_TYPEINFO )
66
67 typedef ::type_info sp_typeinfo;
68
69 #else
70
71 typedef std::type_info sp_typeinfo;
72
73 #endif
74
75 } // namespace detail
76
77 } // namespace boost
78
79 #define BOOST_SP_TYPEID(T) typeid(T)
80
81 #endif
82
83 #endif  // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED