From 5a8aba52c9838c678f008c24dd30fdda2a7b247a Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Thu, 13 Nov 2003 11:53:32 +0000 Subject: [PATCH] VC 7.0 ETI fix [SVN r20801] --- include/boost/mpl/aux_/deref_wknd.hpp | 36 ++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/include/boost/mpl/aux_/deref_wknd.hpp b/include/boost/mpl/aux_/deref_wknd.hpp index f866b8b..ad22de4 100644 --- a/include/boost/mpl/aux_/deref_wknd.hpp +++ b/include/boost/mpl/aux_/deref_wknd.hpp @@ -3,7 +3,7 @@ // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // -// Copyright (c) 2001-02 +// Copyright (c) 2001-03 // Aleksey Gurtovoy // // Permission to use, copy, modify, distribute and sell this software @@ -17,14 +17,16 @@ #ifndef BOOST_MPL_AUX_DEREF_WNKD_HPP_INCLUDED #define BOOST_MPL_AUX_DEREF_WNKD_HPP_INCLUDED +#include "boost/mpl/aux_/is_msvc_eti_arg.hpp" #include "boost/mpl/aux_/config/eti.hpp" #if defined(BOOST_MPL_MSVC_ETI_BUG) namespace boost { namespace mpl { namespace aux { -template< typename Iterator > -struct deref_wknd +# if defined(BOOST_MPL_MSVC_60_ETI_BUG) + +template< typename Iterator > struct deref_wknd { typedef typename Iterator::type type; }; @@ -34,6 +36,32 @@ template<> struct deref_wknd typedef int type; }; +# else + +template< bool > struct deref_wknd_impl +{ + template< typename Iterator > struct result_ + { + typedef typename Iterator::type type; + }; +}; + +template<> struct deref_wknd_impl +{ + template< typename Iterator > struct result_ + { + typedef int type; + }; +}; + +template< typename Iterator > struct deref_wknd + : deref_wknd_impl< !aux::is_msvc_eti_arg::value > + ::template result_ +{ +}; + +# endif // BOOST_MPL_MSVC_60_ETI_BUG + }}} // namespace boost::mpl::aux # define BOOST_MPL_AUX_DEREF_WNKD(iter) ::boost::mpl::aux::deref_wknd::type @@ -42,6 +70,6 @@ template<> struct deref_wknd # define BOOST_MPL_AUX_DEREF_WNKD(iter) iter::type -#endif +#endif // BOOST_MPL_MSVC_ETI_BUG #endif // BOOST_MPL_AUX_DEREF_WNKD_HPP_INCLUDED