I couldn’t find the + operator in Reflector under Delegate or MulticastDelegate.
I’m trying to figure out how this doesn’t need a cast:
Action a = () => Console.WriteLine("A");
Action b = () => Console.WriteLine("B");
Action c = a + b;
But this does:
Action a = () => Console.WriteLine("A");
Action b = () => Console.WriteLine("B");
Action c = (Action)MulticastDelegate.Combine(a, b);
In the first sample is the cast just done under the covers?
Taking the following example:
Then looking at it with ILSpy:
Seems that they do the exact same thing, just C# is providing some syntactic sugar in the first test.