aboutsummaryrefslogtreecommitdiff
path: root/cutl/compiler/type-id.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-06 12:52:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-06 12:52:53 +0200
commitcb9ea47e7825b5073d4d645afb94f6326cb7cf4d (patch)
tree201c215b08df918924153a60520046c294438a6b /cutl/compiler/type-id.ixx
Start the libcutl repository
Diffstat (limited to 'cutl/compiler/type-id.ixx')
-rw-r--r--cutl/compiler/type-id.ixx45
1 files changed, 45 insertions, 0 deletions
diff --git a/cutl/compiler/type-id.ixx b/cutl/compiler/type-id.ixx
new file mode 100644
index 0000000..4092d6d
--- /dev/null
+++ b/cutl/compiler/type-id.ixx
@@ -0,0 +1,45 @@
+// file : cutl/compiler/type-id.ixx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009 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_);
+ }
+ }
+}