title: Creating own iterator for double vectors
body: <p>I am a bit new at c++, so the question may be without any meaning, so, sorry about that in advance.
  So, i have a class of hashtable, my hashtable is vector of vectors, it means that i used </p>
  
  <pre><code>std::vector&lt;std::vector&lt;std::string&gt; &gt; htable;
  </code></pre>
  
  <p>My task is - create own iterator with operation ++, --, -> and *. I wrote this </p>
  
  <pre><code>    class hashTable
  {
  public: 
      hashTable(int size);
      ~hashTable();
      void add(std::string s);
      bool inHash(std::string s);
      void deletestr(std::string s);
      void printall();
      int maxcoll();
  
  private:
      std::vector&lt;std::vector&lt;std::string&gt; &gt; htable;
      std::vector&lt;std::vector&lt;std::string&gt; &gt; newhtable;
      int hfunc(std::string s);
      void reallocate();
      int M;
      int teksize;
      int issame(std::string a, std::string b);
  
      class myiterator{
          myiterator();
          myiterator operator*();
          myiterator operator++();
          myiterator operator--();
          myiterator operator-&gt;();
  
      };
      myiterator begin() {return htable.begin()}
      myiterator end() {return htable.end()}
  
  };
  </code></pre>
  
  <p>I think, that i understand what the interator is, but now i suppose that i was wrong, so when i try to compile this, there is a mistake in lines </p>
  
  <pre><code>myiterator begin() {return htable.begin()}
  myiterator end() {return htable.end()}
  </code></pre>
  
  <p>/Users/ratkke/Programms/c++/mipt/tasks/#5/myhash.cpp:37:29: error: no viable conversion from 'iterator' (aka '__wrap_iter') to 'hashTable::myiterator'
          myiterator begin() {return htable.begin()}
                                     ^~~~~~~~~~~~~~
  /Users/ratkke/Programms/c++/mipt/tasks/#5/myhash.cpp:29:8: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'iterator' (aka '__wrap_iter') to 'const hashTable::myiterator &amp;' for 1st argument
          class myiterator{</p>
  
  <p>And i don't know why. Also, can you tell me about realisation of iterator(or just link to article) for iterator for vectors, because i can't understand how i must implement all this operators.
  Thank you in advance. </p>