Skip to content

MapSwap

Description

Swap two maps of the same type.

Parameters

Name Direction Description
lhs in,out First map.
rhs in,out Second map.

Success

Returns to the caller. Storage, callbacks, policy, and allocator of lhs and rhs have been exchanged byte-for-byte; neither map’s contents are touched.

Failure

Function cannot fail. Validation of either argument is a caller bug and aborts via LOG_FATAL.

Usage example (Cross-references)

Usage examples (Cross-references)
        result = result && (MapUniqueKeyCount(&first) == 2);
    
        MapSwap(&first, &second);
    
        result = result && MapContainsPair(&first, 9, 90);
Last updated on