| 1 |
// file : cutl/compiler/type-id.hxx |
| 2 |
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC |
| 3 |
// license : MIT; see accompanying LICENSE file |
| 4 |
|
| 5 |
#ifndef CUTL_COMPILER_TYPE_ID_HXX |
| 6 |
#define CUTL_COMPILER_TYPE_ID_HXX |
| 7 |
|
| 8 |
#include <typeinfo> // std::type_info |
| 9 |
|
| 10 |
#include <cutl/details/export.hxx> |
| 11 |
|
| 12 |
namespace cutl |
| 13 |
{ |
| 14 |
namespace compiler |
| 15 |
{ |
| 16 |
class LIBCUTL_EXPORT type_id |
| 17 |
{ |
| 18 |
public: |
| 19 |
template<typename X> |
| 20 |
type_id (X const volatile&); |
| 21 |
|
| 22 |
type_id (std::type_info const&); |
| 23 |
|
| 24 |
public: |
| 25 |
char const* |
| 26 |
name () const; |
| 27 |
|
| 28 |
friend bool |
| 29 |
operator== (type_id const&, type_id const&); |
| 30 |
|
| 31 |
friend bool |
| 32 |
operator!= (type_id const&, type_id const&); |
| 33 |
|
| 34 |
friend bool |
| 35 |
operator< (type_id const&, type_id const&); |
| 36 |
|
| 37 |
private: |
| 38 |
std::type_info const* ti_; |
| 39 |
}; |
| 40 |
|
| 41 |
typedef type_id type_id_t; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
#include <cutl/compiler/type-id.ixx> |
| 46 |
#include <cutl/compiler/type-id.txx> |
| 47 |
|
| 48 |
#endif // CUTL_COMPILER_TYPE_ID_HXX |