
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? Best regards, Seweryn Habdank-Wojewodzki.

2009/11/7 Seweryn Habdank-Wojewódzki
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

You can also put your types in mpl::vector or mpl::vectorNN and then use make_variant_over metafunction.
participants (3)
-
Igor R
-
OvermindDL1
-
Seweryn Habdank-Wojewódzki