Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not finding operator overloading in the header file #170

Open
arseni-mourzenko opened this issue Feb 26, 2024 · 0 comments
Open

Not finding operator overloading in the header file #170

arseni-mourzenko opened this issue Feb 26, 2024 · 0 comments

Comments

@arseni-mourzenko
Copy link

I have a SparklineValue.h file which looks like that:

namespace visualizations {
struct SparklineValue {
    ...
    friend QDataStream &operator <<(QDataStream &s, const SparklineValue &x);
    friend QDataStream &operator >>(QDataStream &s, SparklineValue &x);
    ...
};
}

and the corresponding SparklineValue.cpp:

#include "SparklineValue.h"

namespace visualizations {
QDataStream &operator <<(QDataStream &s, const SparklineValue &x) {
    ...
    return s;
}

QDataStream &operator >>(QDataStream &s, SparklineValue &x) {
    ...
    return s;
}
}

Although the code compiles and runs correctly, cppclean complains that:

./src/visualizations/sparkline/SparklineValue.cpp:17: 'operator<<' not found in expected header './src/visualizations/sparkline/SparklineValue.h' or any other directly #included header

Shouldn't it find the operator overloading in the header file? Or am I doing it wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant