diff options
Diffstat (limited to 'libcutl/compiler/type-id.ixx')
-rw-r--r-- | libcutl/compiler/type-id.ixx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libcutl/compiler/type-id.ixx b/libcutl/compiler/type-id.ixx new file mode 100644 index 0000000..017e29a --- /dev/null +++ b/libcutl/compiler/type-id.ixx @@ -0,0 +1,43 @@ +// file : libcutl/compiler/type-id.ixx +// 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_); + } + } +} |