title: C++ typedef, map, iterator
body: <p>Can anybody help me with an iterator problem? I'm having something like this:</p>
  
  <pre><code>class SomeClass{
  
  public:
      //Constructor assigns to m_RefPtr a new t_Records
      //Destructor deletes m_RefPtr or decreases m_RefCnt
      //Copy Constructor assigns m_RefPtr to new obj, increases m_RefCnt
      bool Search(const string &amp;);
  
  private:
      //Some private variables
  
      struct t_Records{ //For reference counting
  
          int m_RefCnt; //Reference counter
  
          typedef vector&lt;int&gt; m_Vec;
          typedef map&lt;string, m_Vec&gt; m_Map;
          m_Map m_RecMap;
  
          t_Records(void){
              m_RefCnt = 1;
          }
  
      };
  
      t_Records * m_RefPtr;
  
  };
  
  //Searchs through the map of m_RefPtr, returns true if found
  bool SomeClass::Search(const string &amp; keyword){
  
      //How to create and use an iterator of m_Map???
  
      return true;
  
  }
  </code></pre>
  
  <p>As how I mentioned, I'm having troubles with creating (defining) map iterator outside of the struct. The map is initalized and contains some records. Thanks for your reply.</p>