security+util: remove overloaded operator!()
Identity, Key, and EventId already provide an operator bool(),
which covers all valid use cases.
Change-Id: I57b11db6997e6f537873f41c6ca1c22140b894c3
diff --git a/src/util/scheduler.cpp b/src/util/scheduler.cpp
index 8e72e78..3170f61 100644
--- a/src/util/scheduler.cpp
+++ b/src/util/scheduler.cpp
@@ -21,6 +21,7 @@
#include "scheduler.hpp"
#include "detail/monotonic-deadline-timer.hpp"
+
#include <boost/scope_exit.hpp>
namespace ndn {
@@ -50,10 +51,9 @@
EventQueue::const_iterator queueIt;
};
-bool
-EventId::operator!() const
+EventId::operator bool() const
{
- return m_info.expired() || m_info.lock()->isExpired;
+ return !m_info.expired() && !m_info.lock()->isExpired;
}
bool
diff --git a/src/util/scheduler.hpp b/src/util/scheduler.hpp
index 2393535..2139c76 100644
--- a/src/util/scheduler.hpp
+++ b/src/util/scheduler.hpp
@@ -23,8 +23,9 @@
#define NDN_UTIL_SCHEDULER_HPP
#include "time.hpp"
-#include <set>
+
#include <boost/asio/io_service.hpp>
+#include <set>
namespace ndn {
namespace util {
@@ -64,17 +65,7 @@
* \retval false This EventId is empty, or the event is expired or cancelled.
*/
explicit
- operator bool() const
- {
- return !this->operator!();
- }
-
- /**
- * \retval true This EventId is empty, or the event is expired or cancelled.
- * \retval false The event is valid.
- */
- bool
- operator!() const;
+ operator bool() const;
/**
* \return whether this and other refer to the same event, or are both empty/expired/cancelled