Added template input parameter

This commit is contained in:
Данил
2025-02-25 15:26:12 +07:00
parent 2fa47cfbc9
commit 6f83ec7732
3 changed files with 201 additions and 56 deletions
+21
View File
@@ -0,0 +1,21 @@
#include <iostream>
#include "Delegate.h"
class A
{
public:
void Foo1(int var) { std::cout << "A::Foo1(" << var <<");\n"; }
void Foo2(int var) { std::cout << "A::Foo2(" << var <<");\n"; }
};
int main(int argc, char* argv[])
{
Delegate<int> delegate;
A a;
delegate.bind(&a, &A::Foo1);
delegate.bind(&a, &A::Foo2);
delegate.unbind(&a, &A::Foo1);
delegate.Call(321);
return 0;
}