diff --git a/c++/src/kj/main.c++ b/c++/src/kj/main.c++ index 4d84294a..d25369f4 100644 --- a/c++/src/kj/main.c++ +++ b/c++/src/kj/main.c++ @@ -631,7 +631,7 @@ void MainBuilder::MainImpl::usageError(StringPtr programName, StringPtr message) class MainBuilder::Impl::OptionDisplayOrder { public: - bool operator()(const Option* a, const Option* b) { + bool operator()(const Option* a, const Option* b) const { if (a == b) return false; char aShort = '\0'; diff --git a/c++/src/kj/time.c++ b/c++/src/kj/time.c++ index 5b3b4334..ead7e4c1 100644 --- a/c++/src/kj/time.c++ +++ b/c++/src/kj/time.c++ @@ -41,7 +41,7 @@ Clock& nullClock() { struct TimerImpl::Impl { struct TimerBefore { - bool operator()(TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs); + bool operator()(TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs) const; }; using Timers = std::multiset; Timers timers; @@ -75,7 +75,7 @@ private: }; inline bool TimerImpl::Impl::TimerBefore::operator()( - TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs) { + TimerPromiseAdapter* lhs, TimerPromiseAdapter* rhs) const { return lhs->time < rhs->time; }