title: cython - how to iterate over c++ list
body: <p>I want to initiate a <code>cpp list</code> in cython, assign values to it and then iterate over the list to obtain its values. A generic code could look like this:</p>
  <pre><code>from libcpp.list cimport list as cpplist
  from cpython cimport array
  import array
  
  cdef int[:] c_volumecheck(int n, int comb):
  
      cdef:
          array.array match = array.array('i', [0]*(n*comb))        
          int[:] match_c = match
          cpplist[int] arr
      
      asign(match_c, comb, n, arr)
  
      return match_c
  
  
  cdef void asign(int[:] match, int row, int col, cpplist[int] arr):
  
      cdef int j, i
  
      for j in range(row):
          for i in range(col):
              arr.push_back(1)
  
      for j in range(row):
          for i in range(col):
              match[j*col + i] = arr[j*col +i]
  </code></pre>
  <p>However, when I compile this I get the error:</p>
  <blockquote>
  <p>Indexing <code>list[int]</code> not supported for index type <code>int</code></p>
  </blockquote>
  <p>Given the way they iterate over cpp vectors <a href="http://docs.cython.org/en/latest/src/userguide/wrapping_CPlusPlus.html#standard-library" rel="nofollow noreferrer">here</a> I thought that would be the way to go.</p>