Extra qualification on member error on g++

less than 1 minute read

In C++ you declared a method and tried to compile it and boom you get an error like this: extra qualification x on member y. You get this error because you try to declare a method in class definition like this:

class Individual {
	Individual& Individual::operator= (Individual &target);

You cannot declare a method inside a class like this. Instead, remove :: part.

class Individual {
	Individual& operator= (Individual &target);

Now you are good to go!



Leave a Comment