aboutsummaryrefslogtreecommitdiff
path: root/cutl/compiler/type-id.ixx
blob: 2e9f9635b445c70da2467a9972f6cb379a9c1a80 (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
// file      : cutl/compiler/type-id.ixx
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
// license   : MIT; see accompanying LICENSE file

namespace cutl
{
  namespace compiler
  {
    inline
    type_id::
    type_id (std::type_info const& ti)
        : ti_ (&ti)
    {
    }

    inline
    char const* type_id::
    name () const
    {
      return ti_->name ();
    }

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

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

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