| 190 | } |
| 191 | |
| 192 | void ProgramMemory::erase_if(const std::function<bool(const ExprIdToken&)>& pred) |
| 193 | { |
| 194 | if (mValues->empty()) |
| 195 | return; |
| 196 | |
| 197 | // TODO: how to delay until we actually modify? |
| 198 | copyOnWrite(); |
| 199 | |
| 200 | for (auto it = mValues->begin(); it != mValues->end();) { |
| 201 | if (pred(it->first)) |
| 202 | it = mValues->erase(it); |
| 203 | else |
| 204 | ++it; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | void ProgramMemory::swap(ProgramMemory &pm) noexcept |
| 209 | { |
no test coverage detected