diff options
author | Sebastian Zenker <sebastian.zenker@gmx.de> | 2019-01-29 15:48:12 +0100 |
---|---|---|
committer | James E. King III <jking@apache.org> | 2019-01-29 09:48:12 -0500 |
commit | 042580f53441efe1bc5c80c89351fcb30740659e (patch) | |
tree | fb6504554a4dfa07dc4de09394be0f69a2b38cfd /lib/cpp/src/thrift/Thrift.h | |
parent | aa0c8b35d8f78812de1d7803d6277a37d2ed593a (diff) | |
download | thrift-042580f53441efe1bc5c80c89351fcb30740659e.tar.gz |
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
Diffstat (limited to 'lib/cpp/src/thrift/Thrift.h')
-rw-r--r-- | lib/cpp/src/thrift/Thrift.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/cpp/src/thrift/Thrift.h b/lib/cpp/src/thrift/Thrift.h index 63227426d..951cc2865 100644 --- a/lib/cpp/src/thrift/Thrift.h +++ b/lib/cpp/src/thrift/Thrift.h @@ -79,9 +79,9 @@ public: TException(const std::string& message) : message_(message) {} - virtual ~TException() noexcept {} + ~TException() noexcept override = default; - virtual const char* what() const noexcept { + const char* what() const noexcept override { if (message_.empty()) { return "Default TException."; } else { @@ -98,14 +98,14 @@ public: template <class E> static TDelayedException* delayException(const E& e); virtual void throw_it() = 0; - virtual ~TDelayedException(){}; + virtual ~TDelayedException()= default;; }; template <class E> class TExceptionWrapper : public TDelayedException { public: TExceptionWrapper(const E& e) : e_(e) {} - virtual void throw_it() { + void throw_it() override { E temp(e_); delete this; throw temp; |