| 165 | } |
| 166 | |
| 167 | int peakBits(int n) const |
| 168 | { |
| 169 | assert(n <= 32); |
| 170 | if (n > bits.size()) |
| 171 | throw std::out_of_range("BitArrayView::peakBits() out of range."); |
| 172 | int res = 0; |
| 173 | for (auto i = cur; n > 0; --n, i++) |
| 174 | AppendBit(res, *i); |
| 175 | return res; |
| 176 | } |
| 177 | |
| 178 | int readBits(int n) |
| 179 | { |