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/ThreadFactoryTests.h b/lib/cpp/test/concurrency/ThreadFactoryTests.h
index ad1613b..febe3f8 100644
--- a/lib/cpp/test/concurrency/ThreadFactoryTests.h
+++ b/lib/cpp/test/concurrency/ThreadFactoryTests.h
@@ -51,7 +51,7 @@
public:
ReapNTask(Monitor& monitor, int& activeCount) : _monitor(monitor), _count(activeCount) {}
- void run() {
+ void run() override {
Synchronized s(_monitor);
if (--_count == 0) {
@@ -122,7 +122,7 @@
SynchStartTask(Monitor& monitor, volatile STATE& state) : _monitor(monitor), _state(state) {}
- void run() {
+ void run() override {
{
Synchronized s(_monitor);
if (_state == SynchStartTask::STARTING) {
@@ -247,14 +247,14 @@
class FloodTask : public Runnable {
public:
FloodTask(const size_t id, Monitor& mon) : _id(id), _mon(mon) {}
- ~FloodTask() {
+ ~FloodTask() override {
if (_id % 10000 == 0) {
Synchronized sync(_mon);
std::cout << "\t\tthread " << _id << " done" << std::endl;
}
}
- void run() {
+ void run() override {
if (_id % 10000 == 0) {
Synchronized sync(_mon);
std::cout << "\t\tthread " << _id << " started" << std::endl;