! * \brief insert all elements in another set into this */
| 64 | * \brief insert all elements in another set into this |
| 65 | */ |
| 66 | void merge_from(const SharedSet& rhs) { |
| 67 | if (!rhs) |
| 68 | return; |
| 69 | |
| 70 | if (m_own_ptr) { |
| 71 | auto pct = m_container; |
| 72 | for (auto&& i : *rhs.m_container) |
| 73 | pct->insert(i); |
| 74 | return; |
| 75 | } |
| 76 | |
| 77 | if (!m_container) { |
| 78 | m_container = rhs.m_container; |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | for (auto&& i : *rhs.m_container) { |
| 83 | if (!m_container->count(i)) { |
| 84 | ensure_own(); |
| 85 | m_container->insert(i); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /*! |
| 91 | * \brief membership test |
no test coverage detected