tango.core.Traits

The traits module defines tools useful for obtaining detailed compile-time information about a type. Please note that the mixed naming scheme used in this module is intentional. Templates which evaluate to a type follow the naming convention used for types, and templates which evaluate to a value follow the naming convention used for functions.

License:

BSD style: see license.txt

Authors:

Sean Kelly, Fawzi Mohamed, Abscissa
template BaseTypeOf(T)
Strips the qualifiers from a type
template InoutTypeOf(T, M)
Computes the effective type that inout would have if you have it two parameters of difference constness
template isStringType(T)
Evaluates to true if T is char[], wchar[], or dchar[].
template isCharType(T)
Evaluates to true if T is char, wchar, or dchar.
template isSignedIntegerType(T)
Evaluates to true if T is a signed integer type.
template isUnsignedIntegerType(T)
Evaluates to true if T is an unsigned integer type.
template isIntegerType(T)
Evaluates to true if T is a signed or unsigned integer type.
template isRealType(T)
Evaluates to true if T is a real floating-point type.
template isComplexType(T)
Evaluates to true if T is a complex floating-point type.
template isImaginaryType(T)
Evaluates to true if T is an imaginary floating-point type.
template isFloatingPointType(T)
Evaluates to true if T is any floating-point type: real, complex, or imaginary.
template isAtomicType(T)
true if T is an atomic type
template ComplexTypeOf(T)
complex type for the given type
template RealTypeOf(T)
real type for the given type
template ImaginaryTypeOf(T)
imaginary type for the given type
template MaxPrecTypeOf(T)
type with maximum precision
template isPointerType(T)
Evaluates to true if T is a pointer type.
template isReferenceType(T)
Evaluates to true if T is a a pointer, class, interface, or delegate.
template isDynamicArrayType(T)
Evaulates to true if T is a dynamic array type.
template isStaticArrayType(T : T[U], size_t U)
Evaluates to true if T is a static array type.
template isArrayType(T)
true for array types
template isAssocArrayType(T)
Evaluates to true if T is an associative array type.
template isCallableType(T)
Evaluates to true if T is a function, function pointer, delegate, or callable object.
template ReturnTypeOf(Fn)
Evaluates to the return type of Fn. Fn is required to be a callable type.
template ExprTypeOf(Expr)
Returns the type that a T would evaluate to in an expression. Expr is not required to be a callable type
template ReturnTypeOf(alias fn)
Evaluates to the return type of fn. fn is required to be callable.
template ParameterTupleOf(Fn)
Evaluates to a tuple representing the parameters of Fn. Fn is required to be a callable type.
template ParameterTupleOf(alias fn)
Evaluates to a tuple representing the parameters of fn. n is required to be callable.
template BaseTypeTupleOf(T)
Evaluates to a tuple representing the ancestors of T. T is required to be a class or interface type.
template BaseTypeOfArrays(T)
Strips the []'s off of a type.
template ElementTypeOfArray(T : T[])
strips one [] off a type
template rankOfArray(T)
Count the []'s on an array type
template KeyTypeOfAA(T)
type of the keys of an AA
template ValTypeOfAA(T)
type of the values of an AA
template staticArraySize(T)
returns the size of a static array
template DynamicArrayType(T)
is T is static array returns a dynamic array, otherwise returns T
char[] ctfe_i2a(int i)
char[] ctfe_i2a(long i)
char[] ctfe_i2a(uint i)
char[] ctfe_i2a(ulong i)
compile time integer to string