title: Delegates in SWIG - C#
body: <p>( complete duplicate of <a href="http://old.nabble.com/C%2B%2B-pointer-to-method-as-parameter-to-C--td17645155.html" rel="noreferrer">http://old.nabble.com/C%2B%2B-pointer-to-method-as-parameter-to-C--td17645155.html</a> , but couldn't make the proposed macro work)</p>
  
  <p>I've got the following C++ function (simplified) : </p>
  
  <pre><code>InputPort addInputPort(void(*callback)(InputPort));
  </code></pre>
  
  <p>Problem : the signature of the generated C# function is : </p>
  
  <pre><code>public InputPort addInputPort(SWIGTYPE_p_f__InputPort____void callback)
  </code></pre>
  
  <p><code>SWIGTYPE_p_f__InputPort____void</code> is not a delegate (and has no public constructor anyway), so I can't use addInputPort.</p>
  
  <p>How do I tell SWIG to use a delegate instead ? If the solution involves %typemap, <em>please</em> be extra patient with me...</p>