ae.utils.meta.binding_v1

Method binding - before alias inference

Members

Functions

boundDgPointer
deprecated auto boundDgPointer(Dg dg)

Bound delegate pointer. Just a regular D delegate, basically. Return value contains a D delegate. Example construction: boundDgPointer(&method)

boundObj
deprecated auto boundObj(S s)

Create a bound "object" with the given context. Example construction: boundObj(context)

boundObjScope
deprecated auto boundObjScope(S s)

Create a bound "object" with the given sub-aggregate and context. Example construction: boundObjScope!aggregate(context)

Properties

unboundDgAlias
deprecated auto unboundDgAlias [@property getter]

This function group manufactures delegate-like objects which selectively contain a context or function pointer. This allows avoiding the overhead of an indirect call (which prevents inlining), or passing around a context when that context is already available on the caller's side, all while having the same syntax for invocation. The invocation syntax is as follows: If fun is the return value of these functions, and Fun is its type, Fun.call(fun, args...) will invoke the respective function. Unbound variants provide a callWith method, which additionally take a context to rebind with. Unbound delegate alias. Return value contains nothing (empty struct). Example construction: unboundDgAlias!method

unboundObj
deprecated auto unboundObj [@property getter]

Equilavents to the above functions, but for entire objects. Caller syntax: Obj.method(obj, args...) Create an unbound "object" which forwards calls to the given alias. Context is inferred from caller site. Example construction: unboundObj!aggregate

Structs

BoundDgAlias
deprecated struct BoundDgAlias(alias fun)
Undocumented in source.
BoundDgPointer
deprecated struct BoundDgPointer(Dg)
Undocumented in source.
DispatchToFirstArg
deprecated struct DispatchToFirstArg(T)
Undocumented in source.
UnboundDgAlias
deprecated struct UnboundDgAlias(alias fun)
Undocumented in source.
UnboundDgPointer
deprecated struct UnboundDgPointer(C, Dg)
Undocumented in source.
UnboundObj
deprecated struct UnboundObj(alias target)
Undocumented in source.
X
deprecated struct X
Undocumented in source.
Y
deprecated struct Y
Undocumented in source.

Templates

boundDgAlias
deprecated template boundDgAlias(alias fun)

Bound delegate alias. Return value contains context. Example construction: boundDgAlias!method(context)

disconnect
deprecated template disconnect(alias f)

Disconnect function (or function template) f from its "this" pointer, creating a template that can be passed as an alias parameter to a template which already has a context (such as a non-static templated method). To connect the alias back to a "this" pointer, use .connect(p). Use .call(args) on the result to call the resulting function. Requires __traits(child) support.

unboundDgPointer
deprecated template unboundDgPointer(alias fun)

Unbound delegate pointer. Return value contains function pointer without context. Example construction: unboundDgPointer!method(&method) Currently only implements callWith.

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>