From 319ef0fffe996149616e4a3cec4ff1c2fcb3e08c Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Thu, 17 Jul 2003 09:26:49 +0000 Subject: [PATCH] is_sequence/list fix for MSVC [SVN r19168] --- include/boost/mpl/list/aux_/node.hpp | 9 +++++++++ test/is_sequence.cpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/include/boost/mpl/list/aux_/node.hpp b/include/boost/mpl/list/aux_/node.hpp index b9aa065..8484b3b 100644 --- a/include/boost/mpl/list/aux_/node.hpp +++ b/include/boost/mpl/list/aux_/node.hpp @@ -19,6 +19,8 @@ #include "boost/mpl/integral_c.hpp" #include "boost/mpl/list/aux_/tag.hpp" +#include "boost/mpl/aux_/config/msvc.hpp" +#include "boost/mpl/aux_/config/workaround.hpp" namespace boost { namespace mpl { @@ -30,6 +32,10 @@ template< > struct list_node { +// agurt, 17/jul/03: to facilitate the deficient 'is_sequence' implementation +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + typedef int begin; +#endif typedef aux::list_tag tag; typedef list_node type; @@ -40,6 +46,9 @@ struct list_node struct null_node { +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + typedef int begin; +#endif typedef aux::list_tag tag; typedef null_node type; typedef integral_c size; diff --git a/test/is_sequence.cpp b/test/is_sequence.cpp index 05fe23f..d6c3391 100644 --- a/test/is_sequence.cpp +++ b/test/is_sequence.cpp @@ -34,7 +34,9 @@ int main() BOOST_STATIC_ASSERT(!is_sequence< UDT* >::value); BOOST_STATIC_ASSERT((is_sequence< range_c >::value)); BOOST_STATIC_ASSERT(is_sequence< list<> >::value); + BOOST_STATIC_ASSERT(is_sequence< list >::value); BOOST_STATIC_ASSERT(is_sequence< vector<> >::value); + BOOST_STATIC_ASSERT(is_sequence< vector >::value); return 0; }