title: how to use template "inheritance" to avoid boilerplate code when binding C++ to python with pybind11
body: <p>I managed to bind template definitions doing</p>
  <pre><code> py::class_&lt;T&lt;a&gt;&gt;(m, &quot;Ta&quot;)
   py::class_&lt;T&lt;b&gt;&gt;(m, &quot;Tb&quot;)
   ...
  </code></pre>
  <p>where T is the template class and <code>a</code> and <code>b</code> typenames defining the template. But the problem I have tells me that this is not the really good way to expose these template definitions, because now I am forced to duplicate code for all the functions and parameters of the template class T:</p>
  <pre><code> py::class_&lt;T&lt;a&gt;&gt;(m, &quot;Ta&quot;)
     .def(py::init&lt;string, string&gt;())
     .def(&quot;do_smthg&quot;, &amp;T&lt;a&gt;::do_sthg)
     ...;
   py::class_&lt;T&lt;b&gt;&gt;(m, &quot;Tb&quot;)
     .def(py::init&lt;string, string&gt;())
     .def(&quot;do_smthg&quot;, &amp;T&lt;b&gt;::do_sthg)
     ...;
  </code></pre>
  <p>when class T itself for instance has <code>do_smthg</code>, that I would then expect to have to define only once. I tried to browse the doc and the web, but I failed to find the right pointer.</p>