File indexing completed on 2025-12-16 09:45:25
0001
0002
0003
0004
0005
0006 #ifndef BOOST_EXCEPTION_C3E1741C754311DDB2834CCA55D89593
0007 #define BOOST_EXCEPTION_C3E1741C754311DDB2834CCA55D89593
0008
0009 #include <boost/config.hpp>
0010 #include <boost/core/typeinfo.hpp>
0011 #include <boost/core/demangle.hpp>
0012 #include <boost/current_function.hpp>
0013 #include <string>
0014 #include <string.h>
0015
0016 #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
0017 #if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
0018 #pragma GCC system_header
0019 #endif
0020 #ifdef __clang__
0021 #pragma clang system_header
0022 #endif
0023 #ifdef _MSC_VER
0024 #pragma warning(push,1)
0025 #endif
0026 #endif
0027
0028 namespace
0029 boost
0030 {
0031 template <class T>
0032 inline
0033 std::string
0034 tag_type_name()
0035 {
0036 #ifdef BOOST_NO_TYPEID
0037 return BOOST_CURRENT_FUNCTION;
0038 #else
0039 return core::demangle(typeid(T*).name());
0040 #endif
0041 }
0042
0043 template <class T>
0044 inline
0045 std::string
0046 type_name()
0047 {
0048 #ifdef BOOST_NO_TYPEID
0049 return BOOST_CURRENT_FUNCTION;
0050 #else
0051 return core::demangle(typeid(T).name());
0052 #endif
0053 }
0054
0055 namespace
0056 exception_detail
0057 {
0058 struct
0059 type_info_
0060 {
0061 core::typeinfo const * type_;
0062
0063 explicit
0064 type_info_( core::typeinfo const & type ):
0065 type_(&type)
0066 {
0067 }
0068
0069 friend
0070 bool
0071 operator<( type_info_ const & a, type_info_ const & b )
0072 {
0073 return a.type_!=b.type_ && strcmp(a.type_->name(), b.type_->name()) < 0;
0074 }
0075 };
0076 }
0077 }
0078
0079 #define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_CORE_TYPEID(T))
0080
0081 #ifndef BOOST_NO_RTTI
0082 #define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
0083 #endif
0084
0085 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
0086 #pragma warning(pop)
0087 #endif
0088 #endif