X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Ffusion%2Fadapted%2Fstruct%2Fdetail%2Fadapt_base.hpp;h=1c8f040850f95c457cc5ab4929bf551ae353ba36;hp=b2d81cf8cbdbb85509de43f3d7bc9244c94ec32b;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/fusion/adapted/struct/detail/adapt_base.hpp b/boost/fusion/adapted/struct/detail/adapt_base.hpp index b2d81cf..1c8f040 100644 --- a/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -1,7 +1,7 @@ /*============================================================================= Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden - Copyright (c) 2009-2010 Christopher Schmidt + Copyright (c) 2009-2011 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -87,15 +88,41 @@ I, \ ATTRIBUTE) +#ifdef BOOST_MSVC +# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM(R,_,ELEM) \ + typedef ELEM ELEM; +# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL(SEQ) \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM, \ + _, \ + BOOST_PP_SEQ_TAIL(SEQ)) +# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ) \ + BOOST_PP_IF( \ + BOOST_PP_SEQ_HEAD(SEQ), \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL, \ + BOOST_PP_TUPLE_EAT(1))(SEQ) +#else +# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ) +#endif + #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ > \ - struct struct_member \ + struct access::struct_member< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ + typedef \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ + attribute_type; \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + \ + typedef attribute_type type; \ \ template \ struct apply \ @@ -104,12 +131,8 @@ add_reference< \ typename mpl::eval_if< \ is_const \ - , add_const \ - , mpl::identity \ + , add_const \ + , mpl::identity \ >::type \ >::type \ type; \ @@ -163,18 +186,21 @@ namespace boost \ namespace extension \ { \ - BOOST_PP_SEQ_FOR_EACH_I_R( \ - 1, \ - BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \ - (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \ - ATTRIBUTES_SEQ) \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ + BOOST_PP_SEQ_FOR_EACH_I_R, \ + BOOST_PP_TUPLE_EAT(4))( \ + 1, \ + BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \ + (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \ + BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ > \ struct struct_size \ - : mpl::int_ \ + : mpl::int_ \ {}; \ \ template< \