Здравствуйте, Lloyd, Вы писали: L>P.S. А что вы имели в виду?
Скорее в виду то, что все создаваемые компилятором классы-делегаты наследуют от multicast.
Здравствуйте, Mab, Вы писали:
Mab>Здравствуйте, Lloyd, Вы писали: L>>P.S. А что вы имели в виду? Mab>Скорее в виду то, что все создаваемые компилятором классы-делегаты наследуют от multicast.
если возвращаемое тип у них void
Здравствуйте, Mab, Вы писали:
Mab>Здравствуйте, cvetkov, Вы писали:
C>>если возвращаемое тип у них void C>>
C>>delegate int D();
C>>
C>>не будет мультикастом по очевидным причинам Mab>А ты скомпилируй, да посмотри Рефлектором, если сомневаешься.
верю на слово. но что тогда будет делать код
Здравствуйте, cvetkov, Вы писали:
C>верю на слово. но что тогда будет делать код C>
C>D d = a;
C>d+=b;
C>d+=c;
C>int res = d();
C>
Ecma-334
22.3 Delegate invocation
Invocation of a delegate instance whose invocation list contains multiple entries, proceeds by invoking each
of the methods in the invocation list, synchronously, in order. Each method so called is passed the same set
of arguments as was given to the delegate instance. If such a delegate invocation includes reference
parameters (§17.5.1.2), each method invocation will occur with a reference to the same variable; changes to
that variable by one method in the invocation list will be visible to methods further down the invocation list.
If the delegate invocation includes output parameters or a return value, their final value will come from the
invocation of the last delegate in the list. If an exception occurs during processing of the invocation of such a
delegate, and that exception is not caught within the method that was invoked, the search for an exception
catch clause continues in the method that called the delegate, and any methods further down the invocation
list are not invoked.