home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_09 / allison / bitstr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-10  |  521 b   |  27 lines

  1. // bitstr.h:    The C++ bitstring class
  2.  
  3. class bitstring
  4. {
  5. public:
  6.     // Helper class for operator[]
  7.     class bitref
  8.     {
  9.         friend class bitstring;
  10.  
  11.         bitstring &bs;
  12.         size_t bit;
  13.         bitref(bitstring& bs_, size_t bit_);
  14.  
  15.     public:
  16.         int operator=(int);
  17.         operator int();
  18.     };
  19.  
  20.     // Subscripting
  21.     bitref operator[](size_t pos);
  22.  
  23.     // The definition of bitstring continues here...
  24.     // (See "Bit Manipulation in C++, Part 1", CUJ, Dec. 1993)
  25. };
  26.  
  27.