| 39 | } |
| 40 | |
| 41 | bool BitVector::Or(const BitVector& other) { |
| 42 | auto this_it = this->bits_.begin(); |
| 43 | auto other_it = other.bits_.begin(); |
| 44 | bool modified = false; |
| 45 | |
| 46 | while (this_it != this->bits_.end() && other_it != other.bits_.end()) { |
| 47 | auto temp = *this_it | *other_it; |
| 48 | if (temp != *this_it) { |
| 49 | modified = true; |
| 50 | *this_it = temp; |
| 51 | } |
| 52 | ++this_it; |
| 53 | ++other_it; |
| 54 | } |
| 55 | |
| 56 | if (other_it != other.bits_.end()) { |
| 57 | modified = true; |
| 58 | this->bits_.insert(this->bits_.end(), other_it, other.bits_.end()); |
| 59 | } |
| 60 | |
| 61 | return modified; |
| 62 | } |
| 63 | |
| 64 | std::ostream& operator<<(std::ostream& out, const BitVector& bv) { |
| 65 | out << "{"; |