From 0b4654d5126aa46bbeab8207a76427e7be26f6c0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 19 Mar 2012 20:54:04 +0000 Subject: [PATCH] let's try operator WType --- panda/src/putil/bitMask.I | 12 ++++++++++++ panda/src/putil/bitMask.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/panda/src/putil/bitMask.I b/panda/src/putil/bitMask.I index 9c7de08321..125bf564d1 100644 --- a/panda/src/putil/bitMask.I +++ b/panda/src/putil/bitMask.I @@ -821,6 +821,18 @@ operator >>= (int shift) { _word >>= shift; } +//////////////////////////////////////////////////////////////////// +// Function: BitMask::operator WType +// Access: Published +// Description: Used to cast this BitMask back into the +// underlying integer type. +//////////////////////////////////////////////////////////////////// +template +INLINE BitMask:: +operator WType () const { + return _word; +} + //////////////////////////////////////////////////////////////////// // Function: BitMask::get_key // Access: Published diff --git a/panda/src/putil/bitMask.h b/panda/src/putil/bitMask.h index fdc3b58fc1..318ced9665 100644 --- a/panda/src/putil/bitMask.h +++ b/panda/src/putil/bitMask.h @@ -118,6 +118,8 @@ PUBLISHED: INLINE void operator <<= (int shift); INLINE void operator >>= (int shift); + INLINE operator WType () const; + INLINE void flood_down_in_place(); INLINE void flood_up_in_place(); INLINE BitMask flood_bits_down() const;