BloombergLP::bdld::Datum::createUninitializedMap

Create an uninitialized key-owning datum map and load it into result.

Synopsis

Declared in <bdld_datum.h>

static
void
createUninitializedMap(
    DatumMutableMapOwningKeysRef* result,
    SizeType capacity,
    SizeType keysCapacity,
    AllocatorType const& allocator);

Description

Load the specified result with a reference to a newly created datum-key-owning map having the specified capacity and keysCapacity, using the specified allocator to supply memory. The behavior is undefined if capacity DatumMapEntry object plus keysCapacity would exceed the addressable memory for the platform. Note that the caller is responsible for filling in elements into the datum-key-owning map, copying the keys into it, and setting its size accordingly. The number of elements in the datum-key-owning map cannot exceed capacity and total size of all the keys cannot exceed keysCapacity. Also note that any elements in the datum-key-owning map that need dynamic memory, should also be allocated with allocator.

Parameters

NameDescription
resultreceives the mutable key-owning map reference
capacitymaximum number of entries the map can hold
keysCapacitytotal key-storage capacity in bytes
allocatormemory allocator to use