#ifndef UTILS_FUNCTIONS_HPP #define UTILS_FUNCTIONS_HPP #include #include template gd::Dictionary hashmap_to_dictionary(gd::HashMap const &map) { gd::Dictionary dict{}; for(gd::KeyValue const &kvp : map) dict[kvp.key] = kvp.value; return dict; } template gd::HashMap dictionary_to_hashmap(gd::Dictionary const &dict) { gd::HashMap map{}; gd::Array keys{dict.keys()}; for(size_t i = 0; i < keys.size(); ++i) map.insert(keys[i], dict[keys[i]]); return map; } #endif // !UTILS_FUNCTIONS_HPP