Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-08-30 14:02:23


AMDG

Hicham Mouline wrote:
> Hello,
>
> how can one make variants over mpl sequences with over 20 types?
> i tried to redefine BOOST_VARIANT_LIMIT_TYPES to 21 for e.g. without success,
>

The following compiles for me.

#include <boost/mpl/range_c.hpp>
#include <boost/variant.hpp>
#include <boost/mpl/vector/vector50.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/copy.hpp>

typedef boost::make_variant_over<
    boost::mpl::copy<
        boost::mpl::range_c<int, 0, 30>,
        boost::mpl::back_inserter<boost::mpl::vector0<> >
>::type
>::type variant_type;

int main() {
    variant_type v;
}

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net