Skip to content

MapRemovePair

MapRemovePair

Description

Remove and destroy the first matching key/value pair.

Parameters

Name Direction Description
m in,out Map.
key in Key to remove.
value in Value to remove.

Success

true if the pair existed and was removed.

Failure

false

Usage example (Cross-references)

Usage examples (Cross-references)
    
        if (!map->value_compare) {
            LOG_FATAL("MapRemovePair requires a value comparator");
        }
        MapInsertR(&map, 5, 52);
    
        bool result = MapRemovePair(&map, 5, 51);
        result      = result && MapContainsPair(&map, 5, 50);
        result      = result && !MapContainsPair(&map, 5, 51);
Last updated on