[ 
https://issues.apache.org/jira/browse/THRIFT-3513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

phoneli updated THRIFT-3513:
----------------------------
    Description: 
In Source Code " lib/cpp/src/thrift/TToString.h " , 
lines between 34~37 :
         template <typename T>
         std::string to_string(const T& t) {
             return boost::lexical_cast<std::string>(t);
         }


the function "to_string" is not compatible for int8_t(byte) when using 
std::cout or printf


The Codes should change like this :
        template <typename T>
        std::string to_string(const T& t) {
           return boost::lexical_cast<std::string>(t);
        }
        std::string to_string(const int_8 & t) {
          return boost::lexical_cast<std::string>(static_cast<int>(t));
        }




  was:
In Source Code " lib/cpp/src/thrift/TToString.h " , 
lines between 34~37 :
         template <typename T>
         std::string to_string(const T& t) {
             return boost::lexical_cast<std::string>(t);
         }


the function "to_string" is not compatible for int8_t(byte) when using 
std::cout or print


The Codes should change like this :
        template <typename T>
        std::string to_string(const T& t) {
           return boost::lexical_cast<std::string>(t);
        }
        std::string to_string(const int_8 & t) {
          return boost::lexical_cast<std::string>(static_cast<int>(t));
        }





> lib/cpp/src/thrift/TToString.h : the function "to_string" is not compatible 
> for int8_t(byte)
> --------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3513
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3513
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.3
>         Environment: centos6.4 , x84_64 , g++ 4.4.7
>            Reporter: phoneli
>              Labels: bug
>
> In Source Code " lib/cpp/src/thrift/TToString.h " , 
> lines between 34~37 :
>          template <typename T>
>          std::string to_string(const T& t) {
>              return boost::lexical_cast<std::string>(t);
>          }
> the function "to_string" is not compatible for int8_t(byte) when using 
> std::cout or printf
> The Codes should change like this :
>         template <typename T>
>         std::string to_string(const T& t) {
>            return boost::lexical_cast<std::string>(t);
>         }
>         std::string to_string(const int_8 & t) {
>           return boost::lexical_cast<std::string>(static_cast<int>(t));
>         }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to