From 8de5a696917a26e904b2c145a9ecd984f166a8cf Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Wed, 27 Dec 2023 19:49:15 +0100 Subject: [PATCH] chore(core): use hidden friends --- core/include/prometheus/client_metric.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/include/prometheus/client_metric.h b/core/include/prometheus/client_metric.h index df0ca8d3..ff4504cd 100644 --- a/core/include/prometheus/client_metric.h +++ b/core/include/prometheus/client_metric.h @@ -16,12 +16,12 @@ struct PROMETHEUS_CPP_CORE_EXPORT ClientMetric { std::string name; std::string value; - bool operator<(const Label& rhs) const { - return std::tie(name, value) < std::tie(rhs.name, rhs.value); + friend bool operator<(const Label& lhs, const Label& rhs) { + return std::tie(lhs.name, lhs.value) < std::tie(rhs.name, rhs.value); } - bool operator==(const Label& rhs) const { - return std::tie(name, value) == std::tie(rhs.name, rhs.value); + friend bool operator==(const Label& lhs, const Label& rhs) { + return std::tie(lhs.name, lhs.value) == std::tie(rhs.name, rhs.value); } }; std::vector