summaryrefslogtreecommitdiff
path: root/libcult/cult/rtti/type-id.ixx
blob: cc77d5f36512854887056464b95a569d40b66757 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
// file      : cult/rtti/type-id.ixx
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2005-2010 Boris Kolpackov
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

namespace Cult
{
  namespace RTTI
  {
    inline
    TypeId::
    TypeId (std::type_info const& ti)
        : ti_ (&ti)
    {
    }

    inline
    Char const* TypeId::
    name () const
    {
      return ti_->name ();
    }

    inline
    Boolean
    operator== (TypeId const& x, TypeId const& y)
    {
      return *x.ti_ == *y.ti_;
    }

    inline
    Boolean
    operator!= (TypeId const& x, TypeId const& y)
    {
      return *x.ti_ != *y.ti_;
    }

    inline
    Boolean
    operator< (TypeId const& x, TypeId const& y)
    {
      return x.ti_->before (*y.ti_);
    }
  }
}