Index: detail/core/linker.hpp =================================================================== --- detail/core/linker.hpp (revision 9) +++ detail/core/linker.hpp (working copy) @@ -22,7 +22,13 @@ #include #include #include -#include + +#if defined BOOST_XPRESSIVE_FUSION_V2 +# include +#else +# include +#endif // BOOST_XPRESSIVE_FUSION_V2 + #include #include #include @@ -255,7 +261,11 @@ , xpression_peeker &peeker ) { - fusion::for_each(alternates.cast(), alt_link_pred(*this, peeker, next)); +# if defined BOOST_XPRESSIVE_FUSION_V2 + fusion::for_each(alternates.derived(), alt_link_pred(*this, peeker, next)); +# else + fusion::for_each(alternates.cast(), alt_link_pred(*this, peeker, next)); +# endif //BOOST_XPRESSIVE_FUSION_V2 } template Index: detail/core/matcher/alternate_matcher.hpp =================================================================== --- detail/core/matcher/alternate_matcher.hpp (revision 9) +++ detail/core/matcher/alternate_matcher.hpp (working copy) @@ -26,8 +26,14 @@ #endif #include -#include -#include +#if defined BOOST_XPRESSIVE_FUSION_V2 +# include +# include +#else +# include +# include +#endif //BOOST_XPRESSIVE_FUSION_V2 + #include #include #include @@ -88,17 +94,31 @@ ) { typedef alt_match_pred alt_match_pred; +# if defined BOOST_XPRESSIVE_FUSION_V2 + return fusion::any(alternates.derived(), alt_match_pred(state)); +# else return fusion::any(alternates.cast(), alt_match_pred(state)); +# endif //BOOST_XPRESSIVE_FUSION_V2 + } /////////////////////////////////////////////////////////////////////////////// // make_range +# if defined BOOST_XPRESSIVE_FUSION_V2 template - inline fusion::range make_range(Begin const &begin, End const &end) + inline fusion::iterator_range make_range(Begin const &begin, End const &end) { - return fusion::range(begin, end); + return fusion::iterator_range(begin, end); } +# else + template + inline fusion::range make_range(Begin const &begin, End const &end) + { + return fusion::range(begin, end); + } +# endif //BOOST_XPRESSIVE_FUSION_V2 + /////////////////////////////////////////////////////////////////////////////// // alt_get_width_pred // @@ -152,12 +172,23 @@ ) { typedef alt_get_width_pred alt_get_width_pred; + +# if defined BOOST_XPRESSIVE_FUSION_V2 + std::size_t width = (*fusion::begin(alternates.derived())).get_width(state); + fusion::for_each + ( + make_range(fusion::next(fusion::begin(alternates.derived())), fusion::end(alternates.derived())) + , alt_get_width_pred(state, &width) + ); +# else std::size_t width = (*fusion::begin(alternates.cast())).get_width(state); fusion::for_each ( make_range(fusion::next(fusion::begin(alternates.cast())), fusion::end(alternates.cast())) , alt_get_width_pred(state, &width) ); +# endif //BOOST_XPRESSIVE_FUSION_V2 + return width; } Index: detail/static/productions/alt_compilers.hpp =================================================================== --- detail/static/productions/alt_compilers.hpp (revision 9) +++ detail/static/productions/alt_compilers.hpp (working copy) @@ -9,6 +9,11 @@ #define BOOST_XPRESSIVE_DETAIL_STATIC_PRODUCTIONS_ALT_COMPILERS_HPP_EAN_10_04_2005 #include + +#if defined BOOST_XPRESSIVE_FUSION_V2 +# include +#endif //BOOST_XPRESSIVE_FUSION_V2 + #include #include #include Index: detail/utility/any.hpp =================================================================== --- detail/utility/any.hpp (revision 9) +++ detail/utility/any.hpp (working copy) @@ -13,8 +13,11 @@ #if BOOST_VERSION >= 103300 // In Boost 1.33+, we have a cons list in Fusion, so just include it. -# include - +# if defined BOOST_XPRESSIVE_FUSION_V2 +# include +# else +# include +# endif //BOOST_XPRESSIVE_FUSION_V2 #else # include Index: detail/utility/cons.hpp =================================================================== --- detail/utility/cons.hpp (revision 9) +++ detail/utility/cons.hpp (working copy) @@ -13,8 +13,11 @@ #if BOOST_VERSION >= 103300 // In Boost 1.33+, we have a cons list in Fusion, so just include it. -# include - +# if defined BOOST_XPRESSIVE_FUSION_V2 +# include +# else +# include +# endif //BOOST_XPRESSIVE_FUSION_V2 #else // For earlier versions of Boost, put the definition of cons here Index: proto/op_base.hpp =================================================================== --- proto/op_base.hpp (revision 9) +++ proto/op_base.hpp (working copy) @@ -22,7 +22,13 @@ #include #include #include -#include + +#if defined BOOST_XPRESSIVE_FUSION_V2 +# include +#else +# include +#endif //BOOST_XPRESSIVE_FUSION_V2 + #include #include Index: proto/proto_fwd.hpp =================================================================== --- proto/proto_fwd.hpp (revision 9) +++ proto/proto_fwd.hpp (working copy) @@ -11,13 +11,30 @@ #include #include -#include + +#if defined BOOST_XPRESSIVE_FUSION_V2 +# include + //version 2 has changed the tag void_t to void_, so this typedef is required + namespace boost { namespace fusion + { + typedef void_ void_t; + }} + + //FUSION_MAX_TUPLE_SIZE was not found by compiler: TODO check if this define is required +# if !defined FUSION_MAX_TUPLE_SIZE +# define FUSION_MAX_TUPLE_SIZE FUSION_MAX_VECTOR_SIZE +# endif //FUSION_MAX_TUPLE_SIZE +#else +# include +#endif + #include #ifndef BOOST_PROTO_MAX_ARITY # define BOOST_PROTO_MAX_ARITY FUSION_MAX_TUPLE_SIZE #endif + namespace boost { namespace proto { Index: xpressive.hpp =================================================================== --- xpressive.hpp (revision 9) +++ xpressive.hpp (working copy) @@ -15,6 +15,12 @@ # pragma once #endif +#if BOOST_VERSION >= 103500 +# ifndef BOOST_XPRESSIVE_FUSION_V2 +# define BOOST_XPRESSIVE_FUSION_V2 +# endif //BOOST_XPRESSIVE_FUSION_V2 +#endif //BOOST_VERSION + #include #include