numem.core.traits

Numem Traits

Members

Aliases

Unconst
alias Unconst(T : const U, U) = U

Removes const type qualifiers from T.

Unshared
alias Unshared(T : shared U, U) = U

Removes shared type qualifiers from T.

Enums

isAggregateType
eponymoustemplate isAggregateType(T)

Gets whether T is an aggregate type (i.e. a type which contains other types)

isAnyAssignable
eponymoustemplate isAnyAssignable(Lhs, Rhs = Lhs)

Gets whether Lhs can be assigned to Rhs or Rhs can be assigned to Lhs.

isAnyCompatible
eponymoustemplate isAnyCompatible(Lhs, Rhs)

Gets whether the unqualified versions of Lhs and Rhs are in any way compatible in any direction.

isAnyCompatibleRange
eponymoustemplate isAnyCompatibleRange(TRange, TValue)

Gets whether unqualified type TValue is compatible with the unqualified range element type of TRange.

isArray
eponymoustemplate isArray(T)

Gets whether type T is an array.

isBasicType
eponymoustemplate isBasicType(T)

Gets whether the provided type is a basic type.

isCOMClass
eponymoustemplate isCOMClass(T)

Gets whether T is an COM class or interface.

isCPP
eponymoustemplate isCPP(T)

Gets whether T is a C++ aggregate type

isClasslike
eponymoustemplate isClasslike(T)

Gets whether T is a class-like (i.e. class or interface)

isFloatingPoint
eponymoustemplate isFloatingPoint(T)

Gets whether type T is a floating point type.

isHeapAllocated
eponymoustemplate isHeapAllocated(T)

Gets whether T is heap allocated.

isIntegral
eponymoustemplate isIntegral(T)

Gets whether type T is a integral point type.

isMovable
eponymoustemplate isMovable(T)

Gets whether T supports moving.

isNumeric
eponymoustemplate isNumeric(T)

Gets whether type T is a numeric type.

isObjectiveC
eponymoustemplate isObjectiveC(T)

Gets whether T is an Objective-C class or protocol.

isPointer
eponymoustemplate isPointer(T)

Gets whether T is a pointer type.

isScalarType
eponymoustemplate isScalarType(T)

Gets whether the provided type is a scalar type.

isStructLike
eponymoustemplate isStructLike(T)

Gets whether T is a struct-like (i.e. struct or union)

isType
eponymoustemplate isType(T)

Gets whether T is a type.

isValidObjectiveC
eponymoustemplate isValidObjectiveC(T)

Gets whether T is a *valid* NSObject derived Objective-C class or protocol.

Manifest constants

rcReleaseNames
enum rcReleaseNames;

Valid function names for release type functions.

rcRetainNames
enum rcRetainNames;

Valid function names for retain type functions.

Properties

lvalueOf
T lvalueOf [@property getter]

Returns the lvalue equivalent of T.

rvalueOf
T rvalueOf [@property getter]

Returns the rvalue equivalent of T.

rvalueOf
T rvalueOf [@property getter]

Returns the rvalue equivalent of T.

Templates

AllocAlign
template AllocAlign(T)

Gets the alignment of type T in bytes.

AllocSize
template AllocSize(T)

Gets the amount of bytes needed to allocate an instance of type T.

BaseElemOf
template BaseElemOf(T)

Gets the base element type of type T.

Fields
template Fields(T)

Gets a sequence over all of the fields in type T.

FtoI
template FtoI(T)
Undocumented in source.
FunctionTypeOf
template FunctionTypeOf(alias func)

Get the function type from a callable object func, or from a function pointer/delegate type.

ModifyTypePreservingTQ
template ModifyTypePreservingTQ(alias Modifier, T)

Modifies type T to follow the predicate specified by Modifier.

OriginalType
template OriginalType(T)

Gets the original type of T.

Parameters
template Parameters(alias func)

Get, as a tuple, the types of the parameters to a function, a pointer to function, a delegate, a struct with an opCall, a pointer to a struct with an opCall, or a class with an opCall.

Ref
template Ref(T)

Gets the reference type version of type T.

ReturnType
template ReturnType(alias func)

Get the type of the return value from a function, a pointer to function, a delegate, a struct with an opCall, a pointer to a struct with an opCall, or a class with an opCall. Please note that $(D_KEYWORD ref) is not part of a type, but the attribute of the function.

Unqual
template Unqual(T : const U, U)

Removes all qualifiers from type T.

Unref
template Unref(T)

Gets the value type version of type T.

getUDAs
template getUDAs(alias symbol, alias attrib)

Gets a sequence of all of the attributes within attrib.

hasAnyDestructor
template hasAnyDestructor(T)

Gets whether type T has any destructor semantics, whether explicit or implicit.

hasElaborateAssign
template hasElaborateAssign(T)

Gets whether type T has elaborate assign semantics (i.e. is opAssign declared for the type)

hasElaborateCopyConstructor
template hasElaborateCopyConstructor(T)

Gets whether type T has elaborate copy constructor semantics (i.e. is a copy constructor or postblit constructor declared.)

hasElaborateDestructor
template hasElaborateDestructor(T)

Gets whether type T has elaborate destructor semantics (is ~this() declared).

hasElaborateMove
template hasElaborateMove(T)

Gets whether T or any of its children has an elaborate move.

hasRCReleaseFunction
template hasRCReleaseFunction(T)

Gets whether T has a retain style function.

hasRCRetainFunction
template hasRCRetainFunction(T)

Gets whether T has a retain style function.

hasUDA
template hasUDA(alias symbol, alias attrib)

Gets whether symbol has the user defined attribute attrib.

isAssignable
template isAssignable(Lhs, Rhs = Lhs)

Gets whether Lhs can be assigned to Rhs.

isCallable
template isCallable(alias callable)

Detect whether T is a callable object, which can be called with the function call operator $(LPAREN)...$(RPAREN).

isInnerClass
template isInnerClass(T)

Gets whether T is an inner class in a nested class layout.

isInstanceOf
template isInstanceOf(alias S, alias T)
Undocumented in source.
isRefcounted
template isRefcounted(T)

Gets whether T is refcounted.

Variables

isInstanceOf
enum bool isInstanceOf(alias S, T);

Gets whether T is an instance of template S.

isSomeFunction
enum bool isSomeFunction(alias T);

Detect whether symbol or type T is a function, a function pointer or a delegate.

Meta

Authors

Walter Bright, Tomasz Stachowiak (isExpressions), Andrei Alexandrescu, Shin Fujishiro, Robert Clipsham, David Nadlinger, Kenji Hara, Shoichi Kato Luna Nielsen