Bound delegate pointer. Just a regular D delegate, basically. Return value contains a D delegate. Example construction: boundDgPointer(&method)
Create a bound "object" with the given context. Example construction: boundObj(context)
Create a bound "object" with the given sub-aggregate and context. Example construction: boundObjScope!aggregate(context)
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
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
Bound delegate alias. Return value contains context. Example construction: boundDgAlias!method(context)
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.
Unbound delegate pointer. Return value contains function pointer without context. Example construction: unboundDgPointer!method(&method) Currently only implements callWith.
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/.
Method binding - before alias inference