Boost logo

Boost Users :

Subject: Re: [Boost-users] [variant] Length of variant
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-11-07 20:32:51


2009/11/7 Seweryn Habdank-Wojewódzki <seweryn_at_[hidden]>:
> Hi,
>
> According to Karlsson boost::variant is limited to 11 elements.
>
> Is there any option to extend that?
> What are the real limitations for the VS 9.0 and GCC 4.0?
> If number might be extended what might happen e.g. during compilation?
> Is the size somewhere defined once or is spread in all the code of variant?

As can be seen in variant_fwd.hpp, it seems the max size is defined by:

#define BOOST_VARIANT_LIMIT_TYPES \
    BOOST_MPL_LIMIT_LIST_SIZE

You might try defining BOOST_VARIANT_LIMIT_TYPES before including the
variant header and see if that works?

#define BOOST_VARIANT_LIMIT_TYPES 20
#include <boost/variant/variant.hpp>


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