diff options
author | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
commit | be8b04496302184c6e8f04d6179f9c3afc50aeb6 (patch) | |
tree | 726e2468c0c07add773c0dbd86ab6386844259ae /gcc/cp/inc/typeinfo |
initial commit
Diffstat (limited to 'gcc/cp/inc/typeinfo')
-rwxr-xr-x | gcc/cp/inc/typeinfo | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/cp/inc/typeinfo b/gcc/cp/inc/typeinfo new file mode 100755 index 0000000..9347849 --- /dev/null +++ b/gcc/cp/inc/typeinfo @@ -0,0 +1,58 @@ +// RTTI support for -*- C++ -*- +// Copyright (C) 1994, 95-97, 1998 Free Software Foundation + +#ifndef __TYPEINFO__ +#define __TYPEINFO__ + +#pragma interface "typeinfo" + +#include <exception> + +extern "C++" { + +namespace std { + +class type_info { +private: + // assigning type_info is not supported. made private. + type_info& operator= (const type_info&); + type_info (const type_info&); + +protected: + explicit type_info (const char *n): _name (n) { } + + const char *_name; + +public: + // destructor + virtual ~type_info (); + + bool before (const type_info& arg) const; + const char* name () const + { return _name; } + bool operator== (const type_info& arg) const; + bool operator!= (const type_info& arg) const; +}; + +inline bool type_info:: +operator!= (const type_info& arg) const +{ + return !operator== (arg); +} + +class bad_cast : public exception { +public: + bad_cast() { } + virtual ~bad_cast() { } +}; + +class bad_typeid : public exception { + public: + bad_typeid () { } + virtual ~bad_typeid () { } +}; + +} // namespace std + +} // extern "C++" +#endif |