View source code Display the source code in object.d from which this page was generated on github. 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. Page wiki View or edit the community-maintained wiki page associated with this page.

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

Name Description
assumeSafeAppend 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 (Property) Get 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 Destroys the given object and puts it in an invalid state. It's used to destroy an object so that any cleanup which its destructor or finalizer does is done and so that it no longer references any other objects. It does not initiate a GC cycle or free any GC memory.
dup Provide the .dup array property.
hashOf Calculates the hash value of arg with seed initial value. Result may be non-equals with typeid(T).getHash(&arg) The seed value may be used for hash chaining:
idup Provide the .idup array property.
opEquals Returns true if lhs and rhs are equal.
reserve 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.
_ArrayEq Helper function used to see if two containers of different types have the same contents in the same sequence.

Classes

Name Description
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

Name Description
Interface Information about an interface. When an object is accessed via an interface, an Interface* appears as the first entry in its vtbl.
OffsetTypeInfo Array of pairs giving the offset and type information for each member in an aggregate.

Enum values

Name Type Description
RTInfo Create RTInfo for type T

Authors

Walter Bright, Sean Kelly

License

Boost License 1.0.

Comments