Skip to content

Commit 8de5a69

Browse files
committed
chore(core): use hidden friends
1 parent 1abb424 commit 8de5a69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/include/prometheus/client_metric.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ struct PROMETHEUS_CPP_CORE_EXPORT ClientMetric {
1616
std::string name;
1717
std::string value;
1818

19-
bool operator<(const Label& rhs) const {
20-
return std::tie(name, value) < std::tie(rhs.name, rhs.value);
19+
friend bool operator<(const Label& lhs, const Label& rhs) {
20+
return std::tie(lhs.name, lhs.value) < std::tie(rhs.name, rhs.value);
2121
}
2222

23-
bool operator==(const Label& rhs) const {
24-
return std::tie(name, value) == std::tie(rhs.name, rhs.value);
23+
friend bool operator==(const Label& lhs, const Label& rhs) {
24+
return std::tie(lhs.name, lhs.value) == std::tie(rhs.name, rhs.value);
2525
}
2626
};
2727
std::vector<Label> label;

0 commit comments

Comments
 (0)