title: Error in template: Iterator was not declared in the scope
body: <p>trying to make a template, but I have an error in gcc4 but not in VS2008. This is the code that fails:</p>
  
  <pre><code>#pragma once
  #ifndef _ZELESTE_ZEL_GPX_GENERALMANAGER_H_
  #define _ZELESTE_ZEL_GPX_GENERALMANAGER_H_
  
  #include "../internal/cuCoreLib.h"
  #include "boost/functional/hash.hpp"
  #include "boost/ptr_container/ptr_map.hpp"
  
  namespace z3d{
      namespace core{
          template&lt;class Key, class Value&gt;
          class cuManager
          {
              boost::ptr_map&lt;Key, Value&gt; m_ItemMap;
  
          public:
              /**
              * Default constructor
              */
              cuManager(void){}
  
              /**
              * Get a vector that contain the keys of the elements contained in the manager.
              * @return an const std::vector of type Key 
              */
              const std::vector&lt;Key&gt; getKeys()
              {
                      boost::ptr_map&lt;Key,Value&gt;::iterator itr = m_ItemMap.begin();
                      std::vector&lt;Key&gt; v;
                      while(itr != m_ItemMap.end())
                      {
                              v.push_back(itr-&gt;first);
                              ++itr;
                      }
                      return v;
              }
  
            }
          };
      };
  </code></pre>
  
  <p>This is one of the methods that fails to compile (all methods of the class fail in the same iterator). This code works fine into visual studio but compilation in GCC return this error:</p>
  
  <pre><code>/home/dev001/desarrollo/code/lpgameengine/LPGameEngine/src/core/datatypes/cuManager.h: In member function ‘const std::vector&lt;_Tp, std::allocator&lt;_CharT&gt; &gt; z3d::core::cuManager&lt;Key, Value&gt;::getKeys()’:
  /home/dev001/desarrollo/code/lpgameengine/LPGameEngine/src/core/datatypes/cuManager.h:28: error: expected ‘;’ before ‘itr’
  /home/dev001/desarrollo/code/lpgameengine/LPGameEngine/src/core/datatypes/cuManager.h:30: error: ‘itr’ was not declared in this scope
  </code></pre>
  
  <p>Any help will be welcome</p>