ATL和std :: map问题 [英] Problem with ATL and std::map

查看:81
本文介绍了ATL和std :: map问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我不是我要更新的代码的作者这一事实,我深表歉意,但我会尽全力激励它.

I apologize for the fact that I am not the author of the code I am trying to update but I will do my best to motivate it.

我们在代码中一直使用以下typedef:

We have been using the following typedef in our code:

typedef std :: map< CAdapt< CComBSTR> ;, long > MapCollectionType;

typedef std::map<CAdapt<CComBSTR>, long> MapCollectionType;

编译后会在VS 2003中找到,但是我们试图将项目移植到VS 2008,现在我们收到以下错误消息:

错误1错误C2061:语法错误:标识符'_Wherenode'c:\ Program Files \ Microsoft Visual Studio 9.0 \ VC \ include \ xtree 1411

c:\ Program Files \ Microsoft Visual Studio 9.0 \ VC \ include \ xtree(1411):错误C2061:语法错误:标识符'_Wherenode'

c:\ Program Files \ Microsoft Visual Studio 9.0 \ VC \ include \ xtree(1408):在编译类模板成员函数'std :: _ Tree_nod< _Traits> :: _ Node * std :: _ Tree< _Traits> :: _ Buynode(std :: _ Tree_nod< _Traits> :: _ Node *,std :: _Tree_nod< _Traits> :: _ Node *,std :: _ Tree_nod< _Traits> :: _ Node *,const std :: pair< _Ty1,_Ty2>&,char)'

[

_Traits = std :: _ Tmap_traits< ATL :: CAdapt< ATL: :CComBSTR> ;,长,std :: less< ATL :: CAdapt< ATL :: CComBSTR>,std :: allocator< std :: pair< const ATL :: CAdapt< ATL :: CComBSTR>,long> ,false>,

_Ty1 = const ATL :: CAdapt< ATL :: CComBSTR> ;,

_Ty2 = long

]

c:\ Program Files \ Microsoft Visual Studio 9.0 \ VC \ include \ map(78):请参见对类模板实例化'std :: _ Tree< _Traits>'的引用正在编译

[

_Traits = std :: _ Tmap_traits< ATL :: CAdapt< ATL: :CComBSTR> ;,长,std :: less< ATL :: CAdapt< ATL :: CComBSTR>,std :: allocator< std :: pair< const ATL :: CAdapt< ATL :: CComBSTR>,long> ,false>

]

c:\ documents and settings \ lmartin \ perforce \ lmartin_damtest09_workspace \ mediabin \ main \ clientinterfaces \ mbpscriptmodel \ MBObjectCollection.h(266):请参见对类模板实例化'std :: map< _Kty,_Ty>'的引用正在编译

[

_Kty = ATL :: CAdapt< ATL :: CComBSTR>,

_Ty = long

]

typedefs和STL向量的相似代码似乎没有相同的问题.我已经阅读了有关CAdapt的文档,并且已经对错误进行了搜索,但是还没有找到相关的内容.任何帮助都将不胜感激.

Similar code that typedefs and STL vector does not seem to have the same problem.  I have read the documentation on CAdapt and have done searches on the errors but have yet to find somethng relevant.  Any help greatly appreciated.

谢谢

莱曼·赫德

Interwoven,Inc.

Interwoven, Inc.

推荐答案

我只是在2008年将以下代码放入控制台应用程序,并且编译时没有错误.

I just put the following code into a console app in 2008 and it compiles with no errors.

#include< map>
int main( void {
std :: map< ATL :: CAdapt< ATL :: CComBSTR>, > foo;
foo [ATL :: CComBSTR()] = ();
}
#include <atlbase.h> 
#include <map> 
 
int main( void ) 
    std::map< ATL::CAdapt<ATL::CComBSTR>, long > foo; 
 
    foo[ ATL::CComBSTR() ] = long(); 
}


这篇关于ATL和std :: map问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆