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.

Public Imports

core.internal.hash
public import core.internal.hash : hashOf;
core.internal.entrypoint
public import core.internal.entrypoint : _d_cmain;
core.internal.array.appending
public import core.internal.array.appending : _d_arrayappendTImpl;
core.internal.array.appending
public import core.internal.array.appending : _d_arrayappendcTXImpl;
core.internal.array.comparison
public import core.internal.array.comparison : __cmp;
core.internal.array.equality
public import core.internal.array.equality : __equals;
core.internal.array.equality
public import core.internal.array.equality : __ArrayEq;
core.internal.array.casting
public import core.internal.array.casting : __ArrayCast;
core.internal.array.concatenation
public import core.internal.array.concatenation : _d_arraycatnTXImpl;
core.internal.array.construction
public import core.internal.array.construction : _d_arrayctor;
core.internal.array.construction
public import core.internal.array.construction : _d_arraysetctor;
core.internal.array.capacity
public import core.internal.array.capacity : _d_arraysetlengthTImpl;
core.internal.dassert
public import core.internal.dassert : _d_assert_fail;
core.internal.destruction
public import core.internal.destruction : __ArrayDtor;
core.internal.moving
public import core.internal.moving : __move_post_blt;
core.internal.postblit
public import core.internal.postblit : __ArrayPostblit;
core.internal.switch_
public import core.internal.switch_ : __switch;
core.internal.switch_
public import core.internal.switch_ : __switch_error;

Members

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 .classinfo property.

TypeInfo_Function
class TypeInfo_Function

Functions

assumeSafeAppend
inout(T[]) assumeSafeAppend(auto ref 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)

Returns a forward range over the keys of the associative array.

byKeyValue
auto byKeyValue(T aa)

Returns a forward range over the key value pairs of the associative array.

byValue
auto byValue(T aa)

Returns a forward range over the values of the associative array.

capacity
size_t capacity(T[] arr)

(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.

clear
void clear(T aa)

Removes all remaining keys and values from an associative array.

destroy
void destroy(ref T obj)
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)

Create a new associative array of the same size and copy the contents of the associative array into it.

dup
auto dup(T[] a)
T[] dup(const(T)[] a)

Provide the .dup array property.

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

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

hashOf
size_t hashOf(auto ref T arg, size_t seed)
size_t hashOf(auto ref 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).

idup
immutable(T)[] idup(T[] a)
immutable(T)[] idup(const(T)[] a)

Provide the .idup array property.

keys
Key[] keys(T aa)

Returns a dynamic array, the elements of which are the keys in the associative array.

opEquals
bool opEquals(const Object lhs, const Object rhs)

Returns true if lhs and rhs are equal.

rehash
T rehash(T aa)

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

require
V require(ref V[K] aa, K key, lazy V value = V.init)

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(ref 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.

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

Looks up key; if it exists applies the update callable else evaluates the create callable and adds it to the associative array

values
Value[] values(T aa)

Returns a dynamic array, the elements of which are the values in the associative array.

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.

Templates

RTInfoImpl
template RTInfoImpl(size_t[] pointerBitmap)

Create RTInfo for type T

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

Suggestion Box / Bug Report