gcc_pure static bool CompareAirspaceVectors(const AirspacesInterface::AirspaceVector &a, const AirspacesInterface::AirspaceVector &b) { return a.size() == b.size() && std::is_permutation(a.begin(), a.end(), b.begin(), AirspacePointersEquals); }
void AirspaceNearestSort::populate_queue(const Airspaces &airspaces, const fixed range) { AirspacesInterface::AirspaceVector vectors = airspaces.scan_range(m_location, range, m_condition); for (auto v = vectors.begin(); v != vectors.end(); ++v) { const AbstractAirspace *as = v->get_airspace(); if (as != NULL) { const AirspaceInterceptSolution ais = solve_intercept(*as); const fixed value = metric(ais); if (!negative(value)) { m_q.push(std::make_pair(m_reverse? -value:value, std::make_pair(ais, *v))); } } } }