5 #ifndef BPP_UTILS_MAPTOOLS_H 6 #define BPP_UTILS_MAPTOOLS_H 26 template<
class Key,
class T,
class Cmp >
27 static std::vector<Key>
getKeys(
const std::map<Key, T, Cmp>& myMap)
29 std::vector<Key> keys;
30 for (
typename std::map<Key, T>::const_iterator i = myMap.begin(); i != myMap.end(); i++)
32 keys.push_back(i->first);
43 template<
class Key,
class T >
44 static std::vector<Key>
getKeys(
const std::map<Key, T>& myMap)
46 std::vector<Key> keys;
47 for (
typename std::map<Key, T>::const_iterator i = myMap.begin(); i != myMap.end(); i++)
49 keys.push_back(i->first);
60 template<
class Key,
class T,
class Cmp >
61 static std::vector<T>
getValues(
const std::map<Key, T, Cmp>& myMap)
63 std::vector<T> values;
64 for (
typename std::map<Key, T>::const_iterator i = myMap.begin(); i != myMap.end(); i++)
66 values.push_back(i->second);
77 template<
class Key,
class T >
78 static std::vector<T>
getValues(
const std::map<Key, T>& myMap)
80 std::vector<T> values;
81 for (
typename std::map<Key, T>::const_iterator i = myMap.begin(); i != myMap.end(); i++)
83 values.push_back(i->second);
89 #endif // BPP_UTILS_MAPTOOLS_H