Вот объявление класса:
class i2c_p
{
public:
unsigned short adr;
void operator = (unsigned short a);
i2c_p operator + (unsigned short a);
i2c operator [] (unsigned short i);
operator char();
i2c operator * ();
i2c_p(unsigned short a);
};
использую его так:
i2c_p p(10),q(20);
p=q; //так компилирует
p=q+1 //а так пишет ошибку
Error[Pe350]: more than one operator "+" matches these operands:
built-in operator "arithmetic + arithmetic"
function "i2c_p::operator+(unsigned short)"
operand types are: i2c_p __near + int