CMap and struct
- From: Vahid <vahid.ha@xxxxxxxxx>
- Date: 2 May 2007 18:32:54 -0700
I have a struct in my program defined as below:
struct SDataType {
unsigned long nNamespace;
unsigned long nDataType;
SDataType& operator=(SDataType& s2) { nNamespace = s2.nNamespace;
nDataType = s2.nDataType; return *this; }
bool operator==(SDataType s2) { return ((nNamespace ==
s2.nNamespace) && (nDataType == s2.nDataType)); }
};
And I have defined a CMap variable as below:
CMap<SDataType, SDataType&, unsigned int, unsigned int> map;
However, I get this compilation error:
error C2679: binary '=' : no operator found which takes a right-hand
operand of type 'const SDataType' (or there is no acceptable
conversion)
which refers to this portion of "template<class KEY, class ARG_KEY,
class VALUE, class ARG_VALUE>
void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetNextAssoc(POSITION&
rNextPosition, KEY& rKey, VALUE& rValue) const" function in
afxtempl.h:
rKey = pAssocRet->key;
Does anyone know how this problem can be resolved? I'd appreciate your
help.
.
- Follow-Ups:
- Re: CMap and struct
- From: David Wilkinson
- Re: CMap and struct
- From: Joseph M . Newcomer
- Re: CMap and struct
- Prev by Date: Accessing tables in MFC application
- Next by Date: Re: CMap and struct
- Previous by thread: Accessing tables in MFC application
- Next by thread: Re: CMap and struct
- Index(es):
Loading