| 34 | } |
| 35 | |
| 36 | void swap(std::vector<unsigned char> &rhs) { |
| 37 | if (m_unownedData) { |
| 38 | m_data.swap(rhs); |
| 39 | rhs.clear(); |
| 40 | rhs.resize(m_unownedSize); |
| 41 | std::copy(m_unownedData, m_unownedData + m_unownedSize, rhs.begin()); |
| 42 | m_unownedData = nullptr; |
| 43 | m_unownedSize = 0; |
| 44 | } else { |
| 45 | m_data.swap(rhs); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | bool operator==(const Binary &rhs) const { |
| 50 | const std::size_t s = size(); |
no test coverage detected