Hi,
I have a base class for my managers like this:
template <class tHandle,class tResource,class tFactoryHashType, class tHashType>
class cMgrHashed
{
public:
typedef typename std::hash_map<tHashType,tHandle>::iterator cResIt;
inline cResIt getFirst () {return resMap.begin();}
inline cResIt getLast () {return resMap.end();}
//...
private:
typedef std::hash_map<tHashType,tHandle> cResMap;
cResMap resMap;
}
Then i have a mgr for my vertexbuffers like this:
#include "GRaVertexBuffer.h"
class cVbMgr : public VA::HBRM::cMgrHashed<cVbHndl,aVertexBuffer,std::string,std::string>
{
public:
void Foo();
};
void cVbMgr::Foo()
{
for(cVbIt it = getFirst();it!=getLast();++it)
{
}
}
cVbIt is declared as following:
typedef VA::HBRM::cMgrHashed<cVbHndl,aVertexBuffer,std::string,std::string>::cResIt cVbIt;
This gives me the following error on cVbIt in the for lus:
p:\Programmatie\C++\MyLibs\Renderer\GRcVbMgr.cpp(160): error C2440: 'initializing' : cannot convert from 'VA::HBRM::cMgrHashed<tHandle,tResource,tFactoryHashType,tHashType>::cResIt' to 'std::list<_Ty,_Ax>::iterator'
with
[
tHandle=GR::cVbHndl,
tResource=VA::HBRM::tResource,
tFactoryHashType=VA::HBRM::tFactoryHashType,
tHashType=VA::HBRM::tHashType
]
and
[
_Ty=stdext::_Hmap_traits<std::string,GR::cVbHndl,stdext::hash_compare<std::string,std::less<std::string>>,std::allocator<std::pair<const std::string,GR::cVbHndl>>,false>::value_type,
_Ax=stdext::_Hmap_traits<std::string,GR::cVbHndl,stdext::hash_compare<std::string,std::less<std::string>>,std::allocator<std::pair<const std::string,GR::cVbHndl>>,false>::allocator_type
]
Why does he want to convert my hashmap iterator to a list iterator???
greets