32 #ifdef _GLIBCXX_SYSHDR 33 #pragma GCC system_header 37 #if __cplusplus >= 201103L 41 #define __glibcxx_want_constexpr_typeinfo 44 #pragma GCC visibility push(default) 50 class __class_type_info;
71 #ifndef __GXX_MERGED_TYPEINFO_NAMES 73 #define __GXX_MERGED_TYPEINFO_NAMES 0 77 #ifndef __GXX_TYPEINFO_EQUALITY_INLINE 79 # define __GXX_TYPEINFO_EQUALITY_INLINE 0 81 # define __GXX_TYPEINFO_EQUALITY_INLINE 1 104 const char*
name() const _GLIBCXX_NOEXCEPT
105 {
return __name[0] ==
'*' ? __name + 1 : __name; }
109 bool before(
const type_info& __arg)
const _GLIBCXX_NOEXCEPT;
112 bool operator==(
const type_info& __arg)
const _GLIBCXX_NOEXCEPT;
114 #if __cpp_impl_three_way_comparison < 201907L 115 bool operator!=(
const type_info& __arg)
const _GLIBCXX_NOEXCEPT
116 {
return !operator==(__arg); }
119 #if __cplusplus >= 201103L 120 size_t hash_code()
const noexcept
122 # if !__GXX_MERGED_TYPEINFO_NAMES 123 return _Hash_bytes(name(), __builtin_strlen(name()),
124 static_cast<size_t>(0xc70f6907UL));
126 return reinterpret_cast<size_t>(__name);
132 virtual bool __is_pointer_p()
const;
135 virtual bool __is_function_p()
const;
143 virtual bool __do_catch(
const type_info *__thr_type,
void **__thr_obj,
144 unsigned __outer)
const;
147 virtual bool __do_upcast(
const __cxxabiv1::__class_type_info *__target,
148 void **__obj_ptr)
const;
153 explicit type_info(
const char *__n): __name(__n) { }
157 #if __cplusplus >= 201103L 165 #if ! __GXX_TYPEINFO_EQUALITY_INLINE 166 bool __equal(
const type_info&)
const _GLIBCXX_NOEXCEPT;
170 #if __GXX_TYPEINFO_EQUALITY_INLINE 172 type_info::before(
const type_info& __arg)
const _GLIBCXX_NOEXCEPT
174 #if !__GXX_MERGED_TYPEINFO_NAMES 178 if (__name[0] !=
'*' || __arg.__name[0] !=
'*')
179 return __builtin_strcmp (__name, __arg.__name) < 0;
188 return __name < __arg.__name;
192 #if __GXX_TYPEINFO_EQUALITY_INLINE || __cplusplus > 202002L 193 # if ! __GXX_TYPEINFO_EQUALITY_INLINE 194 [[__gnu__::__always_inline__]]
196 _GLIBCXX23_CONSTEXPR
inline bool 197 type_info::operator==(
const type_info& __arg)
const _GLIBCXX_NOEXCEPT
199 if (std::__is_constant_evaluated())
200 return this == &__arg;
202 if (__name == __arg.__name)
205 #if !__GXX_TYPEINFO_EQUALITY_INLINE 207 return __equal(__arg);
208 #elif !__GXX_MERGED_TYPEINFO_NAMES 210 return __name[0] !=
'*' && __builtin_strcmp (__name, __arg.
name()) == 0;
227 _GLIBCXX26_CONSTEXPR
bad_cast() _GLIBCXX_USE_NOEXCEPT { }
229 #if __cplusplus >= 202400L 230 [[__gnu__::__gnu_inline__]]
231 constexpr
inline virtual ~
bad_cast() noexcept {}
233 [[__gnu__::__gnu_inline__]]
234 constexpr
inline virtual const char* what()
const noexcept
236 return "std::bad_cast";
241 virtual ~
bad_cast() _GLIBCXX_USE_NOEXCEPT;
244 virtual const char* what()
const _GLIBCXX_USE_NOEXCEPT;
255 _GLIBCXX26_CONSTEXPR
bad_typeid () _GLIBCXX_USE_NOEXCEPT { }
257 #if __cplusplus >= 202400L 258 [[__gnu__::__gnu_inline__]]
259 constexpr
inline virtual ~
bad_typeid() noexcept {}
261 [[__gnu__::__gnu_inline__]]
262 constexpr
inline virtual const char* what()
const noexcept
264 return "std::bad_typeid";
272 virtual const char* what()
const _GLIBCXX_USE_NOEXCEPT;
279 #pragma GCC visibility pop const char * name() const noexcept
ISO C++ entities toplevel namespace is std.
Thrown during incorrect typecasting.If you attempt an invalid dynamic_cast expression, an instance of this class (or something derived from this class) is thrown.
Base class for all library exceptions.
Thrown when a NULL pointer in a typeid expression is used.