I was writing wrapper methods for Boost unordered map container. In boost Unordered Map there is a method begin(), which returns an iterator to the first element. In my wrapper i trying to write a templatized wrapper. For example
template< class Tkey, class Tvalue>
class CMyUnorderedMap
{
boost::Unordered_map<TKey, TValue> m_myMap;
public:
boost::unordered_map<TKey, TValue>::iterator Begin();
};
template< class Tkey, class Tvalue>
boost::unordered_map<TKey, TValue>::iterator CMyUnorderedMap< TKey, TValue >::Begin()
{
return m_myMap.begin()
}
While compiling the above code(with template argument) i am getting compilation error in VS 2010 as below.
warningc4346: boost::unordered::unordered_map< TKey, TValue>::iterator : dependent name is not a type.
error C3860 template argument list following class template name must list paramaters in the order used in tempate paramater list
But if i compile the code with out template argument the code complies. for example if a specify like below it works
boost::unordered_map< std::string, std::string>::iterator Begin();
Will any one help