nxt.container.traits

Traits used by containers.

TODO: add isUnorderedContainer and isUnorderedRange traits and used to forbid hash algorithms to operate on unordered containers (such as hybrid_hashmap and hybrid_hashmap) and their ranges.

Public Imports

nxt.gc_traits
public import nxt.gc_traits;
Undocumented in source.

Members

Enums

isLvalueAssignable
eponymoustemplate isLvalueAssignable(T, U = T)

Is true iff a T can be a assigned from an U l-value.

shouldBePassedByValue
eponymoustemplate shouldBePassedByValue(T)

Is true iff T can and (for performance reasons) should be passed by value.

Functions

makeInitZeroArray
T[] makeInitZeroArray(size_t length)

Allocate an array of T-elements of length length using allocator.

Templates

ContainerElementType
template ContainerElementType(ContainerType, ElementType)
Undocumented in source.
hasElaborateDestructorNew
template hasElaborateDestructorNew(S)

Variant of hasElaborateDestructor that also checks for destructor when S is a class.

isRvalueAssignable
template isRvalueAssignable(T, U = T)

Is true iff a T can be a assigned from an U r-value Opposite to std.traits.isRvalueAssignable this correctly handles uncopyable types.

isSet
template isSet(T)

Is true iff T is a set like container.

isSetOf
template isSetOf(T, E)

Is true iff T is a set like container with elements of type E.

Variables

isAddress
enum bool isAddress(T);

Is true iff T is a memory address (either a class or a pointer). TODO: Replace with __traits(isAddress, T) when it's added.

shouldMove
enum bool shouldMove(T);

True if the last reference of a T in the scope of its lifetime should be passed by move instead of by copy either because

Meta