src/main.h

changeset 149
008989bc7d6e
parent 148
e1ced2523cad
equal deleted inserted replaced
148:e1ced2523cad 149:008989bc7d6e
224 QMap<K, V>, 224 QMap<K, V>,
225 MapItemsIterator<K, const V, typename QMap<K, V>::iterator> 225 MapItemsIterator<K, const V, typename QMap<K, V>::iterator>
226 >{map}; 226 >{map};
227 } 227 }
228 228
229 template<typename K, typename V, typename Fn>
230 void mapapply(const QMap<K, V>& map, Fn fn)
231 {
232 for (
233 typename QMap<K, V>::const_iterator it = map.constBegin();
234 it != map.constEnd();
235 ++it
236 ) {
237 fn(it.key(), it.value());
238 }
239 }
240
241 #define MAP_PARMS(map) decltype(map)::key_type const& key, decltype(map)::mapped_type& value
242 #define MAP_CPARMS(map) decltype(map)::key_type const& key, decltype(map)::mapped_type const& value
243
229 template<typename T, typename IdentifierType> 244 template<typename T, typename IdentifierType>
230 struct TypeValue 245 struct TypeValue
231 { 246 {
232 T value; 247 T value;
233 bool operator==(TypeValue<T, IdentifierType> other) const 248 bool operator==(TypeValue<T, IdentifierType> other) const

mercurial