本文介绍了如何存储CMap数据的CMap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi,
i want to use the CMap of CMap for storing some data
e.g.
class A{
CMap<CString, LPCSTR,B,B&> mapB;
CString name;
};
class B{
CString name;
};
and now i want use the
CMap<CString, LPCSTR,A,A&> mapA;
on compiling here it was giving the error like
"'operator =' function is unavailable"
so in class A i added operator
void operator=(const A& ao_obj){
//what should i write here
}
then it compiled with 0 errors
and then i added data in map A
CString key="1";
A aobj;
aobj.name="SomeName";
mapA[key] = aobj;
Now at the time of retrieving this A object
it is not storing the value in the object
means
CString k1="1";
A objA;
mapA.Lookup(k1,objA);
so here it should store the value in objA
but it is not doing this
it is happening because of operator=
what should i write in 'operator=' function?
推荐答案
这篇关于如何存储CMap数据的CMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!