forked from boostorg/core
Lift core::detail::demange to core, move demangled_name to typeinfo.hpp.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef BOOST_CORE_DEMANGLED_NAME_HPP_INCLUDED
|
||||
#define BOOST_CORE_DEMANGLED_NAME_HPP_INCLUDED
|
||||
#ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
#define BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// core::demangled_name( BOOST_CORE_TYPEID(T) )
|
||||
// core::demangle
|
||||
//
|
||||
// Copyright 2014 Peter Dimov
|
||||
//
|
||||
@@ -16,7 +16,6 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/core/typeinfo.hpp>
|
||||
#include <string>
|
||||
|
||||
#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
|
||||
@@ -32,9 +31,6 @@ namespace boost
|
||||
namespace core
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#if defined( BOOST_CORE_HAS_CXXABI_H )
|
||||
|
||||
// lifted from boost/exception/detail/type_info.hpp
|
||||
@@ -79,25 +75,10 @@ inline std::string demangle( char const * name )
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
inline std::string demangled_name( core::typeinfo const & ti )
|
||||
{
|
||||
#if defined( BOOST_NO_TYPEID )
|
||||
|
||||
return ti.name();
|
||||
|
||||
#else
|
||||
|
||||
return core::detail::demangle( ti.name() );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_CORE_HAS_CXXABI_H
|
||||
|
||||
#endif // #ifndef BOOST_CORE_DEMANGLED_NAME_HPP_INCLUDED
|
||||
#endif // #ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/typeinfo.hpp>
|
||||
#include <boost/core/demangled_name.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -64,6 +64,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
inline char const * demangled_name( core::typeinfo const & ti )
|
||||
{
|
||||
return ti.name();
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
namespace detail
|
||||
@@ -111,6 +116,7 @@ template<class T> struct core_typeid_< T const volatile >: core_typeid_< T >
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/core/demangle.hpp>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
@@ -129,6 +135,11 @@ typedef std::type_info typeinfo;
|
||||
|
||||
#endif
|
||||
|
||||
inline std::string demangled_name( core::typeinfo const & ti )
|
||||
{
|
||||
return core::demangle( ti.name() );
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
Reference in New Issue
Block a user