I have a class called Device with private field ID,Type and Number. I have a bigger project but i will present only a little part here. Let's say i create an object of this class in the main and then i want to overload the > operator in order to check if the ID field of the object is bigger than a variable defined in the main called max.
i then want..
1 2 3 4 5 6
for this overloading i used the following code
1 2 3 4 5 6 7
bool device::operator>(constint& code)
if (ID > code)
and it is working fine...
now i want to set..
where i mean the field ID of obj is equal to max..
can you help me?
i think is difficult because usually the object is the left-part of the = but now is the right part, so i guess there is some specific code.