MapInsertL
MapInsertL
Description
Insert a new key/value pair using l-value semantics. Duplicate keys are allowed and append another value for the same key.
Ownership of key and value is transferred to the map if the corresponding copy-init callbacks are not set.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Hash map. |
key |
in | Key to insert. |
value |
in | Value to insert. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.Insert.c:68:
int value = 84;
MapInsertL(&map, key, value);
bool result = (key == 0) && (value == 0);- In
Map.Ops.c:55:
int value_count = 0;
MapInsertL(&map, key, value);
MapInsertL(&map, key, second_value);- In
Map.Ops.c:56:
MapInsertL(&map, key, value);
MapInsertL(&map, key, second_value);
bool result = (key == key_buf) && (value == value_buf) && (second_value == second_value_buf);- In
Insert.h:83:
/// Insert by default behaves like `MapInsertL`.
///
#define MapInsert(m, in_key, in_value) MapInsertL((m), (in_key), (in_value))
///
Last updated on