use noexcept instead of throw() in library
diff --git a/lib/cpp/src/thrift/TApplicationException.h b/lib/cpp/src/thrift/TApplicationException.h
index 81d9424..60618fb 100644
--- a/lib/cpp/src/thrift/TApplicationException.h
+++ b/lib/cpp/src/thrift/TApplicationException.h
@@ -57,7 +57,7 @@
TApplicationException(TApplicationExceptionType type, const std::string& message)
: TException(message), type_(type) {}
- virtual ~TApplicationException() throw() {}
+ virtual ~TApplicationException() noexcept {}
/**
* Returns an error code that provides information about the type of error
@@ -67,7 +67,7 @@
*/
TApplicationExceptionType getType() const { return type_; }
- virtual const char* what() const throw() {
+ virtual const char* what() const noexcept {
if (message_.empty()) {
switch (type_) {
case UNKNOWN:
diff --git a/lib/cpp/src/thrift/Thrift.h b/lib/cpp/src/thrift/Thrift.h
index e8e70eb..b41d5d2 100644
--- a/lib/cpp/src/thrift/Thrift.h
+++ b/lib/cpp/src/thrift/Thrift.h
@@ -82,9 +82,9 @@
TException(const std::string& message) : message_(message) {}
- virtual ~TException() throw() {}
+ virtual ~TException() noexcept {}
- virtual const char* what() const throw() {
+ virtual const char* what() const noexcept {
if (message_.empty()) {
return "Default TException.";
} else {
diff --git a/lib/cpp/src/thrift/protocol/TProtocolException.h b/lib/cpp/src/thrift/protocol/TProtocolException.h
index 6e536b4..10178e1 100644
--- a/lib/cpp/src/thrift/protocol/TProtocolException.h
+++ b/lib/cpp/src/thrift/protocol/TProtocolException.h
@@ -59,7 +59,7 @@
TProtocolException(TProtocolExceptionType type, const std::string& message)
: apache::thrift::TException(message), type_(type) {}
- virtual ~TProtocolException() throw() {}
+ virtual ~TProtocolException() noexcept {}
/**
* Returns an error code that provides information about the type of error
@@ -69,7 +69,7 @@
*/
TProtocolExceptionType getType() const { return type_; }
- virtual const char* what() const throw() {
+ virtual const char* what() const noexcept {
if (message_.empty()) {
switch (type_) {
case UNKNOWN:
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 251ef2f..5f8a2c0 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -1046,14 +1046,14 @@
/**
* Default implementation of AccessManager
*/
-Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa) throw() {
+Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa) noexcept {
(void)sa;
return SKIP;
}
Decision DefaultClientAccessManager::verify(const string& host,
const char* name,
- int size) throw() {
+ int size) noexcept {
if (host.empty() || name == NULL || size <= 0) {
return SKIP;
}
@@ -1062,7 +1062,7 @@
Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa,
const char* data,
- int size) throw() {
+ int size) noexcept {
bool match = false;
if (sa.ss_family == AF_INET && size == sizeof(in_addr)) {
match = (memcmp(&((sockaddr_in*)&sa)->sin_addr, data, size) == 0);
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.h b/lib/cpp/src/thrift/transport/TSSLSocket.h
index ec30cc1..d8fd77e 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.h
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.h
@@ -335,7 +335,7 @@
TSSLException(const std::string& message)
: TTransportException(TTransportException::INTERNAL_ERROR, message) {}
- virtual const char* what() const throw() {
+ virtual const char* what() const noexcept {
if (message_.empty()) {
return "TSSLException";
} else {
@@ -386,7 +386,7 @@
* @param sa Peer IP address
* @return True if the peer is trusted, false otherwise
*/
- virtual Decision verify(const sockaddr_storage& /* sa */) throw() { return DENY; }
+ virtual Decision verify(const sockaddr_storage& /* sa */) noexcept { return DENY; }
/**
* Determine whether the peer should be granted access or not. It's called
* every time a DNS subjectAltName/common name is extracted from peer's
@@ -402,7 +402,7 @@
*/
virtual Decision verify(const std::string& /* host */,
const char* /* name */,
- int /* size */) throw() {
+ int /* size */) noexcept {
return DENY;
}
/**
@@ -416,7 +416,7 @@
*/
virtual Decision verify(const sockaddr_storage& /* sa */,
const char* /* data */,
- int /* size */) throw() {
+ int /* size */) noexcept {
return DENY;
}
};
@@ -426,9 +426,9 @@
class DefaultClientAccessManager : public AccessManager {
public:
// AccessManager interface
- Decision verify(const sockaddr_storage& sa) throw();
- Decision verify(const std::string& host, const char* name, int size) throw();
- Decision verify(const sockaddr_storage& sa, const char* data, int size) throw();
+ Decision verify(const sockaddr_storage& sa) noexcept;
+ Decision verify(const std::string& host, const char* name, int size) noexcept;
+ Decision verify(const sockaddr_storage& sa, const char* data, int size) noexcept;
};
}
}
diff --git a/lib/cpp/src/thrift/transport/TTransportException.cpp b/lib/cpp/src/thrift/transport/TTransportException.cpp
index 9e15dbd..a527317 100644
--- a/lib/cpp/src/thrift/transport/TTransportException.cpp
+++ b/lib/cpp/src/thrift/transport/TTransportException.cpp
@@ -28,7 +28,7 @@
namespace thrift {
namespace transport {
-const char* TTransportException::what() const throw() {
+const char* TTransportException::what() const noexcept {
if (message_.empty()) {
switch (type_) {
case UNKNOWN:
diff --git a/lib/cpp/src/thrift/transport/TTransportException.h b/lib/cpp/src/thrift/transport/TTransportException.h
index dbbb971..fb5f00c 100644
--- a/lib/cpp/src/thrift/transport/TTransportException.h
+++ b/lib/cpp/src/thrift/transport/TTransportException.h
@@ -65,7 +65,7 @@
TTransportException(TTransportExceptionType type, const std::string& message, int errno_copy)
: apache::thrift::TException(message + ": " + TOutput::strerror_s(errno_copy)), type_(type) {}
- virtual ~TTransportException() throw() {}
+ virtual ~TTransportException() noexcept {}
/**
* Returns an error code that provides information about the type of error
@@ -73,9 +73,9 @@
*
* @return Error code
*/
- TTransportExceptionType getType() const throw() { return type_; }
+ TTransportExceptionType getType() const noexcept { return type_; }
- virtual const char* what() const throw();
+ virtual const char* what() const noexcept;
protected:
/** Just like strerror_r but returns a C++ string object. */
diff --git a/lib/cpp/src/thrift/transport/TZlibTransport.h b/lib/cpp/src/thrift/transport/TZlibTransport.h
index a0fb464..59acd69 100644
--- a/lib/cpp/src/thrift/transport/TZlibTransport.h
+++ b/lib/cpp/src/thrift/transport/TZlibTransport.h
@@ -38,7 +38,7 @@
zlib_status_(status),
zlib_msg_(msg == NULL ? "(null)" : msg) {}
- virtual ~TZlibTransportException() throw() {}
+ virtual ~TZlibTransportException() noexcept {}
int getZlibStatus() { return zlib_status_; }
std::string getZlibMessage() { return zlib_msg_; }