]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_index/patched/boost_detail_sp_typeinfo.patch
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_index / patched / boost_detail_sp_typeinfo.patch
1 From b77c0af6af8bc4797defc3627878acc3cf7a6f39 Mon Sep 17 00:00:00 2001
2 From: Antony Polukhin <antoshkka@gmail.com>
3 Date: Thu, 20 Feb 2014 17:57:24 +0400
4 Subject: [PATCH] detail/sp_typeinfo.hpp now uses TypeIndex
5
6 ---
7 include/boost/detail/sp_typeinfo.hpp | 123 +++--------------------------------
8 1 file changed, 8 insertions(+), 115 deletions(-)
9
10 diff --git a/include/boost/detail/sp_typeinfo.hpp b/include/boost/detail/sp_typeinfo.hpp
11 index 43fae78..fbdf86d 100644
12 --- a/include/boost/detail/sp_typeinfo.hpp
13 +++ b/include/boost/detail/sp_typeinfo.hpp
14 @@ -10,126 +10,19 @@
15 // detail/sp_typeinfo.hpp
16 //
17 // Copyright 2007 Peter Dimov
18 +// Copyright 2014 Antony Polukhin
19 //
20 // Distributed under the Boost Software License, Version 1.0.
21 // See accompanying file LICENSE_1_0.txt or copy at
22 // http://www.boost.org/LICENSE_1_0.txt)
23
24 -#include <boost/config.hpp>
25 +#include <boost/type_index.hpp>
26 +namespace boost { namespace detail {
27 +
28 +typedef boost::typeind::type_info sp_typeinfo;
29 +
30 +}} // namespace boost::detail
31
32 -#if defined( BOOST_NO_TYPEID )
33 -
34 -#include <boost/current_function.hpp>
35 -#include <functional>
36 -
37 -namespace boost
38 -{
39 -
40 -namespace detail
41 -{
42 -
43 -class sp_typeinfo
44 -{
45 -private:
46 -
47 - sp_typeinfo( sp_typeinfo const& );
48 - sp_typeinfo& operator=( sp_typeinfo const& );
49 -
50 - char const * name_;
51 -
52 -public:
53 -
54 - explicit sp_typeinfo( char const * name ): name_( name )
55 - {
56 - }
57 -
58 - bool operator==( sp_typeinfo const& rhs ) const
59 - {
60 - return this == &rhs;
61 - }
62 -
63 - bool operator!=( sp_typeinfo const& rhs ) const
64 - {
65 - return this != &rhs;
66 - }
67 -
68 - bool before( sp_typeinfo const& rhs ) const
69 - {
70 - return std::less< sp_typeinfo const* >()( this, &rhs );
71 - }
72 -
73 - char const* name() const
74 - {
75 - return name_;
76 - }
77 -};
78 -
79 -template<class T> struct sp_typeid_
80 -{
81 - static sp_typeinfo ti_;
82 -
83 - static char const * name()
84 - {
85 - return BOOST_CURRENT_FUNCTION;
86 - }
87 -};
88 -
89 -#if defined(__SUNPRO_CC)
90 -// see #4199, the Sun Studio compiler gets confused about static initialization
91 -// constructor arguments. But an assignment works just fine.
92 -template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
93 -#else
94 -template<class T> sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name());
95 -#endif
96 -
97 -template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
98 -{
99 -};
100 -
101 -template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
102 -{
103 -};
104 -
105 -template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T >
106 -{
107 -};
108 -
109 -template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
110 -{
111 -};
112 -
113 -} // namespace detail
114 -
115 -} // namespace boost
116 -
117 -#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_)
118 -
119 -#else
120 -
121 -#include <typeinfo>
122 -
123 -namespace boost
124 -{
125 -
126 -namespace detail
127 -{
128 -
129 -#if defined( BOOST_NO_STD_TYPEINFO )
130 -
131 -typedef ::type_info sp_typeinfo;
132 -
133 -#else
134 -
135 -typedef std::type_info sp_typeinfo;
136 -
137 -#endif
138 -
139 -} // namespace detail
140 -
141 -} // namespace boost
142 -
143 -#define BOOST_SP_TYPEID(T) typeid(T)
144 -
145 -#endif
146 +#define BOOST_SP_TYPEID(T) (boost::typeind::type_id<T>().type_info())
147
148 #endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
149 --
150 1.8.5.3
151