title: Wrapping Inherited Templates in Cython?
body: <p>I'm trying to write a cython wrapper for some templated C++ code. I'm pretty familiar with wrapping something written like Bar. i.e. (with details removed)</p>
  
  <pre><code> ctypedef enum enum_t "enum_t":
      OPT1 "OPT1",
      OPT2 "OPT2",
      OPT3 "OPT3"
  
   cdef cppclass Bar[A, B, T, ALLOCATOR=*] 
  
   new Bar[OPT1, OPT2, float]
  </code></pre>
  
  <p>But I'm having trouble understanding what the practice is for wrapping instances of something like <code>Bar&lt;OPT1, OPT2, T&gt; or Bar&lt;OPT3, OPT4, T&gt;</code> defined below. Could someone point me in the right direction? What I've tried has given me an "OPT1 is ambiguous" error at compilation. </p>
  
  <pre><code>typedef enum
  {
    OPT1, 
    OPT2,
    OPT3,
  } enum_t;
  
  template&lt;class T, class Allocator = std::allocator&lt;T&gt; &gt;
  class BarBase : public Foo&lt;T, Allocator&gt;, public mpi::MPIObject
  {
    //Generic class methods and variables
  }
  
  template&lt;enum_t A, enum_t B, class T, class Allocator = std::allocator&lt;T&gt; &gt;
      class Bar : public BarBase&lt;T, Allocator&gt;
      {
        public:
        private:
      };
  
  template&lt;typename T&gt;
  class Bar&lt;OPT1, OPT2, T&gt; : public BarBase&lt;T&gt;
      {
        //Specific class methods here
      }
  
  template&lt;typename T&gt;
  class Bar&lt;OPT3, OPT4, T&gt; : public BarBase&lt;T&gt;
      {
        //Specific class methods here
      }
  </code></pre>