diff options
author | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
commit | a15cf65c44d5c224169c32ef5495b68c758134b7 (patch) | |
tree | 3419f58fc8e1b315ba8171910ee044c5d467c162 /libcult/cult/rtti/type-id.hxx |
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'libcult/cult/rtti/type-id.hxx')
-rw-r--r-- | libcult/cult/rtti/type-id.hxx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libcult/cult/rtti/type-id.hxx b/libcult/cult/rtti/type-id.hxx new file mode 100644 index 0000000..21494b1 --- /dev/null +++ b/libcult/cult/rtti/type-id.hxx @@ -0,0 +1,52 @@ +// file : cult/rtti/type-id.hxx +// author : Boris Kolpackov <boris@kolpackov.net> +// copyright : Copyright (c) 2005-2010 Boris Kolpackov +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef CULT_RTTI_TYPE_ID_HXX +#define CULT_RTTI_TYPE_ID_HXX + +#include <cult/types/fundamental.hxx> + +#include <typeinfo> // std::type_info + +namespace Cult +{ + namespace RTTI + { + class TypeId + { + public: + template<typename X> + TypeId (X const volatile&); + + TypeId (std::type_info const&); + + public: + Char const* + name () const; + + friend Boolean + operator== (TypeId const&, TypeId const&); + + friend Boolean + operator!= (TypeId const&, TypeId const&); + + friend Boolean + operator< (TypeId const&, TypeId const&); + + /* + friend std::ostream& + operator << (std::ostream& os, TypeId const& t); + */ + + private: + std::type_info const* ti_; + }; + } +} + +#include <cult/rtti/type-id.ixx> +#include <cult/rtti/type-id.txx> + +#endif // CULT_RTTI_TYPE_ID_HXX |