Ticket #9238: spirit-variant-variadic.patch
File spirit-variant-variadic.patch, 4.7 KB (added by , 9 years ago) |
---|
-
boost/spirit/home/qi/detail/pass_container.hpp
198 198 // We pass through the container attribute if at least one of the embedded 199 199 // types in the variant requires to pass through the attribute 200 200 201 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(BOOST_VARIANT_USE_VARIADIC_TEMPLATES) 202 template <typename Container, typename ValueType, typename Sequence 203 , typename T> 204 struct pass_through_container<Container, ValueType, boost::variant<T>, Sequence> 205 : pass_through_container<Container, ValueType, T, Sequence> 206 {}; 207 208 template <typename Container, typename ValueType, typename Sequence 209 , BOOST_VARIANT_ENUM_PARAMS(typename T)> 210 struct pass_through_container<Container, ValueType 211 , boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Sequence> 212 : mpl::bool_<pass_through_container<Container, ValueType, T0, Sequence>::type::value || 213 pass_through_container<Container, ValueType, boost::variant<TN...>, Sequence>::type::value> 214 {}; 215 #else 201 216 #define BOOST_SPIRIT_PASS_THROUGH_CONTAINER(z, N, _) \ 202 217 pass_through_container<Container, ValueType, \ 203 218 BOOST_PP_CAT(T, N), Sequence>::type::value || \ … … 219 234 {}; 220 235 221 236 #undef BOOST_SPIRIT_PASS_THROUGH_CONTAINER 237 #endif 222 238 }}}} 223 239 224 240 /////////////////////////////////////////////////////////////////////////////// -
boost/spirit/home/support/attributes.hpp
202 202 struct is_weak_substitute<T, optional<Expected> > 203 203 : is_weak_substitute<T, Expected> {}; 204 204 205 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(BOOST_VARIANT_USE_VARIADIC_TEMPLATES) 206 template <typename T, typename Expected> 207 struct is_weak_substitute<boost::variant<T>, Expected> 208 : is_weak_substitute<T, Expected> 209 {}; 210 211 template <BOOST_VARIANT_ENUM_PARAMS(typename T), typename Expected> 212 struct is_weak_substitute<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, 213 Expected> 214 : mpl::bool_<is_weak_substitute<T0, Expected>::type::value && 215 is_weak_substitute<boost::variant<TN...>, Expected>::type::value> 216 {}; 217 #else 205 218 #define BOOST_SPIRIT_IS_WEAK_SUBSTITUTE(z, N, _) \ 206 219 is_weak_substitute<BOOST_PP_CAT(T, N), Expected>::type::value && \ 207 220 /***/ … … 220 233 {}; 221 234 222 235 #undef BOOST_SPIRIT_IS_WEAK_SUBSTITUTE 236 #endif 223 237 224 238 template <typename T> 225 239 struct is_weak_substitute<T, T -
boost/spirit/home/support/container.hpp
59 59 : is_container<T> 60 60 {}; 61 61 62 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(BOOST_VARIANT_USE_VARIADIC_TEMPLATES) 63 template<typename T> 64 struct is_container< boost::variant<T> > 65 : is_container<T> 66 {}; 67 68 template<BOOST_VARIANT_ENUM_PARAMS(typename T)> 69 struct is_container< boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> > 70 : mpl::bool_<is_container<T0>::value || 71 is_container< boost::variant<TN...> >::value> {}; 72 73 #else 62 74 #define BOOST_SPIRIT_IS_CONTAINER(z, N, data) \ 63 75 is_container<BOOST_PP_CAT(T, N)>::value || \ 64 76 /***/ … … 76 88 {}; 77 89 78 90 #undef BOOST_SPIRIT_IS_CONTAINER 91 #endif 79 92 80 93 template <typename T, typename Enable/* = void*/> 81 94 struct is_iterator_range -
boost/spirit/home/support/detail/as_variant.hpp
30 30 template <int size> 31 31 struct as_variant_impl; 32 32 33 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(BOOST_VARIANT_USE_VARIADIC_TEMPLATES) 34 #else 33 35 template <> 34 36 struct as_variant_impl<0> 35 37 { … … 39 41 typedef variant<> type; 40 42 }; 41 43 }; 44 #endif 42 45 43 46 #define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \ 44 47 typedef typename fusion::result_of::next<BOOST_PP_CAT(I, n)>::type \