
2014/1/21 Agustín K-ballo Bergé <kaballo86@hotmail.com>
While trying to make _Boost.Spirit_ work after the breaking changes, I found a problem with the following snippet:
#include <boost/variant.hpp> #include <boost/mpl/bool.hpp>
template <typename T> struct is_container : boost::mpl::false_ {};
template <typename T> struct is_container<boost::variant<T>> : is_container<T> {};
template <BOOST_VARIANT_ENUM_PARAMS(typename T)> struct is_container<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>> : boost::mpl::bool_<is_container<T0>::value || is_container<boost::variant<BOOST_VARIANT_ENUM_SHIFTED_PARAMS(T)>>::value> // #13 {};
int main() { is_container<boost::variant<double, int>>::value; }
If I understand correctly, this should work for both the variadic and non-variadic cases. However, trying this with both MSVC2013 and NovCTP13 gives the following error:
main.cpp(13): error C2976: 'boost::variant' : too few template arguments
Added test case and disabled usage of variadic templates in Boost.Variant for MSVC2013 ( https://github.com/boostorg/variant/commit/63fb3ff4270e3032c0a171507bb41718e... ) -- Best regards, Antony Polukhin