]> git.llucax.com Git - software/eventxx.git/commitdiff
Add operator| for eventxx::type.
authorLeandro Lucarella <llucarella@integratech.com.ar>
Thu, 22 Mar 2007 20:30:49 +0000 (20:30 +0000)
committerLeandro Lucarella <llucarella@integratech.com.ar>
Thu, 22 Mar 2007 20:30:49 +0000 (20:30 +0000)
Now it's possible to do eventxx::READ | eventxx::PERSIST and this yieds another
eventxx::type, not an int.

eventxx

diff --git a/eventxx b/eventxx
index 94ee1136911125e230063e9eabc3848a0f38fc9b..6d08fccdc59d651238a4a9bd36f288c8630cb1ea 100644 (file)
--- a/eventxx
+++ b/eventxx
@@ -410,6 +410,13 @@ enum type
        PERSIST = EV_PERSIST  ///< Not really an event, is an event modifier.
 };
 
+type operator| (const type& t1, const type& t2)
+{
+       int r = t1 | t2;
+       return *reinterpret_cast< type* >(&r);
+}
+
+
 /**
  * Basic event from which all events derive.
  *