I've got a very simple piece of code
class instance assignement:
class ABC {
public:
void set(const ABC* obj) {
*this = *obj;
}
ABC& operator=(const ABC* obj);
};
ABC& ABC::operator = (const ABC *obj){
if(obj!= this) set(obj);
return *this;
}
This is a classic book example,
but CLing-Tidy highlight 'ABC&' in method realization line
ABC& ABC::operator = (const ABC *obj){
...
says:
Clang-Tidy: Operator=() should return 'ABC&'
Could you suggest what is wrong with this code?
It works, but Clang-Tidy doesn't like it.
Thanks in advance guys,
Have a nice code.