diff -r 9a10af83cfab -r dc886f1a6155 docs/Writerside/topics/map.h.md --- a/docs/Writerside/topics/map.h.md Sat Nov 01 19:31:48 2025 +0100 +++ b/docs/Writerside/topics/map.h.md Sat Nov 01 19:48:50 2025 +0100 @@ -312,6 +312,18 @@ cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data); + +int cxMapIntersection(CxMap *dst, + const CxMap *src, const CxMap *other, + cx_clone_func clone_func, + const CxAllocator *clone_allocator, + void *data); + +int cxMapListIntersection(CxMap *dst, + const CxMap *src, const CxList *keys, + cx_clone_func clone_func, + const CxAllocator *clone_allocator, + void *data); ``` With `cxMapClone()` you can create deep copies of the values in one map and insert them into another map. @@ -323,6 +335,8 @@ except that they only clone an element from the source map, when the key is _not_ contained in the other map (or list, respectively). This is equivalent to computing the set difference for the set of keys. +Likewise, `cxMapIntersection()` and `cxMapListIntersection()` only clone an element from the source map, +when the key is contained in _both_ collections. Refer to the documentation of the [clone-function callback](allocator.h.md#clone-function) to learn how to implement it.