title: PyBind11 Template Class of Many Types
body: <p>I'd like to use PyBind11 to wrap a specialized array class. However, the array is available in many flavours (one per each plain-old-datatype). The code looks like this:</p>
  
  <pre><code>py::class_&lt;Array2D&lt;float&gt;&gt;(m, "Array2Dfloat", py::buffer_protocol(), py::dynamic_attr())
      .def(py::init&lt;&gt;())
      .def(py::init&lt;Array2D&lt;float&gt;::xy_t,Array2D&lt;float&gt;::xy_t,float&gt;())
      .def("size",      &amp;Array2D&lt;float&gt;::size)
      .def("width",     &amp;Array2D&lt;float&gt;::width)
      .def("height",    &amp;Array2D&lt;float&gt;::height)
      //...
      //...
  </code></pre>
  
  <p>The only way I've thought of to tell PyBind11 about these classes is by duplicating the above for each POD through the use of a very large macro.</p>
  
  <p>Is there a better way to do this?</p>