title: Swig: How to wrap double& (double passed by reference)?
body: <p>I am using SWIG to access C++ code from Python. How do I elegantly wrap a function that returns values in variables passed by reference like</p>
  
  <pre><code>void set(double&amp;a) {
    a = 42.;
  }
  </code></pre>
  
  <p>I could not find out how to do this. In the best case I'd be able to use the function in Python with Python floats:</p>
  
  <pre><code>&gt;&gt;&gt; b = 2.
  &gt;&gt;&gt; set(b)
  &gt;&gt;&gt; print b
  42.0
  </code></pre>
  
  <p>At the moment it gives me a <code>TypeError: in method 'TestDouble_set', argument 2 of type 'double &amp;'</code>.</p>