lu.traits

Various compile-time traits and cleverness.

Members

Enums

MixinScope
enum MixinScope

The types of scope into which a mixin template may be mixed in.

isMerelyArray
eponymoustemplate isMerelyArray(S)

True if a type is a non-string array; otherwise false.

isMutableArrayOfImmutables
eponymoustemplate isMutableArrayOfImmutables(Array : Element[], Element)

Evaluates whether or not a passed array type is a mutable array of immutable elements, such as a string.

isStruct
eponymoustemplate isStruct(T)

Eponymous template that is true if the passed type is a struct.

isTrulyString
eponymoustemplate isTrulyString(S)

True if a type is string, dstring or wstring; otherwise false.

stringOfTypeOf
eponymoustemplate stringOfTypeOf(T)

The string representation of a type. Non-alias parameter overload.

stringOfTypeOf
eponymoustemplate stringOfTypeOf(alias T)

The string representation of the type of something. Alias parameter overload.

udaIndexOf
eponymoustemplate udaIndexOf(alias symbol, T)

Returns the index of a given UDA, as annotated on a symbol.

Mixin templates

MixinConstraints
mixintemplate MixinConstraints(MixinScope mixinScope, string mixinName = "a constrained mixin")

Mixes in constraints into another mixin template, to provide static guarantees that it is not mixed into a type of scope other than the one specified.

Templates

CategoryName
template CategoryName(alias sym)

Provides string representations of the category of a symbol, where such is not a fundamental primitive variable but a module, a function, a delegate, a class or a struct.

TakesParams
template TakesParams(alias fun, P...)

Given a function and a tuple of types, evaluates whether that function could be called with that tuple as parameters. Alias version (works on functions, not function types.)

TakesParams
template TakesParams(Fun, P...)

Given a function and a tuple of types, evaluates whether that function could be called with that tuple as parameters. Non-alias version (works on types).

UnqualArray
template UnqualArray(QualArray : QualType[], QualType)

Given an array of qualified elements, aliases itself to one such of unqualified elements.

UnqualArray
template UnqualArray(QualArray : QualElem[QualKey], QualElem, QualKey)

Given an associative array with elements that have a storage class, aliases itself to an associative array with elements without the storage classes.

UnqualArray
template UnqualArray(QualArray : QualElem[QualKey], QualElem, QualKey)

Given an associative array of arrays with a storage class, aliases itself to an associative array with array elements without the storage classes.

allOfSameType
template allOfSameType(values...)

Aliases itself to whether or not all passed values are of the same type.

isEnum
template isEnum(T)

Aliases itself to whether or not a type is an enum.

isEnum
template isEnum(alias T)

Aliases itself to whether or not a symbol is of a type is an enum.

isImplicitlyConvertibleToSize_t
template isImplicitlyConvertibleToSize_t(T)

Aliases itself to whether or not a type is implicitly convertible to size_t.

isImplicitlyConvertibleToSize_t
template isImplicitlyConvertibleToSize_t(alias T)

Aliases itself to whether or not a symbol is of a type that is implicitly convertible to size_t.

isSerialisable
template isSerialisable(alias sym)

Eponymous template bool of whether a variable can be treated as a mutable variable, like a fundamental integral, and thus be serialised. Overload that takes a non-type symbol.

isSerialisable
template isSerialisable(T)

Eponymous template bool of whether a variable can be treated as a mutable variable, like a fundamental integral, and thus be serialised. Overload that takes a type.

stringofParams
template stringofParams(alias fun)

Produces a string of the unqualified parameters of the passed function alias.

Meta