title: Generic delegate with different retun types
body: <p>I have some methods with different return types, like int and double.</p>
  
  <p>But I try now to iterate over the different methods. </p>
  
  <p>I try it like this:</p>
  
  <pre><code>delegate T MeDelegate&lt;T&gt;();
      class Program
      {
          static void Main(string[] args)
          {
              Func&lt;int&gt; d = ReturnFive;
              d += ReturnTen;
              d += ReturnTwentyTwo;
              d += returnDoubles;
  
              foreach (int i in GetAllReturnValues(d))
                  Console.WriteLine(i);
              Console.ReadKey();
  
  
          }
  
          static IEnumerable&lt;TArgs&gt; GetAllReturnValues&lt;TArgs&gt;(Func&lt;TArgs&gt; d)
          {
  
              List&lt;int&gt; ints = new List&lt;int&gt;();
              foreach (Func&lt;TArgs&gt; item in d.GetInvocationList())
                  yield return item();
  
  
          }
  
          static int ReturnFive() { return 5; }
          static int ReturnTen() { return 10; }
          static int ReturnTwentyTwo() { return 22; }
          static double returnDoubles() { return 1.0; }
  
      }
  </code></pre>
  
  <p>and ofcourse this:  <code>Func&lt;int&gt; d</code></p>
  
  <p>doesnt work. But how to improve this?</p>
  
  <p>Thank you</p>