2 // Copyright 2013-2022 Antony Polukhin.
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_TYPE_INDEX_CTTI_REGISTER_CLASS_HPP
10 #define BOOST_TYPE_INDEX_CTTI_REGISTER_CLASS_HPP
12 /// \file ctti_register_class.hpp
13 /// \brief Contains BOOST_TYPE_INDEX_REGISTER_CLASS macro implementation that uses boost::typeindex::ctti_type_index.
14 /// Not intended for inclusion from user's code.
16 #include <boost/type_index/ctti_type_index.hpp>
18 #ifdef BOOST_HAS_PRAGMA_ONCE
22 namespace boost { namespace typeindex { namespace detail {
25 inline const ctti_data& ctti_construct_typeid_ref(const T*) BOOST_NOEXCEPT {
26 return ctti_construct<T>();
29 }}} // namespace boost::typeindex::detail
32 #define BOOST_TYPE_INDEX_REGISTER_CLASS \
33 virtual const boost::typeindex::detail::ctti_data& boost_type_index_type_id_runtime_() const BOOST_NOEXCEPT { \
34 return boost::typeindex::detail::ctti_construct_typeid_ref(this); \
39 #endif // BOOST_TYPE_INDEX_CTTI_REGISTER_CLASS_HPP