The OpenD Programming Language

mir.conv

Conversion utilities.

Members

Functions

emplace (from core.lifetime)
T* emplace(void[] chunk, Args args) via public import core.lifetime : emplace;

Given a raw memory area chunk, constructs an object of non-class type T at that address. The constructor is passed the arguments args, if any. Preconditions: chunk must be at least as large as T needs and should have an alignment multiple of T's alignment. Note: This function can be @trusted if the corresponding constructor of T is @safe.

emplaceInitializer
void emplaceInitializer(T chunk)

Emplace helper function.

uninitializedFillDefault
T[] uninitializedFillDefault(T[] array)
xdestroy
void xdestroy(T[] ar)

Destroy structs and unions usnig __xdtor member if any. Do nothing for other types.

Templates

to
template to(T)

The to template converts a value from one type to another. The source type is deduced and the target type must be specified, for example the expression to!int(42.0) converts the number 42 from double to int. The conversion is "unsafe", i.e., it does not check for overflow.

Meta

Authors

Ilia Ki