Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: "jehugaleahsa@xxxxxxxxx" <jehugaleahsa@xxxxxxxxx>
- Date: Fri, 12 Sep 2008 06:32:58 -0700 (PDT)
On Sep 11, 11:01 pm, Jeroen Mostert <jmost...@xxxxxxxxx> wrote:
Marc Gravell wrote:
Good analysis - one point, though:
"Change this to object o = failer + delegate..."
With the code as originally presented (MulticastDelegate), you'd need
to type the delegate:
o = failer + (EventHandler) delegate {...};
Oops, you're right, of course. Changing around things a little too
enthusiastically to pin down the root cause.
Of course, a better option would be to declare something more specific
for the "del" argument - perhaps using the Action<...> or Func<...>
family to clarify the intent (EventHandler is fine too...).
Yes, using MulticastDelegate is pretty fishy -- I can't remember a single
occasion where I had a need to explicitly declare that.
--
J.
Thank you. Someone who actually looks at the code I posted, instead of
just bashing me. It is nice to know that some people try to help
rather than always question the questions.
.
- Follow-Ups:
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: Peter Duniho
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: Jon Skeet [C# MVP]
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: Marc Gravell
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- References:
- When Overloading the Plus Operator, What are Valid Arguments Types?
- From: jehugaleahsa@xxxxxxxxx
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: Jeroen Mostert
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: Marc Gravell
- Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- From: Jeroen Mostert
- When Overloading the Plus Operator, What are Valid Arguments Types?
- Prev by Date: Exposing a Property for a Derived class
- Next by Date: Windows Media Player library
- Previous by thread: Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- Next by thread: Re: When Overloading the Plus Operator, What are Valid Arguments Types?
- Index(es):
Relevant Pages
|