Code:
class aClass
{
public:
int a;
const aClass Sum(const aClass& c)
{
aClass Result;
Result.a = a + c.a;
return Result;
}
void SumTo(const aClass c)
{
*this = Sum(c);
}
};
By saying 'using its member variables' i mean using the Sum member functions
By saying 'using it directly' i mean using the SumTo
This is of course a very rough example, but that's the idea.
The compiler, when i pass an aClass through another struct or class instance, throws an error that 'this' function discards qualifiers. What does it mean?
Many thanks for the interest guys!