Tech Off Post

Single Post Permalink

View Thread: Can't do Func ?
  • joechung

    dpratt71 said:
    brian.shapiro said:
    *snip*
    You have the parameter order correct, but you still can't do what you want. The only thing a generic parameter can express is a type. The The parameter direction is defined by the Func<> delegate itself, and you can't change it. Depending on what you're trying to do, you can define your own delegate apart from Func<>. Something like this, perhaps:

    public delegate int MyDelegate(out char value);

    Actually, I'm not 100% sure the above is valid. An "out" parameter on a delegate may not be valid.
    That works.