Why is this an issue?
For clarity, all overloads of the same method should be grouped together. That lets both users and maintainers quickly understand all the current
available options.
Noncompliant code example
class Example {
public:
void foo(int x); // NonCompliant
void notFoo(int x);
void foo(double x); // Should be moved next to its overload
private:
void foo(long x); // Okay since the function has different access specifier
};
Compliant solution
class Example {
public:
void foo(int x); // Compliant
void foo(double x);
void notFoo(int x);
private:
void foo(long x); // Okay since the function has different access specifier
};