diff --git a/src/DHTPeerAnnounceStorage.cc b/src/DHTPeerAnnounceStorage.cc index 1bbb1778..37b4bf82 100644 --- a/src/DHTPeerAnnounceStorage.cc +++ b/src/DHTPeerAnnounceStorage.cc @@ -59,7 +59,7 @@ DHTPeerAnnounceStorage::DHTPeerAnnounceStorage() bool DHTPeerAnnounceStorage::InfoHashLess:: operator()(const std::shared_ptr& lhs, - const std::shared_ptr& rhs) + const std::shared_ptr& rhs) const { return memcmp(lhs->getInfoHash(), rhs->getInfoHash(), DHT_ID_LENGTH) < 0; } diff --git a/src/DHTPeerAnnounceStorage.h b/src/DHTPeerAnnounceStorage.h index b966b599..94fd6be0 100644 --- a/src/DHTPeerAnnounceStorage.h +++ b/src/DHTPeerAnnounceStorage.h @@ -54,7 +54,7 @@ private: class InfoHashLess { public: bool operator()(const std::shared_ptr& lhs, - const std::shared_ptr& rhs); + const std::shared_ptr& rhs) const; }; typedef std::set, InfoHashLess> DHTPeerAnnounceEntrySet; diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc index 86c815d8..363cb6ff 100644 --- a/src/SessionSerializer.cc +++ b/src/SessionSerializer.cc @@ -143,7 +143,10 @@ namespace { template class Unique { typedef T type; struct PointerCmp { - inline bool operator()(const type* x, const type* y) { return *x < *y; } + inline bool operator()(const type* x, const type* y) const + { + return *x < *y; + } }; std::set known;