为什么我象如下那样声明会出错?
#include <map>
using namespace std;
map<int, CString,int,CString> pFunList;

解决方案 »

  1.   

    typedef map<int, CString> pFunList;
    就可以了如果要定义复合结构,后面应该用结构体
      

  2.   

    1、
    建议搂主用mfc中的cmap:
    map<int,int,CString,CString> pFunList;2、c++中的map类定义如下,不符合搂主的要求
    template <
       class Key, 
       class Type, 
       class Traits = less<Key>, 
       class Allocator=allocator<pair <const Key, Type> > 
    >
    class map
      

  3.   

    #include <map>
    using namespace std;
    map<int, CString> pFunList;
    这样就行了 Key: int 
              Context: CString object还是使用模板原形看着舒服 MFC的 恶心包装 -_-!
      

  4.   

    map<int, CString,int,CString> // 要出错第一、二个class作为索引不可以是MFC类,假如修改成map<int, int, CString, CString>就不会报错了。