Find all regions with a specific attribute value.
212 {
213 std::vector<Region> result;
214 std::ranges::copy_if(
regions, std::back_inserter(result),
215 [&key, &value](const Region& region) {
216 auto it = region.attributes.find(key);
217
218 if (it == region.attributes.end() || it->second.type() != value.type())
219 return false;
220
221 if (value.type() == typeid(std::string))
222 return any_equal<std::string>(it->second, value);
223 if (value.type() == typeid(double))
224 return any_equal<double>(it->second, value);
225 if (value.type() == typeid(int))
226 return any_equal<int>(it->second, value);
227 if (value.type() == typeid(bool))
228 return any_equal<bool>(it->second, value);
229 if (value.type() == typeid(float))
230 return any_equal<float>(it->second, value);
231 if (value.type() == typeid(uint32_t))
232 return any_equal<uint32_t>(it->second, value);
233 if (value.type() == typeid(int64_t))
234 return any_equal<int64_t>(it->second, value);
235 if (value.type() == typeid(uint64_t))
236 return any_equal<uint64_t>(it->second, value);
237 return false;
238 });
239 return result;
240 }
std::vector< Region > regions
Collection of regions belonging to this group.