Delegates are multicast: the "function pointer" can be bound to one or more methods within a managed class. The delegate keyword defines a multicast delegate type with a specific method signature.
A delegate can also be bound to a method of a value class, such as a static method.
A delegate has the following characteristics:
It inherits from System::MulticastDelegate.
It has a constructor that takes two arguments: a pointer to a managed class or NULL (in the case of binding to a static method) and a fully qualified method of the specified type.
It has a method called Invoke, whose signature matches the declared signature of the delegate.
When a delegate is invoked, its function(s) are called in the order they were attached.
The return value of a delegate is the return value from its last attached member function.
Delegates cannot be overloaded.
delegate is a context-sensitive keyword; see Context-Sensitive Keywords for more information.
Delegates can be bound or unbound.
When you instantiate a bound delegate, the first argument shall be an object reference. The second argument of a delegate instantiation shall either be the address of a method of a managed class object, or a pointer to a method of a value type. The second argument of a delegate instantiation must name the method with the full class scope syntax and apply the address-of operator.
When you instantiate an unbound delegate, the first argument shall either be the address of a method of a managed class object, or a pointer to a method of a value type. The argument must name the method with the full class scope syntax and apply the address-of operator.
When creating a delegate to a static or global function, only one parameter is required: the function (optionally, the address of the function).
You can detect at compile time if a type is a delegate with __is_delegate (type). For more information, see Compiler Support for Type Traits.
For more information on delegates, see