Skip to content

Commit

Permalink
THRIFT-5660: Revert "lib: cpp: TTransportException: create thrift::nu…
Browse files Browse the repository at this point in the history
…meric_cast"

This reverts commit 6e9cbbd.

See https://issues.apache.org/jira/browse/THRIFT-5660 for a discussion.
  • Loading branch information
emmenlau committed Oct 14, 2023
1 parent 3fdc636 commit 49e4cea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 73 deletions.
70 changes: 0 additions & 70 deletions lib/cpp/src/thrift/numeric_cast.h

This file was deleted.

5 changes: 2 additions & 3 deletions lib/cpp/src/thrift/transport/TTransportException.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
#ifndef _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_
#define _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_ 1

#include <boost/numeric/conversion/cast.hpp>
#include <string>

#include <thrift/numeric_cast.h>
#include <thrift/Thrift.h>

namespace apache {
Expand Down Expand Up @@ -93,7 +92,7 @@ class TTransportException : public apache::thrift::TException {
*/
template <typename To, typename From> To safe_numeric_cast(From i) {
try {
return apache::thrift::numeric_cast<To>(i);
return boost::numeric_cast<To>(i);
}
catch (const std::bad_cast& bc) {
throw TTransportException(TTransportException::CORRUPTED_DATA,
Expand Down

0 comments on commit 49e4cea

Please sign in to comment.