forked from andrewprock/ustl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typeinfo.h
32 lines (29 loc) · 1.33 KB
/
typeinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This file is part of the uSTL library, an STL implementation.
//
// Copyright (c) 2005 by Mike Sharov <[email protected]>
// This file is free software, distributed under the MIT License.
//
// This is gcc's definition of type_info necessary for autogenerated
// type information for exception classes.
#pragma once
#include "uexception.h"
namespace __cxxabiv1 { class __class_type_info; }
namespace std {
class type_info {
public:
type_info (const type_info&) = delete;
type_info& operator= (const type_info&) = delete;
inline virtual ~type_info (void) { }
inline const char* name (void) const { return __name[0] == '*' ? __name + 1 : __name; }
inline bool before (const type_info& v) const { return __name < v.__name; }
inline bool operator==(const type_info& v) const { return __name == v.__name; }
inline bool operator!=(const type_info& v) const { return !operator==(v); }
virtual bool __is_pointer_p (void) const;
virtual bool __is_function_p (void) const;
virtual bool __do_catch (const type_info* __thr_type, void** __thr_obj, unsigned __outer) const;
virtual bool __do_upcast (const __cxxabiv1::__class_type_info* __target, void** __obj_ptr) const;
explicit inline type_info (const char* newname) : __name(newname) { }
protected:
const char* __name;
};
} // namespace std