From ea8fdd236d752674e9029ee89c23a1561dafd33a Mon Sep 17 00:00:00 2001 From: Jonathan Turkanis Date: Fri, 4 Feb 2005 21:27:02 +0000 Subject: [PATCH] added manual overload resolution for VC6-7.0 [SVN r27117] --- include/boost/iostreams/detail/push.hpp | 28 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/include/boost/iostreams/detail/push.hpp b/include/boost/iostreams/detail/push.hpp index 00eae2a..71395b4 100755 --- a/include/boost/iostreams/detail/push.hpp +++ b/include/boost/iostreams/detail/push.hpp @@ -19,7 +19,9 @@ #include #include #include -#include +#include +#include +#include #include #include @@ -78,8 +80,7 @@ BOOST_IOSTREAMS_PUSH_ARGS() ); } \ template \ BOOST_PP_EXPR_IF(has_return, result) \ - name( const ::boost::iostreams::detail::piper& p \ - BOOST_IOSTREAMS_PUSH_PARAMS() ) \ + name(const ::boost::iostreams::detail::piper& p) \ { p.push(*this); } \ template \ BOOST_PP_EXPR_IF(has_return, result) \ @@ -89,16 +90,25 @@ /**/ #else // #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \ - template \ + template \ BOOST_PP_EXPR_IF(has_return, result) \ - name( const ::boost::iostreams::detail::piper& p \ - BOOST_IOSTREAMS_PUSH_PARAMS() ) \ - { p.push(*this); } \ + BOOST_PP_CAT(name, _msvc_impl) \ + ( ::boost::mpl::true_, const T& t BOOST_IOSTREAMS_PUSH_PARAMS() ) \ + { t.push(*this); } \ + template \ + BOOST_PP_EXPR_IF(has_return, result) \ + BOOST_PP_CAT(name, _msvc_impl) \ + ( ::boost::mpl::false_, const T& t BOOST_IOSTREAMS_PUSH_PARAMS() ) \ + { this->helper( ::boost::iostreams::detail::resolve(t) \ + BOOST_IOSTREAMS_PUSH_ARGS() ); } \ template \ BOOST_PP_EXPR_IF(has_return, result) \ name(const T& t BOOST_IOSTREAMS_PUSH_PARAMS()) \ - { this->helper( ::boost::iostreams::detail::resolve(t) \ - BOOST_IOSTREAMS_PUSH_ARGS() ); } \ + { \ + this->BOOST_PP_CAT(name, _msvc_impl) \ + ( ::boost::iostreams::detail::is_piper(), \ + t BOOST_IOSTREAMS_PUSH_ARGS() ); \ + } \ /**/ #endif // #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)