Skip to content

Support any signal/slot signature in all interface#130

Open
stijnvanbeek wants to merge 1 commit intomainfrom
signalslot-signature-support
Open

Support any signal/slot signature in all interface#130
stijnvanbeek wants to merge 1 commit intomainfrom
signalslot-signature-support

Conversation

@stijnvanbeek
Copy link
Copy Markdown
Contributor

Support for signals/slots with none or multiple arguments throughout the interface:

class SignalTest
{
public:
	SignalTest()
	{
		noArgsSignal.connect(noArgsSlot);
		argsSignal.connect(argsSlot);
		noArgsSignal();
		argsSignal(1, 0.5);
	}

	Signal<> noArgsSignal;
	Signal<int, float> argsSignal;

	Slot<> noArgsSlot = { this, &SignalTest::method };
	void method()
	{
		Logger::info("method");
	}

	Slot<int, float> argsSlot = { this, &SignalTest::method2 };
	void method2(int i, float x)
	{
		Logger::info("method2: %i, %f", i, x);
	}
};

@stijnvanbeek stijnvanbeek requested a review from cklosters April 23, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant