title: error C2760: syntax error: unexpected token 'identifier', expected ';' at map iterator
body: <p>I had created a class inheriting <code>std::map</code> and trying to get value at particular index using an method.</p>
  
  <pre><code>#define MYAPI_EXPORTS
  #ifdef MYAPI_EXPORTS  
  #define MY_API __declspec(dllexport)
  #else  
  #define MY_API __declspec(dllimport)   
  #endif
  
      template&lt;class _Value&gt;
      class MY_API MyDictionary : public std::map&lt;std::string, _Value&gt;
      {
          _Value GetItem(int index)
          {
              std::map&lt;std::string, _Value&gt;::iterator itr = this-&gt;begin(); //compile error at this line
  
              int c = 0;
              while (c &lt; index)
              {
                  itr++;
                  c++;
              }
              return itr-&gt;second;
          }
      };
  </code></pre>
  
  <p>'std::map::iterator itr' this line shows error while compiling.</p>
  
  <p>the errors are</p>
  
  <pre><code>error C2760: syntax error: unexpected token 'identifier', expected ';'
  error C7510: 'iterator': use of dependent type name must be prefixed with 'typename'
  </code></pre>
  
  <p>It seems like iterator type is not defined in compile time. Is there any solution to fix this?</p>