43 template <
typename _Key,
typename _Tp,
typename _Comp,
typename _Alloc>
48 out.reserve(m.size());
49 for (
auto [key,obj] : m)
55 template <
typename _Key,
typename _Tp,
typename _Comp,
typename _Alloc>
60 out.reserve (m.size());
61 for (
auto [key,obj] : m)
67 template <
typename _Key,
typename _Tp,
typename _Hash,
typename _Eq,
typename _Alloc>
72 out.reserve(m.size());
73 for (
auto [key,obj] : m)
79 template <
typename _Key,
typename _Tp,
typename _Hash,
typename _Eq,
typename _Alloc>
84 out.reserve(m.size());
85 for (
auto [key,obj] : m)
91 template <
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
96 for (
auto [key, value] : map)
104 template<
typename _Key,
typename _Tp,
typename _Key2>
109 out.reserve(m.size());
110 auto range = m.equal_range(key);
111 for (
auto it=range.first ; it!=range.second; ++it)
112 out.push_back(it->second);
120 template <
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
126 for (
auto [key,obj] : m)
127 os <<
"{" << key <<
", " << obj <<
"} ";
128 os <<
"}" << std::flush;
std::ostream & operator<<(std::ostream &os, const CepsMap< _Key, _Tp, _Compare, _Alloc > &m)
Displays the content of a map, if displayable.
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::unordered_multimap< _Key, _Tp, _Hash, _KeyEqual, _Alloc > CepsMultiMap
C++ multimap.
A namespace for all utility methods.
CepsVector< _Tp > getValues(const CepsMultiMap< _Key, _Tp > &m, const _Key2 &key)
extract values from multimap
void destroy(CepsMap< _Key, _Tp, _Compare, _Alloc > &map, CepsBool deleteAll=true)
Deletes all elements of the map properly, even if created with new.
CepsVector< _Tp > valuesOf(const CepsMap< _Key, _Tp, _Comp, _Alloc > &m)
Get the values of a map as a vector.
void destroyObject(_Type &)
Destroy[delete] any type.
CepsVector< _Key > keysOf(const CepsMap< _Key, _Tp, _Comp, _Alloc > &m)
Get the keys of a map as a vector.