-
-
Notifications
You must be signed in to change notification settings - Fork 102
DelegatesinC++
Simon Jackson edited this page Jun 7, 2017
·
1 revision
Delegates are function pointer containers that are used as a generic form of holding function pointers.
template<class T>
class ZDelegate
{
public:
List<T> functionList;
void operator += (T h)
{
if(!functionList.Contains(h))
functionList.AddItem(h);
}
void operator -= (T h)
{
if(functionList.Contains(h))
functionList.RemoveItem(h);
}
};