-xbt_dynar_t sg_hosts_as_dynar() // XBT_ATTRIB_DEPRECATED_v330
-{
- std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
-
- auto last = std::remove_if(begin(list), end(list), [](const simgrid::s4u::Host* host) {
- return not host || not host->get_netpoint() || not host->get_netpoint()->is_host();
- });
- std::sort(begin(list), last,
- [](const simgrid::s4u::Host* a, const simgrid::s4u::Host* b) { return a->get_name() < b->get_name(); });
-
- xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);
- std::for_each(begin(list), last, [res](sg_host_t host) { xbt_dynar_push_as(res, sg_host_t, host); });
- return res;
-}
-