From 3f80c96a81dc10692062db793accc40539882deb Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 22 Mar 2007 20:30:49 +0000 Subject: [PATCH] Add operator| for eventxx::type. Now it's possible to do eventxx::READ | eventxx::PERSIST and this yieds another eventxx::type, not an int. --- eventxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eventxx b/eventxx index 94ee113..6d08fcc 100644 --- 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. * -- 2.43.0