From 3cadfa529e257a19ee5df656289d37259d70f354 Mon Sep 17 00:00:00 2001 From: Raoul Gough Date: Mon, 17 Nov 2003 19:29:09 +0000 Subject: [PATCH] Use mpl::apply1 with its MSVC6 workarounds to fully support Generator parameter [SVN r20834] --- .../python/suite/indexing/container_proxy.hpp | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/include/boost/python/suite/indexing/container_proxy.hpp b/include/boost/python/suite/indexing/container_proxy.hpp index 4f5df942..c0a58272 100755 --- a/include/boost/python/suite/indexing/container_proxy.hpp +++ b/include/boost/python/suite/indexing/container_proxy.hpp @@ -34,6 +34,7 @@ #include // Default pointer container #include #include +#include #include #include #include @@ -41,6 +42,7 @@ #include namespace boost { namespace python { namespace indexing { + template struct identity { typedef T held_type; @@ -74,6 +76,19 @@ namespace boost { namespace python { namespace indexing { }; }; +#if BOOST_WORKAROUND (BOOST_MSVC, == 1200) + // Early template instantiation (ETI) workaround + namespace detail { + template struct msvc6_iterator { + typedef Container::iterator type; + }; + + template<> struct msvc6_iterator { + typedef int *type; + }; + } +#endif + template , class Generator = vector_generator> @@ -254,16 +269,15 @@ namespace boost { namespace python { namespace indexing { private: typedef boost::shared_ptr pointer_impl; -#if defined (BOOST_NO_MEMBER_TEMPLATES) \ - && defined (BOOST_MSVC6_MEMBER_TEMPLATES) - // Ignore the Generator argument, to avoid an MSVC6 fatal error - // (C1001 internal compiler error). - typedef std::vector pointer_container; + + typedef typename mpl::apply1::type + pointer_container; + +#if BOOST_WORKAROUND (BOOST_MSVC, == 1200) + typedef detail::msvc6_iterator::type pointer_iterator; #else - typedef typename Generator::BOOST_PYTHON_INDEXING_NESTED_TEMPLATE - apply::type pointer_container; -#endif typedef typename pointer_container::iterator pointer_iterator; +#endif #if defined (BOOST_NO_MEMBER_TEMPLATE_FRIENDS) // Proxies need mutable access, and can't be friends with MSVC6