title: Cython binding for template with integer
body: <p>This is my first time I ask on Stackoverflow, so please sympathize if I have any inappropriate writing in this asking!</p>
  
  <p>I'm using in Cython to bind python code to C++ code.
  My C++ code has a class with template which has an integer. I cannot write correct cython code although I have searched for many posts.</p>
  
  <p>My C++ class in .h file:</p>
  
  <pre><code>namespace abc {
      class Status {
          // declare attributes and methods here
      };
  
      class Info {
          // declare attributes and methods here
      };
  
      template &lt;typename T, int n&gt;
      class Using
      {
        public:
          Using() {}
          ~Using() {}
          void display(T a, T b)
          {
              cout &lt;&lt; a.s &lt;&lt; b.s &lt;&lt; endl;    // T will be other class which has `int s` attribute
          }
      };
  }  // end of namespace
  </code></pre>
  
  <p>I tried writing cython code as below but unsuccessfully:</p>
  
  <p>The .pxd file:</p>
  
  <pre><code>cdef extern from "dev.h" namespace "abc":
      cdef cppclass Status:
          // declare attributes and methods of Status class here
  
  cdef extern from "dev.h" namespace "abc":
      cdef cppclass Info:
          // declare attributes and methods of Info class here
  
  cdef extern from "dev.h" namespace "abc":
      cdef cppclass Using[T, int]:
          Using() except +
          void display(T a, T b) except +
  </code></pre>
  
  <p>The .pyx file:</p>
  
  <pre><code>cimport dev as cpp
  
  cdef class Status:
      ... cdef and def for stuffs of Status class ...
  
  cdef class Info:
      ... cdef and def for stuffs of Info class ...
  
  cdef class Using:
      cdef cpp.Using&lt;cpp.Status, 3&gt; *c_using
  
      def __cinit__(self):
          self.c_using = new cpp.Using&lt;cpp.Status, 3&gt;()
  
      def __dealloc__(self):
          del self.c_using
  
      cdef display(self, cpp.Status obja, cpp.Status objb):
          self.c_using.display(obja, objb)
  </code></pre>
  
  <p>I compile the cython code with <code>python3 setup.py build_ext --inplace</code>, then it took 2 errors as below:</p>
  
  <pre><code>    cdef cpp.Using&lt;cpp.Status, 3&gt; *c_using
                   ^
  Error: Empty declarator
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    cdef cpp.Using&lt;cpp.Status, 3&gt; *c_using
                   ^
  Error: Syntax error in C variable declaration
  </code></pre>
  
  <p>What could I write in pxd and pyx files for this situation?</p>
  
  <p>Thank so much for your help!</p>