diff --git a/include/proxysql_gtid.h b/include/proxysql_gtid.h index 44d480e08..68931c057 100644 --- a/include/proxysql_gtid.h +++ b/include/proxysql_gtid.h @@ -28,9 +28,9 @@ class TrxId_Interval { const bool merge(const TrxId_Interval& other); const int cmp(const TrxId_Interval& other); - const bool operator<(const TrxId_Interval& other); - const bool operator==(const TrxId_Interval& other); - const bool operator!=(const TrxId_Interval& other); +bool operator<(const TrxId_Interval& other) const; +bool operator==(const TrxId_Interval& other) const; +bool operator!=(const TrxId_Interval& other) const; }; // Encapsulates a map of UUID -> trxid intervals. diff --git a/lib/proxysql_gtid.cpp b/lib/proxysql_gtid.cpp index 0f3b423de..d63eeba7d 100644 --- a/lib/proxysql_gtid.cpp +++ b/lib/proxysql_gtid.cpp @@ -158,15 +158,15 @@ const int TrxId_Interval::cmp(const TrxId_Interval& other) { return 0; } -const bool TrxId_Interval::operator<(const TrxId_Interval& other) { +bool TrxId_Interval::operator<(const TrxId_Interval& other) const { return cmp(other) == -1; } -const bool TrxId_Interval::operator==(const TrxId_Interval& other) { +bool TrxId_Interval::operator==(const TrxId_Interval& other) const { return cmp(other) == 0; } -const bool TrxId_Interval::operator!=(const TrxId_Interval& other) { +bool TrxId_Interval::operator!=(const TrxId_Interval& other) const { return cmp(other) != 0; }