diff --git a/doc/changelog.qbk b/doc/changelog.qbk index 942cc2e..9e039e1 100644 --- a/doc/changelog.qbk +++ b/doc/changelog.qbk @@ -9,6 +9,16 @@ [section:changelog Changelog] +[heading 2.6, Boost 1.59] + +[*General changes:] + +* On systems with [@https://gcc.gnu.org/wiki/Visibility symbol visibility] support (e.g. Linux) the library is now built with all internal symbols hidden. API symbols still have default visibility, so this shouldn't affect linking with the library. +* *Breaking change:* The library has been ported to __boost_type_index__ for its underlying type info management tool. This affected the following public interfaces: + * `invalid_type` exceptions thrown by the library now have `typeindex::type_index` attached as the description of the offending type. The type was previously identified by `type_info_wrapper`. + * __boost_exception__ `type_info_info` error information now contains `typeindex::type_index` instead of `type_info_wrapper`. This is the error info that can be used to obtain the type info from `invalid_type` exceptions. + * `attribute_value::get_type()` now returns `typeindex::type_index` instead of `type_info_wrapper`. If the `attribute_value` object is empty, the returned `type_index` is default-constructed (i.e. refers to the `void` type). User-defined attribute value implementations should be similatly changed (the `attribute_value::impl::get_type()` virtual method now also returns `typeindex::type_index`). + [heading 2.5, Boost 1.58] [*Bug fixes:] diff --git a/doc/log.qbk b/doc/log.qbk index 1a9b8d6..be4da18 100644 --- a/doc/log.qbk +++ b/doc/log.qbk @@ -46,6 +46,7 @@ [def __boost_asio__ [@http://www.boost.org/doc/libs/release/doc/html/boost_asio.html Boost.ASIO]] [def __boost_move__ [@http://www.boost.org/doc/libs/release/doc/html/move.html Boost.Move]] [def __boost_locale__ [@http://www.boost.org/doc/libs/release/libs/locale/doc/html/index.html Boost.Locale]] +[def __boost_type_index__ [@http://www.boost.org/doc/libs/release/doc/html/boost_typeindex.html Boost.TypeIndex]] [def __boost_utility__ [@http://www.boost.org/doc/libs/release/libs/utility/utility.htm Boost.Utility]] [def __boost_quickbook__ [@http://www.boost.org/doc/libs/release/doc/html/quickbook.html Boost.Quickbook]] diff --git a/include/boost/log/attributes/attribute_value.hpp b/include/boost/log/attributes/attribute_value.hpp index 95014c1..7cc11bf 100644 --- a/include/boost/log/attributes/attribute_value.hpp +++ b/include/boost/log/attributes/attribute_value.hpp @@ -15,11 +15,11 @@ #ifndef BOOST_LOG_ATTRIBUTE_VALUE_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTE_VALUE_HPP_INCLUDED_ +#include #include #include #include #include -#include #include #include #include @@ -103,7 +103,7 @@ public: /*! * \return The attribute value type */ - virtual type_info_wrapper get_type() const { return type_info_wrapper(); } + virtual typeindex::type_index get_type() const { return typeindex::type_index(); } }; private: @@ -166,12 +166,12 @@ public: * the information cannot be provided. If the returned value is not empty, the type * can be used for value extraction. */ - type_info_wrapper get_type() const + typeindex::type_index get_type() const { if (m_pImpl.get()) return m_pImpl->get_type(); else - return type_info_wrapper(); + return typeindex::type_index(); } /*! diff --git a/include/boost/log/attributes/attribute_value_impl.hpp b/include/boost/log/attributes/attribute_value_impl.hpp index 99bf022..50ba812 100644 --- a/include/boost/log/attributes/attribute_value_impl.hpp +++ b/include/boost/log/attributes/attribute_value_impl.hpp @@ -15,6 +15,7 @@ #ifndef BOOST_LOG_ATTRIBUTES_ATTRIBUTE_VALUE_IMPL_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTES_ATTRIBUTE_VALUE_IMPL_HPP_INCLUDED_ +#include #include #include #include @@ -87,7 +88,7 @@ public: /*! * \return The attribute value type */ - type_info_wrapper get_type() const { return type_info_wrapper(typeid(value_type)); } + typeindex::type_index get_type() const { return typeindex::type_id< value_type >(); } /*! * \return Reference to the contained value. diff --git a/include/boost/log/attributes/current_thread_id.hpp b/include/boost/log/attributes/current_thread_id.hpp index 0861a37..23573e3 100644 --- a/include/boost/log/attributes/current_thread_id.hpp +++ b/include/boost/log/attributes/current_thread_id.hpp @@ -79,7 +79,7 @@ protected: return new detached_value(boost::log::aux::this_thread::get_id()); } - type_info_wrapper get_type() const { return type_info_wrapper(typeid(value_type)); } + typeindex::type_index get_type() const { return typeindex::type_id< value_type >(); } }; public: diff --git a/include/boost/log/attributes/fallback_policy.hpp b/include/boost/log/attributes/fallback_policy.hpp index 549b81d..cde3e94 100644 --- a/include/boost/log/attributes/fallback_policy.hpp +++ b/include/boost/log/attributes/fallback_policy.hpp @@ -15,11 +15,11 @@ #ifndef BOOST_LOG_ATTRIBUTES_FALLBACK_POLICY_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTES_FALLBACK_POLICY_HPP_INCLUDED_ +#include #include #include #include #include -#include #include #include @@ -59,7 +59,7 @@ struct fallback_to_none /*! * The method is called when value extraction failed because the attribute value has different type than requested. */ - static void on_invalid_type(type_info_wrapper const&) + static void on_invalid_type(typeindex::type_index const&) { } @@ -99,7 +99,7 @@ struct fallback_to_throw /*! * The method is called when value extraction failed because the attribute value has different type than requested. */ - static void on_invalid_type(type_info_wrapper const& t) + static void on_invalid_type(typeindex::type_index const& t) { BOOST_LOG_THROW_DESCR_PARAMS(invalid_type, "Attribute value has incompatible type", (t)); } @@ -161,7 +161,7 @@ struct fallback_to_default /*! * The method is called when value extraction failed because the attribute value has different type than requested. */ - static void on_invalid_type(type_info_wrapper const&) + static void on_invalid_type(typeindex::type_index const&) { } diff --git a/include/boost/log/exceptions.hpp b/include/boost/log/exceptions.hpp index f5bcbc4..8f305fa 100644 --- a/include/boost/log/exceptions.hpp +++ b/include/boost/log/exceptions.hpp @@ -18,10 +18,10 @@ #include #include #include +#include #include #include #include -#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -130,8 +130,8 @@ public: static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line); static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line, std::string const& descr); static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line, std::string const& descr, attribute_name const& name); - static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line, std::string const& descr, type_info_wrapper const& type); - static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line, std::string const& descr, attribute_name const& name, type_info_wrapper const& type); + static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line, std::string const& descr, typeindex::type_index const& type); + static BOOST_LOG_NORETURN void throw_(const char* file, std::size_t line, std::string const& descr, attribute_name const& name, typeindex::type_index const& type); #endif }; diff --git a/include/boost/log/sources/global_logger_storage.hpp b/include/boost/log/sources/global_logger_storage.hpp index ffbc431..a98e5e6 100644 --- a/include/boost/log/sources/global_logger_storage.hpp +++ b/include/boost/log/sources/global_logger_storage.hpp @@ -15,14 +15,13 @@ #ifndef BOOST_LOG_SOURCES_GLOBAL_LOGGER_STORAGE_HPP_INCLUDED_ #define BOOST_LOG_SOURCES_GLOBAL_LOGGER_STORAGE_HPP_INCLUDED_ -#include #include +#include #include #include #include #include #include -#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -41,17 +40,19 @@ namespace aux { struct BOOST_LOG_NO_VTABLE BOOST_SYMBOL_VISIBLE logger_holder_base { //! The source file name where the logger was registered - const char* m_RegistrationFile; + const char* const m_RegistrationFile; //! The line number where the logger was registered - unsigned int m_RegistrationLine; + const unsigned int m_RegistrationLine; + //! Stored logger type + const typeindex::type_index m_LoggerType; - logger_holder_base(const char* file, unsigned int line) : + logger_holder_base(const char* file, unsigned int line, typeindex::type_index logger_type) BOOST_NOEXCEPT : m_RegistrationFile(file), - m_RegistrationLine(line) + m_RegistrationLine(line), + m_LoggerType(logger_type) { } virtual ~logger_holder_base() {} - virtual std::type_info const& logger_type() const = 0; }; //! The actual logger holder class @@ -63,11 +64,10 @@ struct BOOST_SYMBOL_VISIBLE logger_holder : LoggerT m_Logger; logger_holder(const char* file, unsigned int line, LoggerT const& logger) : - logger_holder_base(file, line), + logger_holder_base(file, line, typeindex::type_id< LoggerT >()), m_Logger(logger) { } - std::type_info const& logger_type() const { return typeid(LoggerT); } }; //! The class implements a global repository of tagged loggers @@ -76,7 +76,7 @@ struct global_storage typedef shared_ptr< logger_holder_base >(*initializer_t)(); //! Finds or creates the logger and returns its holder - BOOST_LOG_API static shared_ptr< logger_holder_base > get_or_init(std::type_info const& key, initializer_t initializer); + BOOST_LOG_API static shared_ptr< logger_holder_base > get_or_init(typeindex::type_index key, initializer_t initializer); // Non-constructible, non-copyable, non-assignable BOOST_DELETED_FUNCTION(global_storage()) @@ -86,8 +86,8 @@ struct global_storage //! Throws the \c odr_violation exception BOOST_LOG_API BOOST_LOG_NORETURN void throw_odr_violation( - std::type_info const& tag_type, - std::type_info const& logger_type, + typeindex::type_index tag_type, + typeindex::type_index logger_type, logger_holder_base const& registered); //! The class implements a logger singleton @@ -116,18 +116,24 @@ struct logger_singleton : static void init_instance() { shared_ptr< logger_holder< logger_type > >& instance = base_type::get_instance(); - shared_ptr< logger_holder_base > holder = global_storage::get_or_init( - typeid(boost::log::aux::visible_type< TagT >), - &logger_singleton::construct_logger); - instance = boost::dynamic_pointer_cast< logger_holder< logger_type > >(holder); - if (!instance) + const typeindex::type_index tag_type_index = typeindex::type_id< TagT >(); + shared_ptr< logger_holder_base > holder = global_storage::get_or_init(tag_type_index, &logger_singleton::construct_logger); + const typeindex::type_index logger_type_index = typeindex::type_id< logger_type >(); + if (holder->m_LoggerType == logger_type_index) + { + // Note: dynamic_cast may fail here if logger_type is not visible (for example, with Clang on Linux, if the original logger + // instance was initialized in a different DSO than where it's being queried). logger_holder default visibility doesn't + // help since it is inhibited by the template parameter visibility. + instance = boost::static_pointer_cast< logger_holder< logger_type > >(holder); + } + else { // In pure C++ this should never happen, since there cannot be two // different tag types that have equal type_infos. In real life it can // happen if the same-named tag is defined differently in two or more // dlls. This check is intended to detect such ODR violations. However, there // is no protection against different definitions of the logger type itself. - throw_odr_violation(typeid(TagT), typeid(logger_type), *holder); + throw_odr_violation(tag_type_index, logger_type_index, *holder); } } diff --git a/include/boost/log/support/exception.hpp b/include/boost/log/support/exception.hpp index e880115..f6d9be2 100644 --- a/include/boost/log/support/exception.hpp +++ b/include/boost/log/support/exception.hpp @@ -15,11 +15,11 @@ #ifndef BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_ #define BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_ +#include #include #include #include #include -#include #include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -38,7 +38,7 @@ typedef error_info< struct attribute_name_info_tag, attribute_name > attribute_n /*! * Type info exception information */ -typedef error_info< struct type_info_info_tag, type_info_wrapper > type_info_info; +typedef error_info< struct type_info_info_tag, typeindex::type_index > type_info_info; /*! * Parse position exception information diff --git a/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp index 63c7bc1..d01228a 100644 --- a/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp @@ -19,11 +19,10 @@ #include #include #include +#include #include #include #include -#include -#include #include #include @@ -78,7 +77,7 @@ private: #endif // BOOST_LOG_DOXYGEN_PASS //! The dispatching map - typedef std::map< type_info_wrapper, shared_ptr< callback_base > > dispatching_map; + typedef std::map< typeindex::type_index, shared_ptr< callback_base > > dispatching_map; dispatching_map m_DispatchingMap; public: @@ -118,7 +117,7 @@ public: boost::shared_ptr< callback_base > p( boost::make_shared< callback_impl< T, VisitorT > >(boost::cref(visitor))); - type_info_wrapper wrapper(typeid(aux::visible_type< T >)); + typeindex::type_index wrapper(typeindex::type_id< T >()); m_DispatchingMap[wrapper].swap(p); } @@ -132,11 +131,10 @@ public: private: #ifndef BOOST_LOG_DOXYGEN_PASS - static callback_base get_callback(type_dispatcher* p, std::type_info const& type) + static callback_base get_callback(type_dispatcher* p, typeindex::type_index type) { dynamic_type_dispatcher* const self = static_cast< dynamic_type_dispatcher* >(p); - type_info_wrapper wrapper(type); - dispatching_map::iterator it = self->m_DispatchingMap.find(wrapper); + dispatching_map::iterator it = self->m_DispatchingMap.find(type); if (it != self->m_DispatchingMap.end()) return *it->second; else diff --git a/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp index a5743e2..bae420f 100644 --- a/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -30,9 +31,7 @@ #include #include #include -#include #include -#include #include #include @@ -50,7 +49,7 @@ namespace aux { struct dispatching_map_order { typedef bool result_type; - typedef std::pair< type_info_wrapper, void* > first_argument_type, second_argument_type; + typedef std::pair< typeindex::type_index, void* > first_argument_type, second_argument_type; result_type operator() (first_argument_type const& left, second_argument_type const& right) const { return (left.first < right.first); @@ -62,15 +61,15 @@ template< typename VisitorT > struct dispatching_map_initializer { template< typename IteratorT > - static BOOST_FORCEINLINE void init(IteratorT*, IteratorT*, std::pair< type_info_wrapper, void* >*) + static BOOST_FORCEINLINE void init(IteratorT*, IteratorT*, std::pair< typeindex::type_index, void* >*) { } template< typename BeginIteratorT, typename EndIteratorT > - static BOOST_FORCEINLINE void init(BeginIteratorT*, EndIteratorT* end, std::pair< type_info_wrapper, void* >* p) + static BOOST_FORCEINLINE void init(BeginIteratorT*, EndIteratorT* end, std::pair< typeindex::type_index, void* >* p) { typedef typename mpl::deref< BeginIteratorT >::type type; - do_init(static_cast< visible_type< type >* >(0), p); + do_init(static_cast< type* >(0), p); typedef typename mpl::next< BeginIteratorT >::type next_iterator_type; init(static_cast< next_iterator_type* >(0), end, p + 1); @@ -78,9 +77,9 @@ struct dispatching_map_initializer private: template< typename T > - static BOOST_FORCEINLINE void do_init(visible_type< T >*, std::pair< type_info_wrapper, void* >* p) + static BOOST_FORCEINLINE void do_init(T*, std::pair< typeindex::type_index, void* >* p) { - p->first = typeid(visible_type< T >); + p->first = typeindex::type_id< T >(); typedef void (*trampoline_t)(void*, T const&); BOOST_STATIC_ASSERT_MSG(sizeof(trampoline_t) == sizeof(void*), "Boost.Log: Unsupported platform, the size of a function pointer differs from the size of a pointer"); @@ -101,7 +100,7 @@ class type_sequence_dispatcher_base : { private: //! Dispatching map element type - typedef std::pair< type_info_wrapper, void* > dispatching_map_element_type; + typedef std::pair< typeindex::type_index, void* > dispatching_map_element_type; private: //! Dispatching map @@ -123,21 +122,20 @@ protected: private: //! The get_callback method implementation - static callback_base get_callback(type_dispatcher* p, std::type_info const& type) + static callback_base get_callback(type_dispatcher* p, typeindex::type_index type) { type_sequence_dispatcher_base* const self = static_cast< type_sequence_dispatcher_base* >(p); - type_info_wrapper wrapper(type); const dispatching_map_element_type* begin = self->m_dispatching_map_begin; const dispatching_map_element_type* end = begin + self->m_dispatching_map_size; const dispatching_map_element_type* it = std::lower_bound ( begin, end, - dispatching_map_element_type(wrapper, (void*)0), + dispatching_map_element_type(type, (void*)0), dispatching_map_order() ); - if (it != end && it->first == wrapper) + if (it != end && it->first == type) return callback_base(self->m_visitor, it->second); else return callback_base(); @@ -160,7 +158,7 @@ public: private: //! The dispatching map typedef array< - std::pair< type_info_wrapper, void* >, + std::pair< typeindex::type_index, void* >, mpl::size< supported_types >::value > dispatching_map; @@ -210,13 +208,13 @@ class single_type_dispatcher_base : { private: //! The type to match against - std::type_info const& m_type; + typeindex::type_index m_type; //! A callback for the supported type callback_base m_callback; protected: //! Initializing constructor - single_type_dispatcher_base(std::type_info const& type, callback_base const& callback) BOOST_NOEXCEPT : + single_type_dispatcher_base(typeindex::type_index type, callback_base const& callback) BOOST_NOEXCEPT : type_dispatcher(&single_type_dispatcher_base::get_callback), m_type(type), m_callback(callback) @@ -225,7 +223,7 @@ protected: private: //! The get_callback method implementation - static callback_base get_callback(type_dispatcher* p, std::type_info const& type) + static callback_base get_callback(type_dispatcher* p, typeindex::type_index type) { single_type_dispatcher_base* const self = static_cast< single_type_dispatcher_base* >(p); if (type == self->m_type) @@ -248,7 +246,7 @@ public: //! Constructor template< typename VisitorT > explicit single_type_dispatcher(VisitorT& visitor) BOOST_NOEXCEPT : - single_type_dispatcher_base(typeid(visible_type< T >), callback_base((void*)boost::addressof(visitor), &callback_base::trampoline< VisitorT, T >)) + single_type_dispatcher_base(typeindex::type_id< T >(), callback_base((void*)boost::addressof(visitor), &callback_base::trampoline< VisitorT, T >)) { } diff --git a/include/boost/log/utility/type_dispatch/type_dispatcher.hpp b/include/boost/log/utility/type_dispatch/type_dispatcher.hpp index 9ca52cd..c526511 100644 --- a/include/boost/log/utility/type_dispatch/type_dispatcher.hpp +++ b/include/boost/log/utility/type_dispatch/type_dispatcher.hpp @@ -15,10 +15,9 @@ #ifndef BOOST_LOG_TYPE_DISPATCHER_HPP_INCLUDED_ #define BOOST_LOG_TYPE_DISPATCHER_HPP_INCLUDED_ -#include +#include #include #include -#include #include #include @@ -148,7 +147,7 @@ public: protected: //! Pointer to the callback acquisition method - typedef callback_base (*get_callback_impl_type)(type_dispatcher*, std::type_info const&); + typedef callback_base (*get_callback_impl_type)(type_dispatcher*, typeindex::type_index); private: //! Pointer to the callback acquisition method @@ -176,7 +175,7 @@ public: template< typename T > callback< T > get_callback() { - return callback< T >((this->m_get_callback_impl)(this, typeid(boost::log::aux::visible_type< T >))); + return callback< T >((this->m_get_callback_impl)(this, typeindex::type_id< T >())); } }; diff --git a/src/exceptions.cpp b/src/exceptions.cpp index db1ee3f..0adcef4 100644 --- a/src/exceptions.cpp +++ b/src/exceptions.cpp @@ -129,7 +129,7 @@ void invalid_type::throw_(const char* file, std::size_t line, std::string const& ); } -void invalid_type::throw_(const char* file, std::size_t line, std::string const& descr, type_info_wrapper const& type) +void invalid_type::throw_(const char* file, std::size_t line, std::string const& descr, typeindex::type_index const& type) { boost::throw_exception(boost::enable_error_info(invalid_type(descr)) << boost::throw_file(file) @@ -138,7 +138,7 @@ void invalid_type::throw_(const char* file, std::size_t line, std::string const& ); } -void invalid_type::throw_(const char* file, std::size_t line, std::string const& descr, attribute_name const& name, type_info_wrapper const& type) +void invalid_type::throw_(const char* file, std::size_t line, std::string const& descr, attribute_name const& name, typeindex::type_index const& type) { boost::throw_exception(boost::enable_error_info(invalid_type(descr)) << boost::throw_file(file) diff --git a/src/global_logger_storage.cpp b/src/global_logger_storage.cpp index cb8e6a6..1cd026a 100644 --- a/src/global_logger_storage.cpp +++ b/src/global_logger_storage.cpp @@ -16,10 +16,10 @@ #include #include #include +#include #include #include #include -#include #include #if !defined(BOOST_LOG_NO_THREADS) #include @@ -42,7 +42,7 @@ struct loggers_repository : public log::aux::lazy_singleton< loggers_repository > { //! Repository map type - typedef std::map< type_info_wrapper, shared_ptr< logger_holder_base > > loggers_map_t; + typedef std::map< typeindex::type_index, shared_ptr< logger_holder_base > > loggers_map_t; #if !defined(BOOST_LOG_NO_THREADS) //! Synchronization primitive @@ -55,14 +55,13 @@ struct loggers_repository : } // namespace //! Finds or creates the logger and returns its holder -BOOST_LOG_API shared_ptr< logger_holder_base > global_storage::get_or_init(std::type_info const& key, initializer_t initializer) +BOOST_LOG_API shared_ptr< logger_holder_base > global_storage::get_or_init(typeindex::type_index key, initializer_t initializer) { typedef loggers_repository::loggers_map_t loggers_map_t; loggers_repository& repo = loggers_repository::get(); - type_info_wrapper wrapped_key = key; BOOST_LOG_EXPR_IF_MT(log::aux::exclusive_lock_guard< mutex > lock(repo.m_Mutex);) - loggers_map_t::iterator it = repo.m_Loggers.find(wrapped_key); + loggers_map_t::iterator it = repo.m_Loggers.find(key); if (it != repo.m_Loggers.end()) { // There is an instance @@ -72,15 +71,15 @@ BOOST_LOG_API shared_ptr< logger_holder_base > global_storage::get_or_init(std:: { // We have to create a logger instance shared_ptr< logger_holder_base > inst = initializer(); - repo.m_Loggers[wrapped_key] = inst; + repo.m_Loggers[key] = inst; return inst; } } //! Throws the \c odr_violation exception BOOST_LOG_API BOOST_LOG_NORETURN void throw_odr_violation( - std::type_info const& tag_type, - std::type_info const& logger_type, + typeindex::type_index tag_type, + typeindex::type_index logger_type, logger_holder_base const& registered) { char buf[std::numeric_limits< unsigned int >::digits10 + 3]; @@ -88,11 +87,11 @@ BOOST_LOG_API BOOST_LOG_NORETURN void throw_odr_violation( buf[0] = '\0'; std::string str = std::string("Could not initialize global logger with tag \"") + - type_info_wrapper(tag_type).pretty_name() + + tag_type.pretty_name() + "\" and type \"" + - type_info_wrapper(logger_type).pretty_name() + + logger_type.pretty_name() + "\". A logger of type \"" + - type_info_wrapper(registered.logger_type()).pretty_name() + + registered.m_LoggerType.pretty_name() + "\" with the same tag has already been registered at " + registered.m_RegistrationFile + ":" + buf + "."; diff --git a/src/named_scope.cpp b/src/named_scope.cpp index f86c1e2..0e8f95b 100644 --- a/src/named_scope.cpp +++ b/src/named_scope.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -105,7 +106,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { /*! * \return The attribute value type */ - type_info_wrapper get_type() const { return type_info_wrapper(typeid(scope_stack)); } + typeindex::type_index get_type() const { return typeindex::type_id< scope_stack >(); } //! The method is called when the attribute value is passed to another thread (e.g. //! in case of asynchronous logging). The value should ensure it properly owns all thread-specific data.