lu.traits

Various compile-time traits and cleverness.

Public Imports

std.traits
public import std.traits : getSymbolsByUDA;

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.

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.

TestMixinConstrainedToClass
mixintemplate TestMixinConstrainedToClass()
Undocumented in source.
TestMixinConstrainedToClassOrStruct
mixintemplate TestMixinConstrainedToClassOrStruct()
Undocumented in source.
TestMixinConstrainedToFunctions
mixintemplate TestMixinConstrainedToFunctions()
Undocumented in source.
TestMixinConstrainedToStruct
mixintemplate TestMixinConstrainedToStruct()
Undocumented in source.

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. Qualifiers like const and immutable are skipped, which may make it a poor choice if dealing with functions that require such arguments.

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.

getSymbolsByUDA
template getSymbolsByUDA(alias symbol, alias attribute)

Provide a non-2.088, non-2.089 std.traits.getSymbolsByUDA.

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.

stringofParams
template stringofParams(alias fun)

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

Meta