THRIFT-4762: Applied some C++11 refactorings to the runtime library and compiler (#1719)
* make use of C++11 override keyword
* added const specifier to TTransport::getOrigin()
* added more const correctness to the compiler
* make use of auto keyword
* replaced usage of NULL with nullptr
* make use of explicitly-defaulted function definition
* extended changelog
diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index a922826..313572a 100644
--- a/lib/cpp/test/concurrency/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
@@ -44,9 +44,9 @@
_success(false),
_done(false) {}
- ~Task() { std::cerr << this << std::endl; }
+ ~Task() override { std::cerr << this << std::endl; }
- void run() {
+ void run() override {
_endTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
_success = (_endTime - _startTime) >= _timeout;
@@ -215,7 +215,7 @@
// Verify behavior when removing the removed task
try {
timerManager.remove(timer);
- assert(0 == "ERROR: This remove should send a NoSuchTaskException exception.");
+ assert(nullptr == "ERROR: This remove should send a NoSuchTaskException exception.");
} catch (NoSuchTaskException&) {
}
@@ -244,7 +244,7 @@
// Verify behavior when removing the expired task
try {
timerManager.remove(timer);
- assert(0 == "ERROR: This remove should send a NoSuchTaskException exception.");
+ assert(nullptr == "ERROR: This remove should send a NoSuchTaskException exception.");
} catch (NoSuchTaskException&) {
}