title: A C function pointer cannot be formed from a local function that captures context
body: <p>I get the following error for the code below: "A C function pointer cannot be formed from a local function that captures context."</p>
  
  <p>Does anyone propose a creative solution to populate <code>x</code> in this example? I'm stumped. The underlying types for <code>_header</code> and <code>_int</code> respectively are <code>UnsafePointer&lt;mach_header&gt;?</code> and <code>Int</code></p>
  
  <pre><code>import MachO
  class Example {
      func test() {
          var x: [Int] = []
          _dyld_register_func_for_add_image { (_header, _int) in
              x.append(_int)
          }
      }
  }
  </code></pre>