Re: When Overloading the Plus Operator, What are Valid Arguments Types?



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.
.



Relevant Pages

  • Re: is int(round(val)) safe?
    ... >> Since round() returns an integer ... > Just to clarify in case anyone else misreads this, ... > I think the intent was clear from the rest of the post, ... > wouldn't hurt to clarify this for any newbies who misread it like I did. ...
    (comp.lang.python)
  • Xlib connection refused ?
    ... i've just installed xcdroast and when i start it as root (as is required ... Can anyone clarify this a bit? ... I'm not afraid of consoles and cryptical ...
    (alt.os.linux.suse)
  • Re: Help with permiutations within Fibonacci binary tree
    ... I've tried to clarify your points ... What I've enumerated is sets of values that add up to the root. ... Importantly the arrangements in each set are unique and distict from ... So patterns of values, each pattern of which adds up to ...
    (comp.graphics.algorithms)
  • Re: matlab fscanf
    ... way in the future -- it would be best to report only the exact ... it's possible the intent to clarify will ... simply obfuscate. ...
    (comp.soft-sys.matlab)
  • Re: is int(round(val)) safe?
    ... Just to clarify in case anyone else misreads this, ... here was to say that round(f) -- that is, ... I think the intent was clear from the rest of the post, ... wouldn't hurt to clarify this for any newbies who misread it like I did. ...
    (comp.lang.python)