Table

Swiss tables internal data structure and functions

This mixin template is used in container struct.

Constructors

this
this()
Undocumented in source.
this
this(Allocator allocator)

Constructor with the Allocator.

this
this(Allocator allocator, size_t capacity)

Constructor taking an initial capacity and the Allocator. Given capacity is automatically normalized to proper value.

this
this(size_t capacity)

Constructor taking an initial capacity. Given capacity is automatically normalized to proper value.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

clear
void clear(bool reuse)

Removes all remaining slots from a container.

dup
Container dup()
rehash
void rehash(size_t cap)

Reorganizes the container in place.

Manifest constants

HeapAlignment
enum HeapAlignment;
Undocumented in source.

Properties

capacity
size_t capacity [@property getter]
hashSeed
size_t hashSeed [@property setter]

Setter for hash seed.

length
size_t length [@property getter]

Parameters

Container

Container type which uses this template

KeyType

Key type for hash.

SlotType

Slot type, e.g. Tuple in Map

Allocator

Allocator type for internal allocation. Default is "shared const Mallocator"

CallGCRange

If true, call GC's addRange/removeRange for stored data

NOTE: This table based containers don't guarantee pointer stability. Range and returned pointers are invalidated after insert/rehash.

Meta

Credits

Internal design and logic are based on abseil's hash map/set. See also Swiss Tables Design Notes and abseil's source