diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 0be192a..61ffb0c 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -562,22 +562,17 @@ struct return_type_2, A, B> namespace detail { +#ifdef BOOST_NO_TEMPLATED_STREAMS + template struct leftshift_type { typedef typename detail::IF< -#ifdef BOOST_NO_TEMPLATED_STREAMS boost::is_convertible< typename boost::remove_reference::type*, std::ostream* >::value, -#else - is_instance_of_2< - typename boost::remove_reference::type, - std::basic_ostream - >::value, -#endif - typename boost::add_reference::type, //reference to the stream + std::ostream&, typename detail::remove_reference_and_cv::type >::RET type; }; @@ -586,22 +581,55 @@ template struct rightshift_type { typedef typename detail::IF< -#ifdef BOOST_NO_TEMPLATED_STREAMS + boost::is_convertible< typename boost::remove_reference::type*, std::istream* >::value, -#else - is_instance_of_2< - typename boost::remove_reference::type, - std::basic_istream - >::value, -#endif - typename boost::add_reference::type, //reference to the stream + std::istream&, typename detail::remove_reference_and_cv::type >::RET type; }; +#else + +template struct get_ostream_type { + typedef std::basic_ostream& type; +}; + +template struct get_istream_type { + typedef std::basic_istream& type; +}; + +template +struct leftshift_type { +private: + typedef typename boost::remove_reference::type plainA; +public: + typedef typename detail::IF_type< + is_instance_of_2::value, + get_ostream_type, //reference to the stream + detail::remove_reference_and_cv + >::type type; +}; + +template +struct rightshift_type { +private: + typedef typename boost::remove_reference::type plainA; +public: + typedef typename detail::IF_type< + is_instance_of_2::value, + get_istream_type, //reference to the stream + detail::remove_reference_and_cv + >::type type; +}; + + +#endif + } // end detail // ostream