ae.utils.meta.reference

Reference type abstraction

Members

Functions

dereference
typeof(*T.init) dereference(T v)
T dereference(T v)

Reverse of "reference".

reference
T* reference(T v)
T reference(T v)

Allow passing a constructed object by reference, without redundant indirection. The intended use is with types which support the dot operator (a non-null class, a struct, or a non-null struct pointer).

Templates

FromRefType
template FromRefType(R)

Reverse of RefType

RefType
template RefType(T)

typeof(new T) - what we use to refer to an allocated instance

StorageType
template StorageType(T)

A type that can be used to store instances of T. A struct with T's instance size if T is a class, T itself otherwise.

isReference
template isReference(T)

Is T a reference type (a pointer or a class)?

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>