Ticket #9238: is_container.patch

File is_container.patch, 1.1 KB (added by Mario Lang <mlang@…>, 9 years ago)

Proposed patch to allow is_container<> to work if BOOST_VARIANT_USE_VARIADIC_TEMPLATES is defined

  • boost/spirit/home/support/container.hpp

     
    5959      : is_container<T>
    6060    {};
    6161
     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
    6274#define BOOST_SPIRIT_IS_CONTAINER(z, N, data)                                 \
    6375        is_container<BOOST_PP_CAT(T, N)>::value ||                            \
    6476    /***/
     
    7688    {};
    7789
    7890#undef BOOST_SPIRIT_IS_CONTAINER
     91#endif
    7992
    8093    template <typename T, typename Enable/* = void*/>
    8194    struct is_iterator_range