sp_typeinfo_.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef BOOST_SMART_PTR_DETAIL_SP_TYPEINFO_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_DETAIL_SP_TYPEINFO_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. // smart_ptr/detail/sp_typeinfo_.hpp
  8. //
  9. // Copyright 2007, 2019 Peter Dimov
  10. //
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. #include <boost/config.hpp>
  15. #if defined( BOOST_NO_TYPEID ) || defined( BOOST_NO_STD_TYPEINFO )
  16. #include <boost/core/typeinfo.hpp>
  17. namespace boost
  18. {
  19. namespace detail
  20. {
  21. typedef boost::core::typeinfo sp_typeinfo_;
  22. } // namespace detail
  23. } // namespace boost
  24. #define BOOST_SP_TYPEID_(T) BOOST_CORE_TYPEID(T)
  25. #else // defined( BOOST_NO_TYPEID ) || defined( BOOST_NO_STD_TYPEINFO )
  26. #include <typeinfo>
  27. namespace boost
  28. {
  29. namespace detail
  30. {
  31. typedef std::type_info sp_typeinfo_;
  32. } // namespace detail
  33. } // namespace boost
  34. #define BOOST_SP_TYPEID_(T) typeid(T)
  35. #endif // defined( BOOST_NO_TYPEID ) || defined( BOOST_NO_STD_TYPEINFO )
  36. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_TYPEINFO_HPP_INCLUDED