| 240 | |
| 241 | // Setup a bit proxy so that we can use operator[] on bit arrays as a lvalue. |
| 242 | class cBitProxy { |
| 243 | private: |
| 244 | cBitArray & array; |
| 245 | int index; |
| 246 | public: |
| 247 | cBitProxy(cBitArray & _array, int _idx) : array(_array), index(_idx) {;} |
| 248 | |
| 249 | inline cBitProxy & operator=(bool b); // lvalue handling... |
| 250 | inline operator bool() const; // rvalue handling... |
| 251 | }; |
| 252 | friend class cBitProxy; |
| 253 | public: |
| 254 | cBitArray() : array_size(0) { ; } |