title: Using iterators of vector created via swig
body: <p>I'm using the std_vector.i library provided by SWIG to managed c++ vectors in python. My simplified interface file is:</p>
  
  <pre><code>%include "std_vector.i"
  
  namespace std {
   %template(MyClassVector) vector&lt;MyClass_c&gt;;
  }
  </code></pre>
  
  <p>This are the available attributes for wrap vectors:</p>
  
  <pre><code>['back', 'begin', 'capacity', 'clear', 'empty', 'end', 'erase', 'front', 'get_allocator', 'insert', 'iterator', 'pop', 'pop_back', 'push_back', 'rbegin', 'rend', 'reserve', 'resize', 'size', 'this']
  </code></pre>
  
  <p>How can I use the iterator returned by the begin attribute to access the first element? For example:</p>
  
  <pre><code>&gt;&gt;&gt;myVector = MyClassVector()
  &gt;&gt;&gt;foo1 = MyClass_c()
  &gt;&gt;&gt;foo2 = MyClass_c()
  &gt;&gt;&gt;foo3 = MyClass_c()
  &gt;&gt;&gt;myVector.push_back(foo1)
  &gt;&gt;&gt;myVector.push_back(foo2)
  &gt;&gt;&gt;myVector.push_back(foo3)
  &gt;&gt;&gt;it = myVector.begin()
  </code></pre>
  
  <p>This is what I get when I print the available attributes for an iterator:</p>
  
  <pre><code>['advance', 'copy', 'decr', 'distance', 'equal', 'incr', 'next', 'previous', 'this', 'value']
  </code></pre>
  
  <p>Obviously the iterator can't be used with "->" as in C++. How is the proper way to use this?
  Thanks in advance!</p>