View source code
Display the source code in object.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

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

Functions

NameDescription
assumeSafeAppend(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.
capacity(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.
destroy(obj) Destroys the given object and sets it back to its 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.
dup(a) Provide the .dup array property.
hashOf(arg, seed) Calculates the hash value of arg with seed initial value. The result may not be equal to typeid(T).getHash(&arg).
idup(a) Provide the .idup array property.
opEquals(lhs, rhs) Returns true if lhs and rhs are equal.
reserve(arr, 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.

Classes

NameDescription
Error The base class of all unrecoverable runtime errors.
Exception The base class of all errors that are safe to catch and handle.
Object All D class objects inherit from Object.
Throwable The base class of all thrown objects.
TypeInfo Runtime type information about a type. Can be retrieved for any type using a TypeidExpression.
TypeInfo_Class Runtime type information about a class. Can be retrieved from an object instance by using the .classinfo property.

Structs

NameDescription
Interface Information about an interface. When an object is accessed via an interface, an Interface* appears as the first entry in its vtbl.
ModuleInfo An instance of ModuleInfo is generated into the object file for each compiled module.
OffsetTypeInfo Array of pairs giving the offset and type information for each member in an aggregate.

Manifest constants

NameTypeDescription
RTInfo Create RTInfo for type T

Authors

Walter Bright, Sean Kelly

License

Boost License 1.0.