开发者

STL map instantiating

have next code:

class GameTexture
{
private:
LPDIRECT3DTEXTURE9 texture;
unsigned char *alphaLayer;
UINT w开发者_运维知识库idth, height;

GameTexture() {};
GameTexture(const GameTexture&) {}
public:
static GameTexture *CreateTexture(LPCTSTR  pSrcFile, LPDIRECT3DDEVICE9 d3dDevice);

~GameTexture();
};

class TexturesPool
{
private:
map<string, GameTexture*> textures;

and got next

1>c:\program files\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xtree(1885) : see declaration of 'std::operator <'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xfunctional(124) : while compiling class template member function 'bool std::less<_Ty>::operator ()(const _Ty &,const _Ty &) const'
1>          with
1>          [
1>              _Ty=std::string
1>          ]
1>          c:\program files\microsoft visual studio 10.0\vc\include\map(71) : see reference to class template instantiation 'std::less<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=std::string
1>          ]
............


It's possible that you're missing #include <string> which is where the missing operator< should be declared.

Some of MSVC's headers forward-declare std::string, but do not actually include <string> itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜