The function is declared twice (I thought it was normal) and defined once.
It does not depend on whether you define the function a second time. The fact is that you declare this function twice, and this is not normal.
This also does not compile with the same error message:
struct foo { void bar(); void bar(); };
You cannot re-declare the same function with the same list of parameters inside the class definition:
'void foo::bar()' cannot be overloaded with 'void foo::bar()'.
source share