The OpenD Programming Language

object

Forms the symbols available to all D programs. Includes Object, which is the root of the class object hierarchy. This module is implicitly imported.

Members

Aliases

noreturn
alias noreturn = typeof(*null)

Bottom type. See .

Classes

Error
class Error

The base class of all unrecoverable runtime errors.

Exception
class Exception

The base class of all errors that are safe to catch and handle.

Object
class Object

All D class objects inherit from Object.

Throwable
class Throwable

The base class of all thrown objects.

TypeInfo
class TypeInfo

Runtime type information about a type. Can be retrieved for any type using a $(GLINK2 expression,TypeidExpression, TypeidExpression).

TypeInfo_Class
class TypeInfo_Class

Runtime type information about a class. Can be retrieved from an object instance by using the typeid expression.

TypeInfo_Function
class TypeInfo_Function
Undocumented in source.
TypeInfo_Interface
class TypeInfo_Interface
Undocumented in source.

Functions

__ArrayCast (from core.internal.array.casting)
TTo[] __ArrayCast(TFrom[] from) via public import core.internal.array.casting : __ArrayCast;

The compiler lowers expressions of cast(TTo[])TFrom[] to this implementation. Note that this does not detect alignment problems.

__ArrayDtor (from core.internal.destruction)
void __ArrayDtor(T[] a) via public import core.internal.destruction : __ArrayDtor;
Undocumented in source.
__ArrayPostblit (from core.internal.postblit)
void __ArrayPostblit(T[] a) via public import core.internal.postblit : __ArrayPostblit;
Undocumented in source.
__cmp (from core.internal.array.comparison)
auto __cmp(T1[] s1, T2[] s2) via public import core.internal.array.comparison : __cmp;
Undocumented in source.
__ctfeWrite (from core.builtins)
void __ctfeWrite(const(char)[] s) via public import core.builtins : __ctfeWrite;

Writes s to stderr during CTFE (does nothing at runtime).

__equals (from core.internal.array.equality)
bool __equals(T1[] lhs, T2[] rhs) via public import core.internal.array.equality : __equals;
Undocumented in source.
__move_post_blt (from core.internal.moving)
void __move_post_blt(S newLocation, S oldLocation) via public import core.internal.moving : __move_post_blt;
Undocumented in source.
__switch (from core.internal.switch_)
int __switch(T[] condition) via public import core.internal.switch_ : __switch;

Support for switch statements switching on strings.

__switch_error (from core.internal.switch_)
void __switch_error(string file, size_t line) via public import core.internal.switch_ : __switch_error;

Compiler lowers final switch default case to this (which is a runtime error) Old implementation is in core/exception.d

_d_arrayappendT (from core.internal.array.appending)
Tarr _d_arrayappendT(Tarr x, Tarr y) via public import core.internal.array.appending : _d_arrayappendT;

Implementation of _d_arrayappendT

_d_arrayappendTTrace (from core.internal.array.appending)
Tarr _d_arrayappendTTrace(string file, int line, string funcname, Tarr x, Tarr y) via public import core.internal.array.appending : _d_arrayappendTTrace;

TraceGC wrapper around core.internal.array.appending._d_arrayappendT.

_d_arrayappendcTX (from core.internal.array.appending)
Tarr _d_arrayappendcTX(Tarr px, size_t n) via public import core.internal.array.appending : _d_arrayappendcTX;

Extend an array px by n elements. Caller must initialize those elements.

_d_arrayappendcTXTrace (from core.internal.array.appending)
Tarr _d_arrayappendcTXTrace(string file, int line, string funcname, Tarr px, size_t n) via public import core.internal.array.appending : _d_arrayappendcTXTrace;

TraceGC wrapper around core.internal.array.appending._d_arrayappendT.

_d_arrayassign_l (from core.internal.array.arrayassign)
Tarr _d_arrayassign_l(Tarr to, Tarr from) via public import core.internal.array.arrayassign : _d_arrayassign_l;

Does array assignment (not construction) from another array of the same element type. Handles overlapping copies. Assumes the right hand side is an lvalue,

_d_arrayassign_r (from core.internal.array.arrayassign)
Tarr _d_arrayassign_r(Tarr to, Tarr from) via public import core.internal.array.arrayassign : _d_arrayassign_r;

Does array assignment (not construction) from another array of the same element type. Does not support overlapping copies. Assumes the right hand side is an rvalue,

_d_arraycatnTX (from core.internal.array.concatenation)
Tret _d_arraycatnTX(Tarr froms) via public import core.internal.array.concatenation : _d_arraycatnTX;

Concatenate the arrays inside of froms. _d_arraycatnTX(a, b, c) means a ~ b ~ c.

_d_arraycatnTXTrace (from core.internal.array.concatenation)
Tret _d_arraycatnTXTrace(string file, int line, string funcname, Tarr froms) via public import core.internal.array.concatenation : _d_arraycatnTXTrace;

TraceGC wrapper around core.internal.array.concatenation._d_arraycatnTX.

_d_arrayctor (from core.internal.array.construction)
Tarr _d_arrayctor(Tarr to, Tarr from, char* makeWeaklyPure) via public import core.internal.array.construction : _d_arrayctor;

Does array initialization (not assignment) from another array of the same element type.

_d_arraysetassign (from core.internal.array.arrayassign)
Tarr _d_arraysetassign(Tarr to, T value) via public import core.internal.array.arrayassign : _d_arraysetassign;

Sets all elements of an array to a single value. Takes into account postblits, copy constructors and destructors. For Plain Old Data elements,rt/memset.d is used.

_d_arraysetctor (from core.internal.array.construction)
void _d_arraysetctor(Tarr p, T value) via public import core.internal.array.construction : _d_arraysetctor;

Do construction of an array. ticount p = value;

_d_newThrowable (from core.lifetime)
T _d_newThrowable() via public import core.lifetime : _d_newThrowable;

Allocate an exception of type T from the exception pool. T must be Throwable or derived from it and cannot be a COM or C++ class.

_d_newarrayT (from core.internal.array.construction)
T[] _d_newarrayT(size_t length, bool isShared) via public import core.internal.array.construction : _d_newarrayT;

Allocate an array with the garbage collector. Also initalize elements if their type has an initializer. Otherwise, not zero-initialize the array.

_d_newarrayTTrace (from core.internal.array.construction)
T[] _d_newarrayTTrace(string file, int line, string funcname, size_t length, bool isShared) via public import core.internal.array.construction : _d_newarrayTTrace;

TraceGC wrapper around core.lifetime._d_newitemT.

_d_newarraymTX (from core.internal.array.construction)
Tarr _d_newarraymTX(size_t[] dims, bool isShared) via public import core.internal.array.construction : _d_newarraymTX;

Create a new multi-dimensional array. Also initalize elements if their type has an initializer. Otherwise, not zero-initialize the array.

_d_newarraymTXTrace (from core.internal.array.construction)
Tarr _d_newarraymTXTrace(string file, int line, string funcname, size_t[] dims, bool isShared) via public import core.internal.array.construction : _d_newarraymTXTrace;

TraceGC wrapper around core.internal.array.construction._d_newarraymT.

_d_newclassT (from core.lifetime)
T _d_newclassT() via public import core.lifetime : _d_newclassT;

Create a new class instance. Allocates memory and sets fields to their initial value, but does not call a constructor.

_d_newclassTTrace (from core.lifetime)
T _d_newclassTTrace(string file, int line, string funcname) via public import core.lifetime : _d_newclassTTrace;

TraceGC wrapper around core.lifetime._d_newclassT.

_d_newitemT (from core.lifetime)
T* _d_newitemT() via public import core.lifetime : _d_newitemT;

Allocate an initialized non-array item.

_d_newitemTTrace (from core.lifetime)
T* _d_newitemTTrace(string file, int line, string funcname) via public import core.lifetime : _d_newitemTTrace;

TraceGC wrapper around core.lifetime._d_newitemT.

assumeSafeAppend
inout(T[]) assumeSafeAppend(inout(T[]) arr)

Assume that it is safe to append to this array. Appends made to this array after calling this function may append in place, even if the array was a slice of a larger array to begin with.

byKey
auto byKey(T aa)
auto byKey(T* aa)

Returns a forward range which will iterate over the keys of the associative array. The keys are returned by reference.

byKeyValue
auto byKeyValue(T aa)
auto byKeyValue(T* aa)

Returns a forward range which will iterate over the key-value pairs of the associative array. The returned pairs are represented by an opaque type with .key and .value properties for accessing references to the key and value of the pair, respectively.

byValue
auto byValue(T aa)
auto byValue(T* aa)

Returns a forward range which will iterate over the values of the associative array. The values are returned by reference.

clear
void clear(Value[Key] aa)
void clear(Value[Key]* aa)

Removes all remaining keys and values from an associative array.

destroy
void destroy(T obj)

Destroys the given object and optionally resets to initial state. It's used to destroy an object, calling its destructor or finalizer so it no longer references any other objects. It does not initiate a GC cycle or free any GC memory. If initialize is supplied false, the object is considered invalid after destruction, and should not be referenced.

dup
V[K] dup(T aa)
V[K] dup(T* aa)

Creates a new associative array of the same size and copies the contents of the associative array into it.

get
inout(V) get(inout(V[K]) aa, K key, inout(V) defaultValue)
inout(V) get(inout(V[K])* aa, K key, inout(V) defaultValue)

Looks up key; if it exists returns corresponding value else evaluates and returns defaultValue.

hashOf
size_t hashOf(T arg, size_t seed)
size_t hashOf(T arg)

Calculates the hash value of arg with an optional seed initial value. The result might not be equal to typeid(T).getHash(&arg).

hashOf (from core.internal.hash)
size_t hashOf(T aa, size_t seed) via public import core.internal.hash : hashOf;
Undocumented in source.
keys
Key[] keys(T aa)
Key[] keys(T* aa)

Returns a newly allocated dynamic array containing a copy of the keys from the associative array.

opEquals
bool opEquals(LHS lhs, RHS rhs)

Implementation for class opEquals override. Calls the class-defined methods after a null check. Please note this is not nogc right now, even if your implementation is, because of the typeinfo name string compare. This is because of dmd's dll implementation. However, it can infer to @safe if your class' opEquals is.

rehash
T rehash(T aa)
T rehash(T* aa)

Reorganizes the associative array in place so that lookups are more efficient.

require
V require(V[K] aa, K key, V value)

Looks up key; if it exists returns corresponding value else evaluates value, adds it to the associative array and returns it.

reserve
size_t reserve(T[] arr, size_t newcapacity)

Reserves capacity for a slice. The capacity is the size that the slice can grow to before the underlying array must be reallocated or extended.

setSameMutex
void setSameMutex(Object ownee, Object owner)

Makes ownee use owner's mutex. This will initialize owner's mutex if it hasn't been set yet.

update
void update(V[K] aa, K key, C create, U update)

Calls create if key doesn't exist in the associative array, otherwise calls update. create returns a corresponding value for key. update accepts a key parameter. If it returns a value, the value is set for key.

values
Value[] values(T aa)
Value[] values(T* aa)

Returns a newly allocated dynamic array containing a copy of the values from the associative array.

Properties

capacity
size_t capacity [@property getter]

(Property) Gets the current capacity of a slice. The capacity is the size that the slice can grow to before the underlying array must be reallocated or extended.

dup
auto dup [@property getter]
T[] dup [@property getter]

Provide the .dup array property.

idup
immutable(T)[] idup [@property getter]

Provide the .idup array property.

Structs

Interface
struct Interface

Information about an interface. When an object is accessed via an interface, an Interface* appears as the first entry in its vtbl.

ModuleInfo
struct ModuleInfo

An instance of ModuleInfo is generated into the object file for each compiled module.

OffsetTypeInfo
struct OffsetTypeInfo

Array of pairs giving the offset and type information for each member in an aggregate.

__va_list (from core.internal.vararg.aarch64)
struct __va_list via public import core.internal.vararg.aarch64 : __va_list;
Undocumented in source.
__va_list (from core.stdc.stdarg)
struct __va_list via public import core.stdc.stdarg : __va_list;
Undocumented in source.
gnuAbiTag (from core.attribute)
struct gnuAbiTag via public import core.attribute : gnuAbiTag;

Use this attribute to declare an ABI tag on a C++ symbol.

selector (from core.attribute)
deprecated struct selector via public import core.attribute : selector;

Use this attribute to attach an Objective-C selector to a method.

Templates

RTInfoImpl
template RTInfoImpl(size_t[] pointerBitmap)

Create RTInfo for type T

_d_arraysetlengthTImpl (from core.internal.array.capacity)
template _d_arraysetlengthTImpl(Tarr : T[], T) via public import core.internal.array.capacity : _d_arraysetlengthTImpl;

Implementation of _d_arraysetlengthT and _d_arraysetlengthTTrace

_d_assert_fail (from core.internal.dassert)
template _d_assert_fail(A...) via public import core.internal.dassert : _d_assert_fail;

Generates rich assert error messages for binary expressions

_d_cmain (from core.internal.entrypoint)
template _d_cmain() via public import core.internal.entrypoint : _d_cmain;

A template containing C main and any call(s) to initialize druntime and call D main. Any module containing a D main function declaration will cause the compiler to generate a mixin _d_cmain(); statement to inject this code into the module.

_d_delstructImpl (from core.lifetime)
template _d_delstructImpl(T) via public import core.lifetime : _d_delstructImpl;

Implementation of _d_delstruct and _d_delstructTrace

imported
template imported(string moduleName)

Provides an "inline import", i.e. an import that is only available for a limited lookup. For example:

Variables

rtinfoNoPointers
enum immutable(void)* rtinfoNoPointers;

shortcuts for the precise GC, also generated by the compiler used instead of the actual pointer bitmap

Meta

Authors

Walter Bright, Sean Kelly