Files
Delegate/exemple/main.cpp
T
2025-02-25 15:26:12 +07:00

22 lines
415 B
C++

#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;
}