Я застрял на следующем и мог бы использовать некоторую помощь:
typedef unsigned short USHORT;
template <typename DataType>
class Primative
{
protected:
DataType m_dtValue;
public:
Primative() : m_dtValue(0) {}
DataType operator=(const DataType c_dtValue) { return m_dtValue = c_dtValue; }
DataType Set(const DataType c_dtValue){ return m_dtValue = c_dtValue; }
};
typedef Primative<USHORT> PrimativeUS;
class Evolved : public PrimativeUS
{
public:
Evolved() {}
};
int main()
{
PrimativeUS prim;
prim = 4;
Evolved evo;
evo.Set(5); // good
evo = USHORT(5); // error, no operator found which takes a right-hand operator...
}
Похоже, производный класс не получает перегруженный оператор