Slot

Undocumented in source.

Members

Aliases

Function
alias Function = from!"std.traits".SetFunctionAttributes!(ReturnType delegate(const scope void*, Parameters), from!"std.traits".functionLinkage!SlotType, from!"std.traits".functionAttributes!SlotType)
Undocumented in source.
Parameters
alias Parameters = from!"std.traits".Parameters!F
Undocumented in source.
ReturnType
alias ReturnType = from!"std.traits".ReturnType!F
Undocumented in source.
SlotType
alias SlotType = F
Undocumented in source.

Functions

opCall
auto opCall(Parameters args)
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Slot!F other)
Undocumented in source. Be warned that the author may not have intended to support it.
reset
void reset()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

fn
Function fn;
Undocumented in source.
payload
void* payload;
Undocumented in source.

Examples

@safe struct Listener
{
	int i;

	auto foo(int var) return
	{
		i = var;
		return &this;
	}
}

Listener listener;
alias myfoo = Listener.foo;

Slot!(Listener* delegate(int) @safe) slot;

slot.connect!(myfoo)(listener);

assert(slot(4) is &listener);
assert(listener.i == 4);

Meta