diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index 3986f00..dfd833d 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -1394,7 +1394,14 @@ namespace boost { } template +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + bool shl_input_streamable(InputStreamable&& input) { + typedef InputStreamable&& forward_type; +#else bool shl_input_streamable(InputStreamable& input) { + typedef InputStreamable& forward_type; +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES + #if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE) // If you have compilation error at this point, than your STL library // does not support such conversions. Try updating it. @@ -1405,7 +1412,7 @@ namespace boost { out_stream.exceptions(std::ios::badbit); try { #endif - bool const result = !(out_stream << input).fail(); + bool const result = !(out_stream << static_cast(input)).fail(); const buffer_t* const p = static_cast( static_cast*>(out_stream.rdbuf()) );