Software Design/Use compound operations on map objects

Checklist questions:
 * Can use a compound map operation instead of a sequence of "primitive" operations with the same key?

Maps (dictionaries, associative containers) in many programming languages support compound operations that replace sequences of "primitive" operations like getting a value by a key, putting a value for a key, and removing a key from the map.
 * In Java, there are,  ,  , etc.
 * In C#, there are  and.
 * In C++, there are,  ,  , etc. in   and   containers.

Why
Using compound map operations results in shorter, clearer and less error-prone code because the key is passed as an argument only once:

The semantics of a compound map operation are more apparent than the semantics of a series of "primitive" map operations.

Compound operations might also be faster than equivalent series of "primitive" operations because the implementations can perform only a single lookup in the map during the compound operation.

In concurrent code, using compound, "atomic" updates to a map becomes not just a matter of good style but also of the correctness of the program. For example, see a corresponding item in the Java concurrency checklist.

Why not
Some compound operations on maps accept function objects (see, for example,  in Java). These function objects may be allocated on heap and may later need to be cleaned up by the garbage collector. This may be undesirable in some applications, e. g. those targeting nearly zero garbage allocation rate.

Structural search in IDEs on the IntelliJ platform (Java, C#, C++)
Structural search in IDEs on the IntelliJ platform allows to catch series of map operations which could be replaced by compound operations.

Pattern to find code replaceable with  or   in Java:

It's possible to turn a structural search pattern into an inspection.