docs/Writerside/topics/map.h.md

changeset 1579
0393c67556ec
parent 1489
185dc2a4b45c
child 1587
7156d6699410
equal deleted inserted replaced
1578:fb73c4d69317 1579:0393c67556ec
282 Otherwise, the iterator shall yield pointers to the map's memory where the value is stored. 282 Otherwise, the iterator shall yield pointers to the map's memory where the value is stored.
283 283
284 It is always safe to call the above functions on a `NULL`-pointer. 284 It is always safe to call the above functions on a `NULL`-pointer.
285 In that case, the returned iterator will behave like an iterator over an empty map. 285 In that case, the returned iterator will behave like an iterator over an empty map.
286 286
287 ## Compare
288
289 ```C
290 #include <cx/map.h>
291
292 int cxMapCompare(const CxMap *map, const CxMap *other);
293 ```
294
295 Arbitrary maps can be compared with `cxMapCompare()`.
296 That means, for example, you can compare a [hash map](hash_map.h.md) with the map aspect of a [key/value list](kv_list.h.md).
297
298 The return value of `cxMapCompare()` is zero if the lists contain the same keys and their values are pairwise equivalent, according to the map's compare function.
299 If the `map` contains fewer keys than the `other` map, the function returns a negative value, and if it contains more values, it returns a positive value, respectively.
300 When both maps contain the same number of keys but differ in either a key or a value, the return value is non-zero, but otherwise unspecified.
301
287 ## Clone 302 ## Clone
288 303
289 ```C 304 ```C
290 #include <cx/allocator.h> 305 #include <cx/allocator.h>
291 306

mercurial