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
7 include/boost/detail/sp_typeinfo.hpp | 123 +++--------------------------------
8 1 file changed, 8 insertions(+), 115 deletions(-)
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
15 // detail/sp_typeinfo.hpp
17 // Copyright 2007 Peter Dimov
18 +// Copyright 2014 Antony Polukhin
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)
24 -#include <boost/config.hpp>
25 +#include <boost/type_index.hpp>
26 +namespace boost { namespace detail {
28 +typedef boost::typeind::type_info sp_typeinfo;
30 +}} // namespace boost::detail
32 -#if defined( BOOST_NO_TYPEID )
34 -#include <boost/current_function.hpp>
35 -#include <functional>
47 - sp_typeinfo( sp_typeinfo const& );
48 - sp_typeinfo& operator=( sp_typeinfo const& );
54 - explicit sp_typeinfo( char const * name ): name_( name )
58 - bool operator==( sp_typeinfo const& rhs ) const
60 - return this == &rhs;
63 - bool operator!=( sp_typeinfo const& rhs ) const
65 - return this != &rhs;
68 - bool before( sp_typeinfo const& rhs ) const
70 - return std::less< sp_typeinfo const* >()( this, &rhs );
73 - char const* name() const
79 -template<class T> struct sp_typeid_
81 - static sp_typeinfo ti_;
83 - static char const * name()
85 - return BOOST_CURRENT_FUNCTION;
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();
94 -template<class T> sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name());
97 -template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
101 -template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
105 -template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T >
109 -template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
113 -} // namespace detail
115 -} // namespace boost
117 -#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_)
129 -#if defined( BOOST_NO_STD_TYPEINFO )
131 -typedef ::type_info sp_typeinfo;
135 -typedef std::type_info sp_typeinfo;
139 -} // namespace detail
141 -} // namespace boost
143 -#define BOOST_SP_TYPEID(T) typeid(T)
146 +#define BOOST_SP_TYPEID(T) (boost::typeind::type_id<T>().type_info())
148 #endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED