From: Leandro Lucarella Date: Thu, 22 Mar 2007 20:30:49 +0000 (+0000) Subject: Add operator| for eventxx::type. X-Git-Tag: 0.3~5 X-Git-Url: https://git.llucax.com/software/eventxx.git/commitdiff_plain/3f80c96a81dc10692062db793accc40539882deb?ds=inline Add operator| for eventxx::type. Now it's possible to do eventxx::READ | eventxx::PERSIST and this yieds another eventxx::type, not an int. --- 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. *