| | | | | |

Defining Class BitVector

namespace fsu
{
class BitVector
{
public:
  void Set   (size_t index);        // make index bit = 1
  void Set   ();                    // make all bits = 1
  void Unset (size_t index);        // make index bit = 0
  void Unset ();                    // make all bits = 0
  void Flip  (size_t index);        // flip index bit (change value of bit)
  void Flip  ();                    // flip all bits 
  bool Test  (size_t index) const;  // return index bit value

  explicit BitVector  (size_t);     // construct a BitVector with specified size
           BitVector  (const BitVector&); // copy constructor      
           ~BitVector ();           // destructor
  BitVector& operator = (const BitVector& a);  // assignment operator
  size_t Size () const;             // return size of bitvector
  ...
};
} // namespace fsu

| | Top of Page | 2. A BitVector Class - 4 of 10