Prudhvi Dharmana created THRIFT-5117:
----------------------------------------

             Summary: OStream not generated for unordered_map and unordered_set
                 Key: THRIFT-5117
                 URL: https://issues.apache.org/jira/browse/THRIFT-5117
             Project: Thrift
          Issue Type: Bug
            Reporter: Prudhvi Dharmana


When trying to compile with custom map, i.e. unordered_map for c++, the method 
`printTo` fails when trying to use `::apache::thrift::to_string` on an object 
of unordered_map. This is because the template specialization for `to_string` 
does not include the type for `unordered_map` or `unordered_set` 
{code:java}
:basic_string<char>, utils::Stat>, std::__cxx11::basic_string<char> >'
/usr/include/boost/lexical_cast/detail/converter_lexical.hpp:465:15: required 
from 'struct 
boost::detail::lexical_converter_impl<std::__cxx11::basic_string<char>, 
std::unordered_map<std::__cxx11::basic_string<char>, utils::Stat> >'
/usr/include/boost/lexical_cast/try_lexical_convert.hpp:173:44: required from 
'bool boost::conversion::detail::try_lexical_convert(const Source&, Target&) 
[with Target = std::__cxx11::basic_string<char>; Source = 
std::unordered_map<std::__cxx11::basic_string<char>, utils::Stat>]'
/usr/include/boost/lexical_cast.hpp:41:60: required from 'Target 
boost::lexical_cast(const Source&) [with Target = 
std::__cxx11::basic_string<char>; Source = 
std::unordered_map<std::__cxx11::basic_string<char>, utils::Stat>]'
/usr/include/thrift/TToString.h:37:42: required from 'std::__cxx11::string 
apache::thrift::to_string(const T&) [with T = 
std::unordered_map<std::__cxx11::basic_string<char>, utils::Stat>; 
std::__cxx11::string = std::__cxx11::basic_string<char>]'
filesystem_types.cpp:1111:56: required from here
/usr/include/boost/lexical_cast/detail/converter_lexical.hpp:209:13: error: 
static assertion failed: Source type is neither std::ostream`able nor 
std::wostream`able
 BOOST_STATIC_ASSERT_MSG((result_t::value || boost::has_left_shift< 
std::basic_ostream< type >, T >::value),
{code}
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to