- memset(&host, 0, sizeof(host));
- host.id = host_id;
- if ((cluster->properties != nullptr) && (not xbt_dict_is_empty(cluster->properties))) {
- xbt_dict_cursor_t cursor=nullptr;
- char *key;
- char* data;
- host.properties = xbt_dict_new_homogeneous(free);
-
- xbt_dict_foreach(cluster->properties,cursor,key,data) {
- xbt_dict_set(host.properties, key, xbt_strdup(data), nullptr);
- }
+ host.id = host_id.c_str();
+ if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
+ host.properties = new std::map<std::string, std::string>;
+
+ for (auto const& elm : *cluster->properties)
+ host.properties->insert({elm.first, elm.second});