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

refactor(geo): Use hidden friend for SourfaceBounds operators #3543

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions Core/include/Acts/Surfaces/SurfaceBounds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,17 @@ class SurfaceBounds {
///
/// @param os is the outstream in which the string dump is done
virtual std::ostream& toStream(std::ostream& os) const = 0;
};

inline bool operator==(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
if (&lhs == &rhs) {
return true;
friend bool operator==(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
if (&lhs == &rhs) {
return true;
}
return (lhs.type() == rhs.type()) && (lhs.values() == rhs.values());
}
return (lhs.type() == rhs.type()) && (lhs.values() == rhs.values());
}

inline bool operator!=(const SurfaceBounds& lhs, const SurfaceBounds& rhs) {
return !(lhs == rhs);
}

inline std::ostream& operator<<(std::ostream& os, const SurfaceBounds& sb) {
return sb.toStream(os);
}
friend std::ostream& operator<<(std::ostream& os, const SurfaceBounds& sb) {
return sb.toStream(os);
}
};

} // namespace Acts
Loading